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

TIP-26 UTXO Indexer REST API #62

Merged
merged 30 commits into from
Jul 13, 2022
Merged

TIP-26 UTXO Indexer REST API #62

merged 30 commits into from
Jul 13, 2022

Conversation

lzpap
Copy link
Member

@lzpap lzpap commented Jan 31, 2022

UTXO Indexer REST API specification for the Stardust update.

Complements #57 by exposing UTXO specific routes from an opt-in node indexer plugin or standalone application:

  • api/indexer/v1/outputs/basic: for fetching Basic Outputs
  • api/indexer/v1/outputs/alias: for fetching Alias Outputs
  • api/indexer/v1/outputs/foundry: for fetching Foundry Outputs
  • api/indexer/v1/outputs/nft: for fetching NFT Outputs

All routes support additional query parameters to filter outputs based on content. The output objects can be fetched from the core API based on the returned outputIds.

Rendered document

tips/TIP-0026/tip-0026.md Outdated Show resolved Hide resolved
@samuel-rufi samuel-rufi self-requested a review January 31, 2022 15:42
@Thoralf-M
Copy link
Member

For /api/plugins/indexer/v1/nfts/{nftId} the example shows

{
  "data": {
    "ledgerIndex": 101,
    "limit": 1000,
    "count": 1,
    "outputIds": [
      "0c78e998f5177834ecb3bae1596d5056af76e487386eecb19727465b4be86a790000"
    ]
  }
}

but hornet currently returns

{"ledgerIndex":83,"count":1,"data":["1784a3ca7578c0154dff9b6eab231adb136520c56df365b914a715a9c2d4653c0000"]}

without the limit
What needs to be changed?

lzpap added 5 commits February 2, 2022 12:29
 - Remove data envelope
 - Change paging mechanism, use cursor instead of offset
 - Rename response fields
Copy link
Member

@Thoralf-M Thoralf-M left a comment

Choose a reason for hiding this comment

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

Extended outputs need to be renamed to basic outputs

@lzpap
Copy link
Member Author

lzpap commented Feb 7, 2022

Extended outputs need to be renamed to basic outputs

Done!

name: cursor
schema:
type: string
example: 0c78e998f5177834ecb3bae1596d5056af76e487386eecb19727465b4be86a790200.10
Copy link
Contributor

@grtlr grtlr Feb 11, 2022

Choose a reason for hiding this comment

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

Is the length of the example correct here? confirmationMs should be 8 digits and outputId should be 68 digits. So everything up until the . should be 76 digits, but it's only 68 digits long.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, the examples need to be updated with realisitc values from an actual network.

Choose a reason for hiding this comment

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

Aaah, Germans :trollface:

@jorgemmsilva
Copy link

api/indexer/v1/outputs: for fetching Basic Outputs

imo this should be renamed to api/indexer/v1/basicoutputs. so It is explicit that it will only query basic outputs.


related to that, could we have api/indexer/v1/outputs to query for ANY output, regardless of type?
search criteria being "any UTXO that can be unlocked by a given address"

@lzpap lzpap merged commit f87a6f6 into main Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants