wallet/docs/swagger.yaml
Anton Nesterov 5efcf35dd6
[init]
2024-08-31 16:59:34 +02:00

1280 lines
30 KiB
YAML

definitions:
eth.EthAccountBalance:
properties:
address:
type: string
eth:
type: string
ethRaw:
type: integer
txFee:
type: string
usdt:
type: string
usdtRaw:
type: integer
type: object
rest.AccountBalanceRequest:
properties:
account_id:
type: string
type: object
rest.AccountBalanceResponse:
properties:
account_id:
type: string
eth_allowance:
type: string
eth_hd_index:
type: integer
eth_spender:
type: string
ethereum:
$ref: '#/definitions/eth.EthAccountBalance'
label:
type: string
tron:
$ref: '#/definitions/tron.TronAccountBalance'
tron_allowance:
type: string
tron_hd_index:
type: integer
tron_spender:
type: string
type: object
rest.AccountCountResponse:
properties:
count:
type: integer
type: object
rest.AccountHDBalanceRequest:
properties:
index:
type: integer
type: object
rest.AccountHDBalanceResponse:
properties:
eth_allowance:
type: string
ethereum:
$ref: '#/definitions/eth.EthAccountBalance'
tron:
$ref: '#/definitions/tron.TronAccountBalance'
tron_allowance:
type: string
type: object
rest.AccountListRequest:
properties:
limit:
type: integer
offset:
type: integer
type: object
rest.CreateAccountRequest:
properties:
account_id:
type: string
index:
type: integer
label:
type: string
type: object
rest.CreateAccountResponse:
properties:
account_id:
type: string
eth_address:
type: string
index:
type: integer
label:
type: string
tron_address:
type: string
type: object
rest.CreateEthAccountRequest:
properties:
account_id:
type: string
type: object
rest.CreateEthAccountResponse:
properties:
address:
type: string
type: object
rest.CreateTronAccountRequest:
properties:
account_id:
type: string
type: object
rest.CreateTronAccountResponse:
properties:
address:
type: string
type: object
rest.ETHApproveContractRequest:
properties:
account_id:
type: string
contract_address:
type: string
type: object
rest.ETHApproveCustodyRequest:
properties:
address:
type: string
type: object
rest.ETHApproveCustodyResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.ETHApproveResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.ETHApproveUSDTRequest:
properties:
account_id:
type: string
type: object
rest.ErrorResponse:
properties:
error:
type: string
type: object
rest.EthAccountBalanceRequest:
properties:
account_id:
type: string
type: object
rest.EthAddressBalanceRequest:
properties:
address:
type: string
type: object
rest.EthTransactionInfoRequest:
properties:
tx_id:
type: string
type: object
rest.EthTransactionInfoResponse:
properties:
id:
type: string
status:
type: string
type: object
rest.ExportBatchV1Request:
properties:
limit:
type: integer
offset:
type: integer
type: object
rest.ExportV1Request:
properties:
index:
type: integer
type: object
rest.ExportV1Response:
properties:
eth_address:
type: string
eth_private_key:
type: string
tron_address:
type: string
tron_private_key:
type: string
type: object
rest.RechargeETHRequest:
properties:
account_id:
type: string
amount:
type: string
type: object
rest.RechargeETHResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.RechargeTronRequest:
properties:
account_id:
type: string
amount:
type: string
type: object
rest.RechargeTronResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.SpenderBalanceResponse:
properties:
accounts_count:
type: integer
ethereum:
$ref: '#/definitions/eth.EthAccountBalance'
tron:
$ref: '#/definitions/tron.TronAccountBalance'
type: object
rest.TRXApproveCustodyResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.TRXApproveUSDTResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.TRXAprroveContractRequest:
properties:
account_id:
type: string
contract_address:
type: string
type: object
rest.TRXAprroveCustodyRequest:
properties:
address:
type: string
type: object
rest.TRXAprroveUSDTRequest:
properties:
account_id:
type: string
type: object
rest.TronAccountBalanceRequest:
properties:
account_id:
type: string
type: object
rest.TronAddressBalanceRequest:
properties:
address:
type: string
type: object
rest.TronTransactionInfoRequest:
properties:
tx_id:
type: string
type: object
rest.TronTransactionInfoResponse:
properties:
id:
type: string
status:
type: string
type: object
rest.WidtdrawUSDTByContract:
properties:
account_id:
type: string
amount:
type: string
comission_amount:
type: string
contract_address:
type: string
to:
type: string
type: object
rest.WithdrawEthRequest:
properties:
account_id:
type: string
amount:
type: string
to:
type: string
type: object
rest.WithdrawEthResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.WithdrawSpenderResponse:
properties:
status:
type: string
txid_commission:
type: string
txid_withdrawal:
type: string
type: object
rest.WithdrawTronRequest:
properties:
account_id:
type: string
amount:
type: string
to:
type: string
type: object
rest.WithdrawTronResponse:
properties:
status:
type: string
txid:
type: string
type: object
rest.WithdrawUSDTBySpenderRequest:
properties:
account_id:
type: string
amount:
type: string
comission_amount:
type: string
to:
type: string
type: object
tron.TronAccountBalance:
properties:
address:
type: string
trx:
type: string
trxRaw:
type: integer
txFee:
type: string
usdt:
type: string
usdtRaw:
type: integer
type: object
info:
contact: {}
paths:
/account/balance:
post:
consumes:
- application/json
description: Get account balance for all currencies
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.AccountBalanceRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.AccountBalanceResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
tags:
- Account
/account/count:
get:
consumes:
- application/json
description: Count accounts
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.AccountCountResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
tags:
- Account
/account/create:
post:
consumes:
- application/json
description: Create a new user account identified by account_id and index (incremental
number)
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.CreateAccountRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.CreateAccountResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Create a new user account
tags:
- Account
/account/hd/balance:
post:
consumes:
- application/json
description: Get account balance for all currencies
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.AccountHDBalanceRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.AccountHDBalanceResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
tags:
- Account
/account/list:
post:
consumes:
- application/json
description: List accounts paginating by (limit, offset)
parameters:
- description: Paging Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.AccountListRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/rest.CreateAccountResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: List all accounts
tags:
- Account
/account/spender-status:
get:
consumes:
- application/json
description: Check spender accounts
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.SpenderBalanceResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
tags:
- Account
/eth/account-balance:
post:
consumes:
- application/json
description: Get account balance
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.EthAccountBalanceRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/eth.EthAccountBalance'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Get account balance
tags:
- Ethereum
/eth/address-balance:
post:
consumes:
- application/json
description: Get address balance
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.EthAddressBalanceRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/eth.EthAccountBalance'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Get eth address balance
tags:
- Ethereum
/eth/approve-usdt-contract:
post:
consumes:
- application/json
description: Approve USDT spender contract address for account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.ETHApproveContractRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.ETHApproveResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Approve USDT spender contract
tags:
- Ethereum
/eth/approve-usdt-custody:
post:
consumes:
- application/json
description: Approve USDT spender address for account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.ETHApproveCustodyRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.ETHApproveCustodyResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Approve USDT Castody for Spender Account
tags:
- Ethereum
/eth/approve-usdt-spender:
post:
consumes:
- application/json
description: Approve USDT spender address for account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.ETHApproveUSDTRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.ETHApproveResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Approve USDT spender
tags:
- Ethereum
/eth/create-account:
post:
consumes:
- application/json
description: Create a new etherum account identified by account_id
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.CreateEthAccountRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.CreateEthAccountResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Create a new account
tags:
- Ethereum
/eth/recharge-eth-by-spender:
post:
consumes:
- application/json
description: Add ETH funds to the account from the spender
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.RechargeETHRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.RechargeETHResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Add ETH from spender account
tags:
- Ethereum
/eth/tx-info:
post:
consumes:
- application/json
description: Get transaction info
parameters:
- description: Tx Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.EthTransactionInfoRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.EthTransactionInfoResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Get transaction info
tags:
- Ethereum
/eth/withdraw-eth:
post:
consumes:
- application/json
description: Withdraw ETH funds from ethereum account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WithdrawEthRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawEthResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw ETH
tags:
- Ethereum
/eth/withdraw-usdt:
post:
consumes:
- application/json
description: Withdraw usdt funds from etherum account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WithdrawEthRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawEthResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw USDT
tags:
- Ethereum
/eth/withdraw-usdt-by-contract:
post:
consumes:
- application/json
description: Withdraw usdt funds from etherum account using approved spender
contract
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WidtdrawUSDTByContract'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawEthResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw USDT by commission contract
tags:
- Ethereum
/eth/withdraw-usdt-by-spender:
post:
consumes:
- application/json
description: Withdraw usdt funds from etherum account using approved spender
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WithdrawUSDTBySpenderRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawSpenderResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw USDT by Spender
tags:
- Ethereum
/export:
post:
consumes:
- application/json
description: Export private keys for the given index (uint32)
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.ExportV1Request'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.ExportV1Response'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Export private keys for the given index
tags:
- Utils
/export-batch:
post:
consumes:
- application/json
description: Export private keys for the given range (uint32)
parameters:
- description: Paging Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.ExportBatchV1Request'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/rest.ExportV1Response'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Export private keys for the given range
tags:
- Utils
/export-spender-keys:
get:
consumes:
- application/json
description: Export spender private keys
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.ExportV1Response'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
tags:
- Utils
/tron/account-balance:
post:
consumes:
- application/json
description: Get address balance
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.TronAccountBalanceRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/tron.TronAccountBalance'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Get address balance
tags:
- Tron
/tron/address-balance:
post:
consumes:
- application/json
description: Get address balance
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.TronAddressBalanceRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/tron.TronAccountBalance'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Get address balance
tags:
- Tron
/tron/approve-usdt-contract:
post:
consumes:
- application/json
description: Approve USDT spender for contract
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.TRXAprroveContractRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.TRXApproveUSDTResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Approve USDT Spender Contract
tags:
- Tron
/tron/approve-usdt-custody:
post:
consumes:
- application/json
description: Approve USDT spender for account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.TRXAprroveCustodyRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.TRXApproveCustodyResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Approve USDT Spender
tags:
- Tron
/tron/approve-usdt-spender:
post:
consumes:
- application/json
description: Approve USDT spender for account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.TRXAprroveUSDTRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.TRXApproveUSDTResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Approve USDT Spender
tags:
- Tron
/tron/create-account:
post:
consumes:
- application/json
description: Create a new tron account identified by account_id
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.CreateTronAccountRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.CreateTronAccountResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Create a new account
tags:
- Tron
/tron/recharge-trx-by-spender:
post:
consumes:
- application/json
description: Add TRX funds from the spender account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.RechargeTronRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.RechargeTronResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Add TRX from spender account
tags:
- Tron
/tron/tx-info:
post:
consumes:
- application/json
description: Get transaction info
parameters:
- description: Tx Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.TronTransactionInfoRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.TronTransactionInfoResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Get transaction info
tags:
- Tron
/tron/withdraw-trx:
post:
consumes:
- application/json
description: Withdraw TRON funds from tron account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WithdrawTronRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawTronResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw TRX
tags:
- Tron
/tron/withdraw-usdt:
post:
consumes:
- application/json
description: Withdraw usdt funds from tron account
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WithdrawTronRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawTronResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw USDT
tags:
- Tron
/tron/withdraw-usdt-by-contract:
post:
consumes:
- application/json
description: Withdraw usdt funds from tron account using approved comission
contract
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WidtdrawUSDTByContract'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawTronResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw USDT by commision contract
tags:
- Tron
/tron/withdraw-usdt-by-spender:
post:
consumes:
- application/json
description: Withdraw usdt funds from tron account using approved spender
parameters:
- description: Account Info
in: body
name: message
required: true
schema:
$ref: '#/definitions/rest.WithdrawUSDTBySpenderRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rest.WithdrawSpenderResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/rest.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Withdraw USDT by spender
tags:
- Tron
securityDefinitions:
ApiKeyAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"