Add admin APIs to manage wallet (#226)

* Add admin rpcs to manage wallet

* Fix

* Fixes

* Add sleeping time

* Increase sleeping time
This commit is contained in:
Pietralberto Mazza
2024-08-07 00:36:51 +02:00
committed by GitHub
parent fb8a127f4f
commit 1c67c56d9d
28 changed files with 3680 additions and 1721 deletions

View File

@@ -16,50 +16,6 @@
"application/json"
],
"paths": {
"/v1/admin/address": {
"get": {
"operationId": "AdminService_GetWalletAddress",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetWalletAddressResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"AdminService"
]
}
},
"/v1/admin/balance": {
"get": {
"operationId": "AdminService_GetBalance",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetBalanceResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"AdminService"
]
}
},
"/v1/admin/round/{roundId}": {
"get": {
"operationId": "AdminService_GetRoundDetails",
@@ -122,28 +78,6 @@
]
}
},
"/v1/admin/status": {
"get": {
"operationId": "AdminService_GetWalletStatus",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetWalletStatusResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"AdminService"
]
}
},
"/v1/admin/sweeps": {
"get": {
"operationId": "AdminService_GetScheduledSweep",
@@ -196,28 +130,6 @@
}
}
},
"v1Balance": {
"type": "object",
"properties": {
"locked": {
"type": "string"
},
"available": {
"type": "string"
}
}
},
"v1GetBalanceResponse": {
"type": "object",
"properties": {
"mainAccount": {
"$ref": "#/definitions/v1Balance"
},
"connectorsAccount": {
"$ref": "#/definitions/v1Balance"
}
}
},
"v1GetRoundDetailsResponse": {
"type": "object",
"properties": {
@@ -295,28 +207,6 @@
}
}
},
"v1GetWalletAddressResponse": {
"type": "object",
"properties": {
"address": {
"type": "string"
}
}
},
"v1GetWalletStatusResponse": {
"type": "object",
"properties": {
"initialized": {
"type": "boolean"
},
"unlocked": {
"type": "boolean"
},
"synced": {
"type": "boolean"
}
}
},
"v1ScheduledSweep": {
"type": "object",
"properties": {

View File

@@ -0,0 +1,368 @@
{
"swagger": "2.0",
"info": {
"title": "ark/v1/wallet.proto",
"version": "version not set"
},
"tags": [
{
"name": "WalletService"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/v1/admin/wallet/address": {
"get": {
"operationId": "WalletService_DeriveAddress",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1DeriveAddressResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"WalletService"
]
}
},
"/v1/admin/wallet/balance": {
"get": {
"operationId": "WalletService_GetBalance",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetBalanceResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"WalletService"
]
}
},
"/v1/admin/wallet/create": {
"post": {
"operationId": "WalletService_Create",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1CreateResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1CreateRequest"
}
}
],
"tags": [
"WalletService"
]
}
},
"/v1/admin/wallet/lock": {
"post": {
"operationId": "WalletService_Lock",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1LockResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1LockRequest"
}
}
],
"tags": [
"WalletService"
]
}
},
"/v1/admin/wallet/restore": {
"post": {
"operationId": "WalletService_Restore",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1RestoreResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1RestoreRequest"
}
}
],
"tags": [
"WalletService"
]
}
},
"/v1/admin/wallet/seed": {
"get": {
"operationId": "WalletService_GenSeed",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GenSeedResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"WalletService"
]
}
},
"/v1/admin/wallet/status": {
"get": {
"operationId": "WalletService_GetStatus",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetStatusResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"WalletService"
]
}
},
"/v1/admin/wallet/unlock": {
"post": {
"operationId": "WalletService_Unlock",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UnlockResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1UnlockRequest"
}
}
],
"tags": [
"WalletService"
]
}
}
},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
}
}
}
},
"v1Balance": {
"type": "object",
"properties": {
"locked": {
"type": "string"
},
"available": {
"type": "string"
}
}
},
"v1CreateRequest": {
"type": "object",
"properties": {
"seed": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"v1CreateResponse": {
"type": "object"
},
"v1DeriveAddressResponse": {
"type": "object",
"properties": {
"address": {
"type": "string"
}
}
},
"v1GenSeedResponse": {
"type": "object",
"properties": {
"seed": {
"type": "string"
}
}
},
"v1GetBalanceResponse": {
"type": "object",
"properties": {
"mainAccount": {
"$ref": "#/definitions/v1Balance"
},
"connectorsAccount": {
"$ref": "#/definitions/v1Balance"
}
}
},
"v1GetStatusResponse": {
"type": "object",
"properties": {
"initialized": {
"type": "boolean"
},
"unlocked": {
"type": "boolean"
},
"synced": {
"type": "boolean"
}
}
},
"v1LockRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
}
}
},
"v1LockResponse": {
"type": "object"
},
"v1RestoreRequest": {
"type": "object",
"properties": {
"seed": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"v1RestoreResponse": {
"type": "object"
},
"v1UnlockRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
}
}
},
"v1UnlockResponse": {
"type": "object"
}
}
}