Skip to content
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

Add /address/:addr/txs/summary endpoint #80

Merged
merged 3 commits into from
Mar 20, 2024
Merged

Conversation

mononaut
Copy link
Contributor

This PR adds a new /address/:address/txs/summary/(last_seen_txid?) endpoint which returns a condensed list of recent confirmed transactions related to an address combined with the blockheight, time, and net balance change.

The endpoint is paginated using the usual last_seen_txid format, with a maximum number of transactions configurable via --rest-default-max-address-summary-txs (default 5000).

Results are returned in the following format:

[
  {"txid":"7b7c9e70071f29a313caf8647cb9dc1790c5bd7de0e8f5920df478e50b715cc8","height":835193,"value":2549627168,"time":1710748543},
  {"txid":"80422fa3e348d5cc3f635a865be162e38d587366ca2cd859dee8f0b4709d2e55","height":835192,"value":-4340898,"time":1710748355},
  {"txid":"c31190e57a7756c32f9c7d1e6a9f2331f448328d75d9b8857bb611b0d221d13f","height":835192,"value":-9389074995,"time":1710748355},
  {"txid":"e31299b80f1666c9be00b9cc223bee646134f5312ddf40884af3fe8f5d83868b","height":835190,"value":-7016,"time":1710747746},
  {"txid":"23a0f71d70c6b244ccb246b480c3e645a81fb257131deac1a3bd7a98ace9d19b","height":835190,"value":2751,"time":1710747746},
]

@mononaut mononaut requested review from wiz and junderw March 18, 2024 08:18
src/rest.rs Show resolved Hide resolved
src/new_index/schema.rs Outdated Show resolved Hide resolved
Copy link
Member

@junderw junderw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@softsimon softsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK @ [9555742]

@softsimon softsimon merged commit d4f788f into mempool Mar 20, 2024
7 checks passed
@softsimon softsimon deleted the mononaut/address-summary branch March 20, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants