feat(minibf): add /accounts/{stake_address}/addresses/assets endpoint#1126
Draft
slowbackspace wants to merge 1 commit into
Draft
feat(minibf): add /accounts/{stake_address}/addresses/assets endpoint#1126slowbackspace wants to merge 1 commit into
slowbackspace wants to merge 1 commit into
Conversation
Aggregates native assets over the account's unspent UTxOs from the utxos_by_stake index, ordered by the chain position of the oldest (asc) or newest (desc) UTxO holding each asset with unit tie-breaks, matching the Blockfrost reference implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1067 by adding the Blockfrost-compatible
GET /accounts/{stake_address}/addresses/assetsendpoint.count,page, andorder404for unknown accounts and existing MiniBF errors for invalid requests and storage failuresOrdering semantics
Because the directions use different keys,
descis not necessarily the reverse ofasc.asc: each asset’s oldest current UTxOdesc: each asset’s newest current UTxOThis reproduces the reference implementation (
blockfrost-backend-ryo,accounts_stake_address_addresses_assets.sql:MIN(txo.id) ASC/MAX(txo.id) DESC, tie-break(policy, name) ASC), with the tuple(slot, tx_index, output_index)standing in for db-sync's monotonetxo.id. The route testaccounts_by_stake_addresses_assets_uses_directional_orderingpins the exactascanddescsequences, including the non-reversal and the tie-break cases.Testing
TestApp::new_with_cfg_and_setup), pagination including past-the-end pages, invalid stake addresses, unknown accounts, storage failuresascanddesc, as are pagination windows and the400/404error responses.Known deviations
400(no JSON error body) — pre-existing behavior shared by all account endpoints, deliberately left untouched here