Skip to content

Commit 2e4ebcf

Browse files
authored
Add SubscribeForAddress explorer API (#507)
* Add SubscribeForAddress explorer API * Add SubscribeForAddress to SDK transport client * Fixes * Force close all open connections at shutdown * Add method to notify for incoming funds to the SDK * Fixes
1 parent ee00e30 commit 2e4ebcf

25 files changed

+2044
-1152
lines changed

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,45 @@
105105
"ExplorerService"
106106
]
107107
}
108+
},
109+
"/v1/vtxos/{address}/subscribe": {
110+
"get": {
111+
"operationId": "ExplorerService_SubscribeForAddress",
112+
"responses": {
113+
"200": {
114+
"description": "A successful response.(streaming responses)",
115+
"schema": {
116+
"type": "object",
117+
"properties": {
118+
"result": {
119+
"$ref": "#/definitions/v1SubscribeForAddressResponse"
120+
},
121+
"error": {
122+
"$ref": "#/definitions/rpcStatus"
123+
}
124+
},
125+
"title": "Stream result of v1SubscribeForAddressResponse"
126+
}
127+
},
128+
"default": {
129+
"description": "An unexpected error response.",
130+
"schema": {
131+
"$ref": "#/definitions/rpcStatus"
132+
}
133+
}
134+
},
135+
"parameters": [
136+
{
137+
"name": "address",
138+
"in": "path",
139+
"required": true,
140+
"type": "string"
141+
}
142+
],
143+
"tags": [
144+
"ExplorerService"
145+
]
146+
}
108147
}
109148
},
110149
"definitions": {
@@ -242,6 +281,25 @@
242281
],
243282
"default": "ROUND_STAGE_UNSPECIFIED"
244283
},
284+
"v1SubscribeForAddressResponse": {
285+
"type": "object",
286+
"properties": {
287+
"newVtxos": {
288+
"type": "array",
289+
"items": {
290+
"type": "object",
291+
"$ref": "#/definitions/v1Vtxo"
292+
}
293+
},
294+
"spentVtxos": {
295+
"type": "array",
296+
"items": {
297+
"type": "object",
298+
"$ref": "#/definitions/v1Vtxo"
299+
}
300+
}
301+
}
302+
},
245303
"v1Tree": {
246304
"type": "object",
247305
"properties": {

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ service ExplorerService {
2121
get: "/v1/vtxos/{address}"
2222
};
2323
};
24+
rpc SubscribeForAddress(SubscribeForAddressRequest) returns (stream SubscribeForAddressResponse) {
25+
option (google.api.http) = {
26+
get: "/v1/vtxos/{address}/subscribe"
27+
};
28+
};
2429
}
2530

2631
message GetRoundRequest {
@@ -44,3 +49,11 @@ message ListVtxosResponse {
4449
repeated Vtxo spendable_vtxos = 1;
4550
repeated Vtxo spent_vtxos = 2;
4651
}
52+
53+
message SubscribeForAddressRequest {
54+
string address = 1;
55+
}
56+
message SubscribeForAddressResponse {
57+
repeated Vtxo new_vtxos = 2;
58+
repeated Vtxo spent_vtxos = 3;
59+
}

0 commit comments

Comments
 (0)