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 new outputs endpoint and unlockableByAddress query parameter #136

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions tips/TIP-0026/indexer-rest-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ externalDocs:
servers:
- url: 'http://127.0.0.1:14265'
tags:
- name: outputs
description: Query all Outputs.
- name: basic outputs
description: Query Basic Outputs.
- name: alias outputs
Expand All @@ -23,6 +25,98 @@ tags:
- name: nft outputs
description: Query NFT Outputs.
paths:
/api/indexer/v1/outputs:
get:
tags:
- outputs
summary: Returns outputs filtered based on parameters.
description: Returns outputs filtered based on parameters.
parameters:
- in: query
name: unlockableByAddress
schema:
type: string
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
- in: query
name: hasNativeTokens
schema:
type: boolean
example: true
description: Filters outputs based on the presence of native tokens.
- in: query
name: minNativeTokenCount
schema:
type: integer
example: 2
description: Filters outputs that have at least a certain number of distinct native tokens.
- in: query
name: maxNativeTokenCount
schema:
type: integer
example: 5
description: Filters outputs that have at most a certain number of distinct native tokens.
- in: query
name: createdBefore
schema:
type: integer
example: 1643383242
description: Return outputs that were created before a certain Unix timestamp.
- in: query
name: createdAfter
schema:
type: integer
example: 1643383242
description: Return outputs that were created after a certain Unix timestamp.
- in: query
name: pageSize
schema:
type: integer
example: 10
description: The maximum amount of items returned in one call. If there are more items, a cursor to the next page is returned too.
The parameter is ignored when pageSize is defined via the cursor parameter.
- in: query
name: cursor
schema:
type: string
example: 0c78e998f5177834ecb3bae1596d5056af76e487386eecb19727465b4be86a790200.10
description: Starts the search from the cursor (confirmationMS+outputId.pageSize).
responses:
'200':
description: "Successful operation."
content:
application/json:
schema:
$ref: '#/components/schemas/OutputsResponse'
examples:
Query results in 3 outputs:
$ref: >-
#/components/examples/get-outputs-response-three-example
No matching outputIds found:
$ref: >-
#/components/examples/get-outputs-empty-response-example
Paging - more items found than it can fit on single page:
$ref: >-
#/components/examples/get-outputs-pagesize2-response-example
'400':
description: "Unsuccessful operation: indicates that the provided data is invalid."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestResponse'
'403':
description: "Unsuccessful operation: indicates that the endpoint is not available for public use."
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenResponse'
'500':
description: "Unsuccessful operation: indicates that an unexpected, internal server error happened which prevented the node from fulfilling the request."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalErrorResponse'

/api/indexer/v1/outputs/basic:
get:
tags:
Expand All @@ -36,6 +130,12 @@ paths:
type: string
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
description: The Bech32-encoded address that should be searched for in the Address Unlock Condition of outputs.
- in: query
name: unlockableByAddress
schema:
type: string
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
- in: query
name: hasNativeTokens
schema:
Expand Down Expand Up @@ -202,6 +302,12 @@ paths:
type: string
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
description: Filter outputs based on bech32-encoded governor (governance controller) address.
- in: query
name: unlockableByAddress
schema:
type: string
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
- in: query
name: issuer
schema:
Expand Down Expand Up @@ -498,6 +604,12 @@ paths:
type: string
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
description: The Bech32-encoded address that should be searched for in the Address Unlock Condition of outputs.
- in: query
name: unlockableByAddress
schema:
type: string
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
- in: query
name: issuer
schema:
Expand Down
Loading