-
Notifications
You must be signed in to change notification settings - Fork 66
Add get_address_stats
and get_address_txns
endpoints
#104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,32 @@ pub struct BlockSummary { | |
pub merkle_root: bitcoin::hash_types::TxMerkleNode, | ||
} | ||
|
||
/// Address statistics, includes the address, and the utxo information for the address. | ||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)] | ||
pub struct AddressStats { | ||
/// The address. | ||
pub address: String, | ||
/// The summary of transactions for this address, already on chain. | ||
pub chain_stats: AddressTxsSummary, | ||
/// The summary of transactions for this address, currently in the mempool. | ||
pub mempool_stats: AddressTxsSummary, | ||
} | ||
|
||
/// Contains a summary of the transactions for an address. | ||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do we need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like to derive There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see much problem, however, we are not deriving it for other APIs, so would rather keep that standard. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we merge this in and I can go through the API and add Copy to the other structs that make sense? @oleonardolima ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with it, I'd like to see what others think about it. |
||
pub struct AddressTxsSummary { | ||
/// The number of funded transaction outputs. | ||
pub funded_txo_count: u32, | ||
/// The sum of the funded transaction outputs, in satoshis. | ||
pub funded_txo_sum: u64, | ||
/// The number of spent transaction outputs. | ||
pub spent_txo_count: u32, | ||
/// The sum of the spent transaction outputs, in satoshis. | ||
pub spent_txo_sum: u64, | ||
/// The total number of transactions. | ||
pub tx_count: u32, | ||
} | ||
|
||
impl Tx { | ||
pub fn to_tx(&self) -> Transaction { | ||
Transaction { | ||
|
Uh oh!
There was an error while loading. Please reload this page.