Skip to content

Commit 709a730

Browse files
authored
Add GetVtxosByOutpoint rpc to Indexer & Fix restoration of tx history in SDK (#555)
* Add GetVtxosByOutpoint rpc to indexer * Add indexer & fix tx history restoration * Fix indexer GetTxHistory api
1 parent cba4892 commit 709a730

File tree

18 files changed

+1788
-490
lines changed

18 files changed

+1788
-490
lines changed

api-spec/openapi/swagger/ark/v1/indexer.swagger.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,55 @@
371371
]
372372
}
373373
},
374+
"/v1/getVtxosByOutpoint/{outpoints}": {
375+
"get": {
376+
"operationId": "IndexerService_GetVtxosByOutpoint",
377+
"responses": {
378+
"200": {
379+
"description": "A successful response.",
380+
"schema": {
381+
"$ref": "#/definitions/v1GetVtxosByOutpointResponse"
382+
}
383+
},
384+
"default": {
385+
"description": "An unexpected error response.",
386+
"schema": {
387+
"$ref": "#/definitions/rpcStatus"
388+
}
389+
}
390+
},
391+
"parameters": [
392+
{
393+
"name": "outpoints",
394+
"in": "path",
395+
"required": true,
396+
"type": "array",
397+
"items": {
398+
"type": "string"
399+
},
400+
"collectionFormat": "csv",
401+
"minItems": 1
402+
},
403+
{
404+
"name": "page.size",
405+
"in": "query",
406+
"required": false,
407+
"type": "integer",
408+
"format": "int32"
409+
},
410+
{
411+
"name": "page.index",
412+
"in": "query",
413+
"required": false,
414+
"type": "integer",
415+
"format": "int32"
416+
}
417+
],
418+
"tags": [
419+
"IndexerService"
420+
]
421+
}
422+
},
374423
"/v1/history/{address}": {
375424
"get": {
376425
"operationId": "IndexerService_GetTransactionHistory",
@@ -730,6 +779,21 @@
730779
}
731780
}
732781
},
782+
"v1GetVtxosByOutpointResponse": {
783+
"type": "object",
784+
"properties": {
785+
"vtxos": {
786+
"type": "array",
787+
"items": {
788+
"type": "object",
789+
"$ref": "#/definitions/v1IndexerVtxo"
790+
}
791+
},
792+
"page": {
793+
"$ref": "#/definitions/v1IndexerPageResponse"
794+
}
795+
}
796+
},
733797
"v1GetVtxosResponse": {
734798
"type": "object",
735799
"properties": {

api-spec/protobuf/ark/v1/indexer.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ service IndexerService {
4040
get: "/v1/getVtxos/{addresses}"
4141
};
4242
};
43+
rpc GetVtxosByOutpoint(GetVtxosByOutpointRequest) returns (GetVtxosByOutpointResponse) {
44+
option (google.api.http) = {
45+
get: "/v1/getVtxosByOutpoint/{outpoints}"
46+
};
47+
}
4348
rpc GetTransactionHistory(GetTransactionHistoryRequest) returns (GetTransactionHistoryResponse) {
4449
option (google.api.http) = {
4550
get: "/v1/history/{address}"
@@ -131,6 +136,15 @@ message GetVtxosResponse {
131136
IndexerPageResponse page = 2;
132137
}
133138

139+
message GetVtxosByOutpointRequest {
140+
repeated string outpoints = 1;
141+
IndexerPageRequest page = 2;
142+
}
143+
message GetVtxosByOutpointResponse {
144+
repeated IndexerVtxo vtxos = 1;
145+
IndexerPageResponse page = 2;
146+
}
147+
134148
message GetTransactionHistoryRequest {
135149
string address = 1;
136150
int64 start_time = 2;

0 commit comments

Comments
 (0)