Withdrawal
API Scopes
GET request need Permission to view withdrawal history
, POST request need Permission to execute withdrawals
.
Withdrawal
Attrubute Name | Type | Description | Example |
---|---|---|---|
id | number | id of deposit | |
customer_id | string | id of customer | |
asset_uuid | string | uuid of asset | |
amount | string | amount | |
state | string | withdrawal status, one of PENDING/COMPLETED/FAILED/CANCELLED | |
recipient_id | string | id of recipient | |
completed_at | string | completed time | |
inserted_at | string | withdraw time | |
is_internal | boolean | whether is internal withdrawl | |
target_address | string | address of target | |
note | string | content of note |
Get withdrawals of user
Required read permission of wallet
GET /viewer/withdrawals
Parameters
Name | Type | Require | Description | Example |
---|---|---|---|---|
page_token | string | false | request page after this page token | |
limit | string | false | defalut 50 | |
kind | string | false | kind: on_chain, off_chain, internal | |
asset_symbol | string | false | asset symbol | BTC |
Response is a Withdrawal array.
{
"data": [{
"id": 10,
"customer_id": "10",
"asset_symbol": "ETH",
"amount": "5",
"state": "COMPLETED",
"note": "2018-03-15T16:13:45.610463Z",
"txid": "0x4643bb6b393ac20a6175c713175734a72517c63d6f73a3ca90a15356f2e967da0",
"completed_at": "2018-03-15T16:13:45.610463Z",
"inserted_at": "2018-03-15T16:13:45.610463Z",
"is_internal": true,
"target_address": "0x4643bb6b393ac20a6175c713175734a72517c63d6f7"
}],
"page_token":"eyJvZmZzZXQiOjEwMCwia2luZCI6IlRSQU5TRkVSIn0="
}
Get one withdrawal
GET /viewer/withdrawals/{guid}
Parameters
Name | Type | Require | Description | Example |
---|---|---|---|---|
guid | string | true | guid | c37173f4-751f-4cc1-9904-c1041dcae4f7 |
Response is Withdrawal object.
{
"code":0,
"message":"",
"data": {
"id": 10,
"customer_id": "10",
"asset_symbol": "ETH",
"amount": "5",
"state": "COMPLETED",
"note": "2018-03-15T16:13:45.610463Z",
"txid": "0x4643bb6b393ac20a6175c713175734a72517c63d6f73a3ca90a15356f2e967da0",
"completed_at": "2018-03-15T16:13:45.610463Z",
"inserted_at": "2018-03-15T16:13:45.610463Z",
"is_internal": true,
"target_address": "0x4643bb6b393ac20a6175c713175734a72517c63d6f7"
}
}
Create withdrawal of user
Required write permission of wallet
POST /viewer/withdrawals
Parameters
Name | Type | Require | Description | Example |
---|---|---|---|---|
symbol | string | true | asset symbol | BTC |
target_address | string | true | target address | 3PumsXwUSakZomHXMcY93RrVRJ7PAi2ida |
amount | string | true | amount | 2.52 |
memo | string | false | memo | |
guid | string | false | guid | c37173f4-751f-4cc1-9904-c1041dcae4f7 |
gateway_name | string | false | withdraw asset belongs to which chain | For example, if you wish to widrawal USDT on Ethereum, then symbol should be 'USDT' and gateway_name should be 'Ethereum'. Avaliable gateway names: Bitcoin, Ethereum, Tron, EOS, Mixin |
Response is a Withdrawal object.
{
"code":0,
"message":"",
"data": {
"id": 10,
"customer_id": "10",
"asset_symbol": "ETH",
"amount": "5",
"state": "COMPLETED",
"note": "2018-03-15T16:13:45.610463Z",
"txid": "0x4643bb6b393ac20a6175c713175734a72517c63d6f73a3ca90a15356f2e967da0",
"completed_at": "2018-03-15T16:13:45.610463Z",
"inserted_at": "2018-03-15T16:13:45.610463Z",
"is_internal": true,
"target_address": "0x4643bb6b393ac20a6175c713175734a72517c63d6f7"
}
}
Cancel one withdrawal
POST /viewer/withdrawals/{guid}/cancel
this is a async api, and returning code 0 does not mean final success, it is recommended to obtain the final status through the get api
Parameters
Name | Type | Require | Description | Example |
---|---|---|---|---|
guid | string | true | guid | c37173f4-751f-4cc1-9904-c1041dcae4f7 |
Response
{
"code":0,
"message":"cancel request submitted",
"data": null
}