btcpayserver/BTCPayServer/wwwroot/swagger/v1/swagger.template.custodians.json
Wouter Samaey 6f2b673021
Custodian withdrawal support + Some refactoring and cleanup (#4085)
* Renamed "WithdrawAsync" to "WithdrawToStoreWalletAsync"

* WIP

* WIP withdrawal + Refactored Form saving to JObject

* WIP

* Form to fix bad values during withdrawing appears correctly

* WIP

* Lots of cleanup and refactoring + Password field and toggle password view

* Cleanup + Finishing touches on withdrawals

* Added "Destination" dummy text as this is always the destination.

* Fixed broken test

* Added support for withdrawing using qty as a percentage if it ends with "%". Needs more testing.

* Fixed broken build

* Fixed broken build (2)

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.custodians.json

Co-authored-by: d11n <mail@dennisreimann.de>

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.custodians.json

Co-authored-by: d11n <mail@dennisreimann.de>

* Improved unit tests

* Fixed swagger bug

* Test improvements

Make string conversion of quantity explicitely.

* Fix build warnings

* Swagger: Add missing operationId

* Made change Dennis requested

* Removed unused file

* Removed incorrect comment

* Extra contructor

* Renamed client methods

* Cleanup config before saving

* Fixed broken controller

* Refactor custodian

* Fix build

* Make decimal fields strings to match the rest of Greenfield

* Improve parsing of % quantities

---------

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-20 10:45:32 +09:00

1315 lines
53 KiB
JSON

{
"paths": {
"/api/v1/custodians": {
"get": {
"tags": [
"Custodians"
],
"summary": "List supported custodians",
"description": "List all supported custodians for the BTCPay instance. You can install plugins to add more custodians.",
"operationId": "Custodians_GetSupportedCustodians",
"responses": {
"200": {
"description": "List of supported custodians",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustodianData"
}
}
}
}
}
},
"security": [
{
"API_Key": [],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/custodian-accounts": {
"get": {
"operationId": "Custodians_GetStoreCustodianAccounts",
"tags": [
"Custodians"
],
"summary": "List store custodian accounts",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "assetBalances",
"in": "query",
"required": false,
"description": "Enable if you want the result to include the 'assetBalances' field. This will make the call slower or could cause the call to fail if the asset balances cannot be loaded (i.e. due to a bad API key).",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"200": {
"description": "List of custodian accounts for the store.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustodianAccountData"
}
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the store's custodian accounts"
}
}
},
"post": {
"operationId": "Custodians_AddStoreCustodianAccount",
"tags": [
"Custodians"
],
"summary": "Add a custodial account to a store.",
"description": "Add a custodial account to a store.",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": { "type": "string" }
}
],
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCustodianAccountRequest"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "Information about the new custodian account",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CustodianAccountData"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to add new custodian account"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canmanagecustodianaccounts"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/custodian-accounts/{accountId}": {
"get": {
"operationId": "Custodians_GetStoreCustodianAccount",
"tags": [
"Custodians"
],
"summary": "Get store custodian account",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID",
"schema": {
"type": "string"
}
},
{
"name": "assetBalances",
"in": "query",
"required": false,
"description": "Enable if you want the result to include the 'assetBalances' field. This will make the call slower or could cause the call to fail if the asset balances cannot be loaded (i.e. due to a bad API key).",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"200": {
"description": "List of custodian accounts for the store.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CustodianAccountData"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the custodian account"
}
}
},
"put": {
"operationId": "Custodians_UpdateStoreCustodianAccount",
"tags": [
"Custodians"
],
"summary": "Update custodial account",
"description": "Update custodial account",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCustodianAccountRequest"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "The updated custodian account",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CustodianAccountData"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to modify new custodian account"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canmanagecustodianaccounts"
],
"Basic": []
}
]
},
"delete": {
"operationId": "Custodians_DeleteStoreCustodianAccount",
"tags": [
"Custodians"
],
"summary": "Delete store custodian account",
"description": "Deletes a custodial account",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Custodian account deleted"
},
"403": {
"description": "If you are authenticated but forbidden to delete the custodian account"
}
}
}
},
"/api/v1/stores/{storeId}/custodian-accounts/{accountId}/trades/quote": {
"get": {
"operationId": "Custodians_GetStoreCustodianAccountTradeQuote",
"tags": [
"Custodians"
],
"summary": "Get quote for trading one asset for another",
"description": "Get the current bid and ask price for converting one asset into another.",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID.",
"schema": {
"type": "string"
}
},
{
"name": "fromAsset",
"in": "query",
"required": true,
"description": "The asset to convert.",
"schema": {
"type": "string"
}
},
{
"name": "toAsset",
"in": "query",
"required": true,
"description": "The asset you want.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "The quote for converting one asset to another.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QuoteResultData"
}
}
}
},
"404": {
"description": "No tradable asset pair found for this trade."
},
"403": {
"description": "If you are authenticated but forbidden to create trades"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewcustodianaccounts"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/custodian-accounts/{accountId}/trades/market": {
"post": {
"operationId": "Custodians_StoreCustodianAccountTradeMarket",
"tags": [
"Custodians"
],
"summary": "Trade one asset for another",
"description": "Trade one asset for another using a market order (=instant purchase with instant result or failure). A suitable asset pair will automatically be selected. If no asset pair is available, the call will fail.",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TradeRequestData"
}
}
}
},
"responses": {
"200": {
"description": "Information about the trade that was executed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TradeResultData"
}
}
}
},
"404": {
"description": "No tradable asset pair found for this trade."
},
"403": {
"description": "If you are authenticated but forbidden to create trades"
}
},
"security": [
{
"API_Key": [
"btcpay.store.cantradecustodianaccounts"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/custodian-accounts/{accountId}/addresses/{paymentMethod}": {
"get": {
"operationId": "Custodians_GetStoreCustodianAccountDepositAddress",
"tags": [
"Custodians"
],
"summary": "Get a deposit address for custodian",
"description": "Get a new deposit address for the custodian using the specified payment method (network + crypto code).",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID.",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "path",
"required": true,
"description": "The payment method to use for the deposit. Example: \"BTC-OnChain\" or \"BTC-Lightning\"",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "deposit address",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"depositAddress": {
"type": "string",
"description": "The address to deposit your funds."
}
},
"description": "A bitcoin address belonging to the custodian"
},
"example": {
"depositAddress": "bc1qxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
},
"404": {
"description": "The custodian does not support deposits using this payment method."
},
"403": {
"description": "If you are authenticated but forbidden to get the deposit address"
}
},
"security": [
{
"API_Key": [
"btcpay.store.candeposittocustodianaccounts"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/custodian-accounts/{accountId}/withdrawals/simulation": {
"post": {
"operationId": "Custodians_SimulateWithdrawFromStoreCustodianAccount",
"tags": [
"Custodians"
],
"summary": "Simulate a withdrawal",
"description": "Get more information about a potential withdrawal including fees, minimum and maximum quantities for the given asset and quantity.",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID.",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "query",
"required": true,
"description": "The payment method to be used for the withdrawal.",
"schema": {
"type": "string"
}
},
{
"name": "qty",
"in": "query",
"required": true,
"description": "The quantity to simulate a withdrawal for.",
"schema": {
"type": "number"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WithdrawalRequestData"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Information about a potential withdrawal including fees, minimum and maximum quantities.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WithdrawalSimulationResultData"
}
}
}
},
"400": {
"description": "Withdrawal is not possible because you don't have this much in your account."
},
"404": {
"description": "Withdrawal is not possible for this payment method."
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"type": "string",
"description": "If you are authenticated but forbidden to create withdrawals"
},
{
"type": "string",
"description": "Withdrawing to the address provided is not allowed"
}
]
}
}
}
}
},
"security": [
{
"API_Key": [
"btcpay.store.canwithdrawfromcustodianaccounts"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/custodian-accounts/{accountId}/withdrawals": {
"post": {
"operationId": "Custodians_WithdrawFromStoreCustodianAccount",
"tags": [
"Custodians"
],
"summary": "Withdraw to store wallet",
"description": "Withdraw an asset to your store wallet.",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WithdrawalRequestData"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "Information about the withdrawal that was executed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WithdrawalResultData"
}
}
}
},
"400": {
"description": "Withdrawal is not possible because you don't have this much in your account."
},
"404": {
"description": "Withdrawal is not possible for this asset."
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"type": "string",
"description": "If you are authenticated but forbidden to withdraw"
},
{
"type": "string",
"description": "Withdrawing to the address provided is not allowed"
}
]
}
}
}
}
},
"security": [
{
"API_Key": [
"btcpay.store.canwithdrawfromcustodianaccounts"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/custodian-accounts/{accountId}/withdrawals/{withdrawalId}": {
"get": {
"operationId": "Custodians_GetStoreCustodianAccountWithdrawalInfo",
"tags": [
"Custodians"
],
"summary": "Get withdrawal info",
"description": "Get the details about a past withdrawal.",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The Store ID",
"schema": {
"type": "string"
}
},
{
"name": "accountId",
"in": "path",
"required": true,
"description": "The Custodian Account ID.",
"schema": {
"type": "string"
}
},
{
"name": "withdrawalId",
"in": "path",
"required": true,
"description": "The Withdrawal ID.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Information about the withdrawal",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WithdrawalResultData"
}
}
}
},
"404": {
"description": "Withdrawal not found."
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"type": "string",
"description": "If you are authenticated but forbidden to create trades"
},
{
"type": "string",
"description": "Withdrawing to the address provided is not allowed"
}
]
}
}
}
}
},
"security": [
{
"API_Key": [
"btcpay.store.canwithdrawfromcustodianaccounts"
],
"Basic": []
}
]
}
}
},
"components": {
"schemas": {
"CustodianData": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "The unique code of the custodian.",
"nullable": false
},
"label": {
"type": "string",
"description": "The name of the custodian.",
"nullable": false
},
"depositablePaymentMethods": {
"type": "array",
"description": "A list of payment methods (crypto code + network) you can deposit to the custodian.",
"nullable": false
},
"withdrawablePaymentMethods": {
"type": "array",
"description": "A list of payment methods (crypto code + network) you can withdraw from the custodian.",
"nullable": false
},
"tradableAssetPairs": {
"type": "array",
"description": "A list of tradable asset pair objects, or NULL if the custodian cannot trades/convert assets.",
"nullable": true,
"items": {
"$ref": "#/components/schemas/AssetPairData"
}
}
},
"example": {
"code": "kraken",
"name": "Kraken",
"tradableAssetPairs": {
"BTC/USD": {
"assetBought": "BTC",
"assetSold": "USD",
"minimumTradeQty": 0.001
},
"BTC/EUR": {
"assetBought": "BTC",
"assetSold": "EUR",
"minimumTradeQty": 0.001
},
"LTC/USD": {
"assetBought": "LTC",
"assetSold": "USD",
"minimumTradeQty": 0.05
},
"LTC/EUR": {
"assetBought": "LTC",
"assetSold": "EUR",
"minimumTradeQty": 0.05
}
},
"withdrawablePaymentMethods": [
"BTC-OnChain",
"LTC-OnChain"
],
"depositablePaymentMethods": [
"BTC-OnChain",
"LTC-OnChain"
]
}
},
"CustodianAccountData": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The unique code of the customer's account with this custodian. The format depends on the custodian."
},
"storeId": {
"type": "string",
"description": "The store ID."
},
"custodianCode": {
"type": "string",
"description": "The code for the custodian."
},
"name": {
"type": "string",
"description": "The name of the custodian account."
},
"assetBalances": {
"type": "array",
"nullable": true,
"description": "A real-time loaded list of all assets (fiat and crypto) on this custodian and the quantity held in the account. Assets with qty 0 can be omitted.",
"items": {
"$ref": "#/components/schemas/AssetBalanceData"
}
},
"config": {
"type": "object",
"nullable": true,
"description": "The configuration of this custodian account. Specific contents depend on the custodian and your access permissions."
}
},
"example": {
"accountId": "xxxxxxxxxxxxxxx",
"storeId": "xxxxxxxxxxxxxx",
"custodianCode": "kraken",
"name": "My Kraken Account",
"assetBalances": [
{
"asset": "BTC",
"qty": "1.23456"
},
{
"asset": "USD",
"qty": "123456.78"
}
],
"config": {
"WithdrawToAddressNamePerPaymentMethod": {
"BTC-OnChain": "My Ledger Nano"
},
"ApiKey": "xxx",
"PrivateKey": "xxx"
}
}
},
"CreateCustodianAccountRequest": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The unique code of the customer's account with this custodian. The format depends on the custodian."
},
"storeId": {
"type": "string",
"description": "The store ID."
},
"custodianCode": {
"type": "string",
"description": "The code for the custodian."
},
"name": {
"type": "string",
"description": "The name of the custodian account."
},
"config": {
"type": "object",
"nullable": true,
"description": "The configuration of this custodian account. Specific contents depend on the custodian and your access permissions."
}
},
"example": {
"accountId": "xxxxxxxxxxxxxxx",
"storeId": "xxxxxxxxxxxxxx",
"custodianCode": "kraken",
"name": "My Kraken Account",
"config": {
"WithdrawToAddressNamePerPaymentMethod": {
"BTC-OnChain": "My Ledger Nano"
},
"ApiKey": "xxx",
"PrivateKey": "xxx"
}
}
},
"QuoteResultData": {
"type": "object",
"properties": {
"fromAsset": {
"type": "string",
"description": "The asset to trade.",
"nullable": false
},
"toAsset": {
"type": "string",
"description": "The asset you want.",
"nullable": false
},
"bid": {
"type": "string",
"format": "decimal",
"description": "The bid price.",
"nullable": false
},
"ask": {
"type": "string",
"format": "decimal",
"description": "The ask price",
"nullable": false
}
},
"example": {
"fromAsset": "USD",
"toAsset": "BTC",
"bid": "30000.12",
"ask": "30002.24"
}
},
"TradeRequestData": {
"type": "object",
"properties": {
"fromAsset": {
"type": "string",
"description": "The asset to trade.",
"nullable": false
},
"toAsset": {
"type": "string",
"description": "The asset you want.",
"nullable": false
},
"qty": {
"oneOf": [
{
"type": "string",
"format": "decimal",
"description": "The qty of fromAsset to convert into toAsset.",
"example": "1.50"
},
{
"type": "string",
"description": "The percent of fromAsset to convert into toAsset. The value must end with \"%\" to be considered a percentage.",
"example": "50%"
}
],
"nullable": false
}
},
"example": {
"fromAsset": "USD",
"toAsset": "BTC",
"qty": "50%"
}
},
"TradeResultData": {
"type": "object",
"properties": {
"fromAsset": {
"type": "string",
"description": "The asset to trade."
},
"toAsset": {
"type": "string",
"description": "The asset you want."
},
"ledgerEntries": {
"type": "array",
"description": "The asset entries that were changed during the trade. This is an array of at least 2 items with the asset sold and the asset gained. It may also include ledger entries for the costs of the trade and possibly exchange tokens used.",
"items": {
"$ref": "#/components/schemas/LedgerEntryData"
}
},
"tradeId": {
"type": "string",
"description": "The unique ID of the trade used by the exchange. This ID can be used to get the details of this trade at a later time.",
"nullable": true
},
"accountId": {
"type": "string",
"description": "The unique ID of the custodian account used.",
"nullable": false
},
"custodianCode": {
"type": "string",
"description": "The code of the custodian used.",
"nullable": false
}
},
"example": {
"fromAsset": "USD",
"toAsset": "BTC",
"ledgerEntries": [
{
"asset": "BTC",
"qty": "1.23456",
"type": "Trade"
},
{
"asset": "USD",
"qty": "-61728",
"type": "Trade"
},
{
"asset": "BTC",
"qty": "-0.00123456",
"type": "Fee"
},
{
"asset": "KFEE",
"qty": "-123.456",
"type": "Fee"
}
],
"tradeId": "XXXX-XXXX-XXXX-XXXX",
"accountId": "xxxxxxxxxxxxxx",
"custodianCode": "kraken"
}
},
"WithdrawalRequestData": {
"type": "object",
"properties": {
"paymentMethod": {
"type": "string",
"description": "The payment method (cryptocode + network) of the withdrawal.",
"nullable": false
},
"qty": {
"oneOf": [
{
"type": "string",
"format": "decimal",
"description": "The quantity to withdraw."
},
{
"type": "string",
"description": "The percent of your holdings to withdraw. The value must end with \"%\" to be considered a percentage."
}
]
}
},
"example": {
"paymentMethod": "BTC-OnChain",
"qty": "0.123456"
}
},
"WithdrawalResultData": {
"type": "object",
"properties": {
"asset": {
"type": "string",
"description": "The asset that is being withdrawn."
},
"paymentMethod": {
"type": "string",
"description": "The payment method that is used (crypto code + network)."
},
"ledgerEntries": {
"type": "array",
"description": "The asset entries that were changed during the withdrawal. The first item is always the withdrawal itself. It could also includes ledger entries for the costs and may include credits or exchange tokens to give a discount.",
"items": {
"$ref": "#/components/schemas/LedgerEntryData"
}
},
"withdrawalId": {
"type": "string",
"description": "The unique ID of the withdrawal used by the exchange.",
"nullable": true
},
"accountId": {
"type": "string",
"description": "The unique ID of the custodian account used.",
"nullable": false
},
"custodianCode": {
"type": "string",
"description": "The code of the custodian used.",
"nullable": false
},
"status": {
"type": "string",
"description": "The status of the withdrawal: 'Queued', 'Complete', 'Failed' or 'Unknown'.",
"nullable": false
},
"transactionId": {
"type": "string",
"description": "The transaction ID on the blockchain once the withdrawal has been executed.",
"nullable": true
},
"targetAddress": {
"type": "string",
"description": "The address where the funds were sent to once the withdrawal has been executed.",
"nullable": true
}
},
"example": {
"asset": "BTC",
"paymentMethod": "BTC-OnChain",
"ledgerEntries": [
{
"asset": "BTC",
"qty": "-0.123456",
"type": "Withdrawal"
},
{
"asset": "BTC",
"qty": "-0.005",
"type": "Fee"
}
],
"withdrawalId": "XXXX-XXXX-XXXX-XXXX",
"accountId": "xxxxxxxxxxxxxxx",
"custodianCode": "kraken",
"status": "Complete",
"transactionId": "xxxxxxxxxxxxxxx",
"targetAddress": "bc1qxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
},
"WithdrawalSimulationResultData": {
"type": "object",
"properties": {
"asset": {
"type": "string",
"description": "The asset that is being withdrawn."
},
"paymentMethod": {
"type": "string",
"description": "The payment method that is used (crypto code + network)."
},
"ledgerEntries": {
"type": "array",
"description": "The asset entries that would be changed if this were a real withdrawal. The first item is always the withdrawal itself. It could also includes ledger entries for the costs and may include credits or exchange tokens to give a discount.",
"items": {
"$ref": "#/components/schemas/LedgerEntryData"
}
},
"accountId": {
"type": "string",
"description": "The unique ID of the custodian account used.",
"nullable": false
},
"custodianCode": {
"type": "string",
"description": "The code of the custodian used.",
"nullable": false
},
"minQty": {
"type": "string",
"format": "decimal",
"description": "The minimum amount to withdraw",
"nullable": true
},
"maxQty": {
"type": "string",
"format": "decimal",
"description": "The maximum amount to withdraw",
"nullable": true
}
},
"example": {
"asset": "BTC",
"paymentMethod": "BTC-OnChain",
"ledgerEntries": [
{
"asset": "BTC",
"qty": "-0.123456",
"type": "Withdrawal"
},
{
"asset": "BTC",
"qty": "-0.005",
"type": "Fee"
}
],
"withdrawalId": "XXXX-XXXX-XXXX-XXXX",
"accountId": "xxxxxxxxxxxxxxx",
"custodianCode": "kraken",
"status": "Complete",
"transactionId": "xxxxxxxxxxxxxxx",
"targetAddress": "bc1qxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
},
"LedgerEntryData": {
"type": "object",
"description": "A single ledger entry meaning an asset and qty has changed (increased or decreased).",
"properties": {
"asset": {
"type": "string",
"description": "An asset.",
"nullable": false
},
"qty": {
"type": "string",
"format": "decimal",
"description": "The quantity changed of the asset. Can be positive or negative.",
"nullable": false
},
"type": {
"type": "string",
"description": "Trade, Fee or Withdrawal",
"nullable": false
}
},
"example": {
"asset": "BTC",
"qty": "1.23456",
"type": "Trade"
}
},
"AssetBalanceData": {
"type": "object",
"description": "An asset and it's qty.",
"properties": {
"asset": {
"type": "string",
"description": "An asset.",
"nullable": false
},
"qty": {
"type": "string",
"format": "decimal",
"description": "The quantity changed of the asset. Can be positive or negative.",
"nullable": false
}
},
"example": {
"asset": "BTC",
"qty": "1.23456"
}
},
"AssetPairData": {
"type": "object",
"description": "An asset pair we can trade.",
"properties": {
"pair": {
"type": "string",
"description": "The name of the asset pair.",
"nullable": false
},
"minimumTradeQty": {
"type": "number",
"description": "The smallest amount we can buy or sell.",
"nullable": false
}
},
"example": {
"assetBought": "BTC",
"assetSold": "USD",
"minimumTradeQty": 0.0001
}
}
}
},
"tags": [
{
"name": "Custodians",
"description": "Custodian operations"
}
]
}