Skip to content

Commit 8a111b1

Browse files
committed
add admin Withdraw command and RPC
1 parent c4fd7ea commit 8a111b1

File tree

14 files changed

+492
-35
lines changed

14 files changed

+492
-35
lines changed

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,38 @@
183183
"AdminService"
184184
]
185185
}
186+
},
187+
"/v1/admin/withdraw": {
188+
"post": {
189+
"operationId": "AdminService_Withdraw",
190+
"responses": {
191+
"200": {
192+
"description": "A successful response.",
193+
"schema": {
194+
"$ref": "#/definitions/v1WithdrawResponse"
195+
}
196+
},
197+
"default": {
198+
"description": "An unexpected error response.",
199+
"schema": {
200+
"$ref": "#/definitions/rpcStatus"
201+
}
202+
}
203+
},
204+
"parameters": [
205+
{
206+
"name": "body",
207+
"in": "body",
208+
"required": true,
209+
"schema": {
210+
"$ref": "#/definitions/v1WithdrawRequest"
211+
}
212+
}
213+
],
214+
"tags": [
215+
"AdminService"
216+
]
217+
}
186218
}
187219
},
188220
"definitions": {
@@ -386,6 +418,26 @@
386418
},
387419
"v1UpdateMarketHourConfigResponse": {
388420
"type": "object"
421+
},
422+
"v1WithdrawRequest": {
423+
"type": "object",
424+
"properties": {
425+
"address": {
426+
"type": "string"
427+
},
428+
"amount": {
429+
"type": "string",
430+
"format": "uint64"
431+
}
432+
}
433+
},
434+
"v1WithdrawResponse": {
435+
"type": "object",
436+
"properties": {
437+
"txHex": {
438+
"type": "string"
439+
}
440+
}
389441
}
390442
}
391443
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ service AdminService {
4040
body: "*"
4141
};
4242
}
43+
rpc Withdraw(WithdrawRequest) returns (WithdrawResponse) {
44+
option (google.api.http) = {
45+
post: "/v1/admin/withdraw"
46+
body: "*"
47+
};
48+
}
4349
}
4450

4551
message GetScheduledSweepRequest {}
@@ -110,4 +116,13 @@ message MarketHourConfig {
110116
google.protobuf.Timestamp end_time = 2;
111117
google.protobuf.Duration period = 3;
112118
google.protobuf.Duration round_interval = 4;
119+
}
120+
121+
message WithdrawRequest {
122+
string address = 1;
123+
uint64 amount = 2;
124+
}
125+
126+
message WithdrawResponse {
127+
string tx_hex = 1;
113128
}

api-spec/protobuf/gen/ark/v1/admin.pb.go

Lines changed: 171 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)