Add the AtomicMarket v2 royalty endpoints and the remaining v2 response fields - #12
Open
robrigo wants to merge 5 commits into
Open
Add the AtomicMarket v2 royalty endpoints and the remaining v2 response fields#12robrigo wants to merge 5 commits into
robrigo wants to merge 5 commits into
Conversation
Contributor
Author
|
CI is red at the install step on all three Node versions: |
Contributor
Author
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.
Why
The v1.3.1 bindings cover the AtomicAssets v2 and AtomicMarket v2 contracts, but the API layer stops short of what the indexer now serves. This adds the six
/atomicmarket/v1/royalties/*reads (config, template rules, attribute rules, the settled payout ledger, its count, and per-account totals) with their response structs, declarescurrent_collection_feeon auctions, buyoffers, and template buyoffers as it already is on sales, declares thetypesdescriptors the schema endpoints return, and adds the/atomicmarket/v1/stats/marketsendpoint that was missing. Every v2-only field is optional, so a v1 indexer's response still decodes.Two existing doc comments were wrong against the indexer and are corrected:
current_collection_feeis the collection's livemarket_fee, withcollection.market_feebeing the listing-time snapshot, andformat[].mediatypeandformat[].infoare merged with a heuristic, so onlytypesreports whatsetschematypstored.A collection with no royalty configuration answers HTTP 416, which propagates as
APIErrorlike every other non-2xx here; the doc comment and the README name it as the "not configured" case.Tests
make checkandmake testpass at 252 tests (234 before), and each commit passes on its own. The royalty endpoints only return data on an AtomicMarket v2 chain, so their eight fixtures were recorded against the WAX testnet indexer through a second client intest/royalties-api.ts(V2_BASE_URLintest/config.ts); fixture names hash the full URL, so they cannot collide with the existing ones, and CI still replays offline. Struct decoding of the new shapes, including the nullable payout ids and a v1 response with the fields absent, is covered without fixtures intest/v2-api.ts.The new methods interpolate
NameTypesegments into the path the way the existing endpoints do. If you would rather percent-encode path segments, that is best done across all endpoint files in one change; happy to follow up.