-
Notifications
You must be signed in to change notification settings - Fork 65
feat: add get_address_utxos
method
#134
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
feat: add get_address_utxos
method
#134
Conversation
`get_address_utxos` hits the `/address/{address}/utxo` endpoint and returns a `Vec<Utxo>`
Pull Request Test Coverage Report for Build 16817757977Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 86d3d44
I've tested it with blocking client, and it worked just fine on both happy path, too many histories error and when it's unconfirmed.
/// Information about an UTXO's status: confirmation status, | ||
/// confirmation height, confirmation block hash and confirmation block time. | ||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize)] | ||
pub struct UtxoStatus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding docs here. Question: isn't this the same as the TxStatus
type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, structurally they are the same. But I preferred to create another struct with a name that matches what it models. We could change the name of TxStatus
to something generic, but I don't think that's very elegant, since these types are ad-hoc to what the API returns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 86d3d44
Closes #133.
This PR adds the
get_address_utxos
method, which hits the/address/{addr}/utxo
endpoint, returning aVec<Utxo>
.Changelog
UtxoStatus
.Utxo
.get_address_utxos
for both blocking and async clients.