-
Notifications
You must be signed in to change notification settings - Fork 118
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 v2 addresses endpoints #1876
Conversation
Vercel deployment URL: https://stacks-blockchain-57zm3xiy4-blockstack.vercel.app 🚀 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1876 +/- ##
===========================================
+ Coverage 71.77% 72.02% +0.25%
===========================================
Files 92 93 +1
Lines 11913 12025 +112
Branches 2624 2654 +30
===========================================
+ Hits 8550 8661 +111
+ Misses 3209 3208 -1
- Partials 154 156 +2 ☔ View full report in Codecov by Sentry. |
Will add expanded counts for mint, burn and transfer for the Explorer |
const limit = args.limit ?? TransactionLimitParamSchema.default; | ||
const offset = args.offset ?? 0; | ||
|
||
const eventCond = sql` |
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.
are there indexes for sender and recipient?
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.
Yep, we're good 👍
AND tx_id = ${args.tx_id} | ||
AND (sender = ${args.address} OR recipient = ${args.address}) | ||
`; | ||
const results = await sql<(DbAddressTransactionEvent & { count: number })[]>` |
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.
would a materialized view be a good candidate here?
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.
Not in this case, because event lookups are super cheap once we know the tx_id
, index_block_hash
and sender
/recipient
of what we're looking for. But thanks for looking out!
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.
LGTM, left a couple of questions.
🎉 This PR is included in version 7.9.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [7.9.0](v7.8.2...v7.9.0) (2024-03-15) ### Features * add v2 addresses endpoints ([#1876](#1876)) ([c9440dd](c9440dd)) ### Bug Fixes * include address transactions from genesis block ([#1888](#1888)) ([cdea9e6](cdea9e6)) * include address transactions with no stx transfers ([#1887](#1887)) ([d308e46](d308e46)) * show status endpoint in /extended ([#1869](#1869)) ([cf47f8f](cf47f8f))
🎉 This PR is included in version 7.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Create 2 new address transaction endpoints:
/extended/v2/addresses/:address/transactions
returning a list of transactions for an address including transfer summaries (example)/extended/v2/addresses/:address/transactions/:tx_id/events
returning a list of transfers for a specific transaction pertaining to 1 address (example)This also deprecates the old
/transactions_with_transfers
endpoint