Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 71ea8bd

Browse files
authored
Add new outputs endpoint and unlockableByAddress query parameter (#136)
1 parent e30ee79 commit 71ea8bd

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

tips/TIP-0026/indexer-rest-api.yaml

+112
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ externalDocs:
1414
servers:
1515
- url: 'http://127.0.0.1:14265'
1616
tags:
17+
- name: outputs
18+
description: Query all Outputs.
1719
- name: basic outputs
1820
description: Query Basic Outputs.
1921
- name: alias outputs
@@ -23,6 +25,98 @@ tags:
2325
- name: nft outputs
2426
description: Query NFT Outputs.
2527
paths:
28+
/api/indexer/v1/outputs:
29+
get:
30+
tags:
31+
- outputs
32+
summary: Returns outputs filtered based on parameters.
33+
description: Returns outputs filtered based on parameters.
34+
parameters:
35+
- in: query
36+
name: unlockableByAddress
37+
schema:
38+
type: string
39+
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
40+
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
41+
- in: query
42+
name: hasNativeTokens
43+
schema:
44+
type: boolean
45+
example: true
46+
description: Filters outputs based on the presence of native tokens.
47+
- in: query
48+
name: minNativeTokenCount
49+
schema:
50+
type: integer
51+
example: 2
52+
description: Filters outputs that have at least a certain number of distinct native tokens.
53+
- in: query
54+
name: maxNativeTokenCount
55+
schema:
56+
type: integer
57+
example: 5
58+
description: Filters outputs that have at most a certain number of distinct native tokens.
59+
- in: query
60+
name: createdBefore
61+
schema:
62+
type: integer
63+
example: 1643383242
64+
description: Return outputs that were created before a certain Unix timestamp.
65+
- in: query
66+
name: createdAfter
67+
schema:
68+
type: integer
69+
example: 1643383242
70+
description: Return outputs that were created after a certain Unix timestamp.
71+
- in: query
72+
name: pageSize
73+
schema:
74+
type: integer
75+
example: 10
76+
description: The maximum amount of items returned in one call. If there are more items, a cursor to the next page is returned too.
77+
The parameter is ignored when pageSize is defined via the cursor parameter.
78+
- in: query
79+
name: cursor
80+
schema:
81+
type: string
82+
example: 0c78e998f5177834ecb3bae1596d5056af76e487386eecb19727465b4be86a790200.10
83+
description: Starts the search from the cursor (confirmationMS+outputId.pageSize).
84+
responses:
85+
'200':
86+
description: "Successful operation."
87+
content:
88+
application/json:
89+
schema:
90+
$ref: '#/components/schemas/OutputsResponse'
91+
examples:
92+
Query results in 3 outputs:
93+
$ref: >-
94+
#/components/examples/get-outputs-response-three-example
95+
No matching outputIds found:
96+
$ref: >-
97+
#/components/examples/get-outputs-empty-response-example
98+
Paging - more items found than it can fit on single page:
99+
$ref: >-
100+
#/components/examples/get-outputs-pagesize2-response-example
101+
'400':
102+
description: "Unsuccessful operation: indicates that the provided data is invalid."
103+
content:
104+
application/json:
105+
schema:
106+
$ref: '#/components/schemas/BadRequestResponse'
107+
'403':
108+
description: "Unsuccessful operation: indicates that the endpoint is not available for public use."
109+
content:
110+
application/json:
111+
schema:
112+
$ref: '#/components/schemas/ForbiddenResponse'
113+
'500':
114+
description: "Unsuccessful operation: indicates that an unexpected, internal server error happened which prevented the node from fulfilling the request."
115+
content:
116+
application/json:
117+
schema:
118+
$ref: '#/components/schemas/InternalErrorResponse'
119+
26120
/api/indexer/v1/outputs/basic:
27121
get:
28122
tags:
@@ -36,6 +130,12 @@ paths:
36130
type: string
37131
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
38132
description: The Bech32-encoded address that should be searched for in the Address Unlock Condition of outputs.
133+
- in: query
134+
name: unlockableByAddress
135+
schema:
136+
type: string
137+
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
138+
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
39139
- in: query
40140
name: hasNativeTokens
41141
schema:
@@ -202,6 +302,12 @@ paths:
202302
type: string
203303
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
204304
description: Filter outputs based on bech32-encoded governor (governance controller) address.
305+
- in: query
306+
name: unlockableByAddress
307+
schema:
308+
type: string
309+
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
310+
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
205311
- in: query
206312
name: issuer
207313
schema:
@@ -498,6 +604,12 @@ paths:
498604
type: string
499605
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
500606
description: The Bech32-encoded address that should be searched for in the Address Unlock Condition of outputs.
607+
- in: query
608+
name: unlockableByAddress
609+
schema:
610+
type: string
611+
example: iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx
612+
description: The Bech32-encoded address that should be searched for in all possible Unlock Conditions of outputs.
501613
- in: query
502614
name: issuer
503615
schema:

0 commit comments

Comments
 (0)