Wallet Changelogs
version | time | content |
---|---|---|
V1.0.0 | 2022-02-14 |
init version |
Introduction
Welcome to bit.com API. You can retrieve market data, execute trades and manage your bit.com account through bit.com API.
API rate limits
The public interface implements IP-specified frequency limitation , and the private interface implements user-specified frequency limitation. When a breach happens, a prompt will be returned: “429 too many requests”. About the type of API rate limits, please refer to API summary.Users who need to increase the speed limit please contact the support team via [email protected].
- Rest API rate limits:
Private API(wallet)): 1 requests per second per user.
Private API(transfer): 1 requests second per user.
API summary
- User defined string fields(label etc): valid characters are [A-Z], [a-z], [0-9], "-", "_"
Path | Method | Description | Scope | Rate Limit Type | Permission |
---|---|---|---|---|---|
/v1/wallet/um-withdraw | POST | withdrawl from um-account | private | wallet | wallet |
/v1/wallet/um-withdrawals | GET | query um-account withdrawl records | private | wallet | read |
/v1/wallet/um-deposits | GET | query um-account deposit records | private | wallet | read |
/v1/wallet/sub-user-transfer | POST | transfer between parent and sub accounts | private | transfer | transfer |
/v1/wallet/sub-user-transfer | GET | query sub account transfer records | private | transfer | read |
/v1/wallet/um/currencies | GET | get the currency list (deposit, withdrawal information) | private | wallet | read |
Wallet
Withdraw from account
POST /v1/wallet/um-withdraw
curl -X POST "https://betaapi.bitexch.dev/v1/wallet/um-withdraw" -H "Content-Type: application/json" -H "X-Bit-Access-Key: Your Access Key" -d '{"currency": "BTC", "address": "Your address", "amount": "1.2", "pwd": "Your password", "timestamp": 1589523989378, "signature": "signature", "account_type": 1}'
Response
{
"code": 0,
"message": "",
"data": {
"withdraw_id": "b61c2b93-8a25-44d4-9715-023cce61dc50"
}
}
This endpoint means withdraw cash from account.
Withdraw address need to be whitelisted first here: https://www.bit.com/propertyCenter/withdraw
Password need to be encoded to base64(sha256(pwd)). For example, if password is 123456, the encoded password will be:jZae727K08KaOmKSgOaGzww/XVqGr/PKEgIMkjrcbJI=
Query parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
currency | string | true | "" | Currency, BTC |
address | string | true | "" | Withdrawal address |
amount | string | true | "" | Withdrawal amount |
pwd | string | true | "" | Fund password |
chain | string | false | "" | ETH for USDTERC, TRX for USDTTRC |
account_type | int | false | "" | Account type,1:trading account,2:funding account,default mix account |
Response
Name | Type | Description |
---|---|---|
withdraw_id | string | Withdraw ID, can be used in later inquires |
account withdrawal history
GET /v1/wallet/um-withdrawals
curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/um-withdrawals?currency=BTC&limit=10&offset=0×tamp=1589522687689&signature=signature"
Response
{
"code": 0,
"data": {
"count": 2,
"items": [{
"address": "mfaFpdVCb6UFS5AXUhC8VGXgj9dnJ37nLP",
"amount": "0.001",
"code": 0,
"confirmations": 0,
"currency": "BTC",
"fee": "0.00001",
"state": "confirmed",
"transaction_id": "52e1537002f51acbf5f52b9dfeab6a9e7cc185a669cda2573e768420b0839523",
"created_at": 1608606000000,
"updated_at": 1608606000000,
"is_onchain": true,
"withdraw_id": "b61c2b93-8a25-44d4-9715-023cce61dc50"
}, {
"address": "mfaFpdVCb6UFS5AXUhC8VGXgj9dnJ37nLP",
"amount": "0.11",
"code": 13100100,
"confirmations": 0,
"currency": "BTC",
"fee": "0.00001",
"state": "rejected",
"transaction_id": "",
"created_at": 1608606000000,
"updated_at": 1608606000000,
"is_onchain": false,
"withdraw_id": "b61c2b93-8a25-44d4-9715-023cce61dc50"
}]
}
}
Retrieves the withdrawal records of account.
Query parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
currency | String | true | "" | Currency |
limit | int | false | 10 | Number of requested items, Max - 50 |
offset | int | false | 0 | the offset for pagination |
withdraw_id | string | false | "" | withdraw order id |
Response
Name | Type | Description |
---|---|---|
code | int | Withdraw ID error code, 0 means normal, rest means failed |
state | string | withdrawal state |
address | string | Withdraw address |
amount | string | Withdraw amount |
confirmations | int | Confirmation counts, 0 for internal transfers since they are offchain |
currency | string | Currency |
fee | string | Withdraw fee |
transaction_id | string | Transaction hash |
created_at | int | Timestamp of the order created |
updated_at | int | Timestamp of the order updated |
is_onchain | bool | Whether the order is onchain |
withdraw_id | string | withdraw order id |
account deposits history
GET /v1/wallet/um-deposits
curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/um-deposits?currency=BTC&limit=10&offset=0×tamp=1589522687689&signature=signature"
Response
{
"code": 0,
"data": {
"count": 1,
"items": [{
"address": "mfaFpdVCb6UFS5AXUhC8VGXgj9dnJ37nLP",
"amount": "0.001",
"code": 0,
"confirmations": 0,
"currency": "BTC",
"state": "confirmed",
"transaction_id": "52e1537002f51acbf5f52b9dfeab6a9e7cc185a669cda2573e768420b0839523",
"created_at": 1608606000000,
"updated_at": 1608606000000,
"is_onchain": true
}]
}
}
Retrieves the deposit records of account.
Query parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
currency | String | true | "" | Currency |
limit | int | false | 10 | Number of requested items, Max - 50 |
offset | int | false | 0 | the offset for pagination |
Response
Name | Type | Description |
---|---|---|
code | int | Deposit error code, 0 means normal, rest means failed |
state | string | deposit state |
address | string | Deposit address |
amount | string | Deposit amount |
confirmations | int | Confirmation counts, 0 for internal transfers since they are offchain |
currency | string | Currency |
transaction_id | string | Transaction hash |
created_at | int | Timestamp of the order created |
updated_at | int | Timestamp of the order updated |
is_onchain | bool | Whether the order is onchain |
Get deposit address
GET /v1/wallet/um-deposit-address
curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/um-deposit-address?currency=BTC&chain=BTC×tamp=1589522687689&signature=signature"
Response
{
"code": 0,
"data": {
"address": "mfaFpdVCb6UFS5AXUhC8VGXgj9dnJ37nLP",
"tag": ""
}
}
Get deposit address
Query parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
currency | string | true | ||
chain | string | true | ||
wallet | string | false | select wallet type (cobo/cactus), not filled in by default |
Response
Name | Type | Description |
---|---|---|
address | string | address |
tag | string |
Currency info
GET /v1/wallet/currencies
curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/currencies?timestamp=1589522687689&signature=signature"
Response
{
"code": 0,
"data": {
"currencies": [{
"currency": "BTC",
"chains": ["BTC","BSC"]
}]
}
}
Get the available tokens that bit.com supports.
Query parameters
None
Response
Name | Type | Description |
---|---|---|
currency | string | currency |
chains | []string |
Currency asset info
GET /v1/wallet/um/currencies
curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/um/currencies?timestamp=1589522687689&signature=signature"
Response
{
"code": 0,
"data": [
{
"ccy": "ETH",
"chain": "ETH",
"min_withdraw": "0.00001",
"withdraw_fee": "0.00001",
"deposit_confirm": "10",
"min_deposit": "0.001",
"deposit_success": "10",
"can_withdraw": true,
"can_deposit": true
}
],
"message": ""
}
Get a list of all currencies available which are related to the current entity.(If there is an incompatible currency query, an error message will be returned in the message.)
Query parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
ccy | string | false | supports multi-currency query (no more than 20), separated by half-width commas |
Response
Name | Type | Description |
---|---|---|
ccy | string | currency |
chain | string | currency network |
min_withdraw | string | minimum withdrawal amount |
withdraw_fee | string | withdrawal fee |
deposit_confirm | string | number of recharge confirmations |
min_deposit | string | minimum recharge amount |
deposit_success | string | number of recharge unlock confirmations |
can_withdraw | string | is it possible to withdraw coins |
can_deposit | string | Is it possible to recharge |
Sub Account
Sub-user Transfer (only for parent user)
POST /v1/wallet/sub-user-transfer
curl -X POST "https://betaapi.bitexch.dev/v1/wallet/sub-user-transfer" -H "Content-Type: application/json" -H "X-Bit-Access-Key: Your Access Key" -d '{"currency": "BTC", "amount": "1.2", "type": 1, "from_user": "123", "to_user": "124", "timestamp": 1589523989378, "account_type_from": 1, "account_type_to": 1, "signature": "signature"}'
Response
{
"code": 0,
"message": ""
}
Query parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
from | int | true | Transfer out user id, parent user id or sub user id | |
to | int | true | Transfer in user id, parent user id or sub user id | |
type | int | true | Transfer account type, 1:spot-to-spot 2:contract-to-contract, 3: spot-to-contract, 4: contract-to-spot, 5: um-to-um, 6: um-to-contract, 7: contract-to-um, 8: um-to-spot, 9: spot-to-um | |
currency | string | true | ||
amount | string | true | ||
account_type_from | int | false | Account type,1:trading account,2:funding account,default mix account | |
account_type_to | int | false | 1 | Account type,1:trading account,2:funding account,default trading account |
Note
* This endpoint only supports transfer between parent and sub-accounts. Users must fill the sub-account user id and at least one of the ‘from’ and ‘to’ fields.
If ‘from’ is empty, the transfer will be made from the parent account to the sub-account by default.
If ‘to’ is empty, the transfer will be made from the sub-account to the parent account by default.
- bit.com supports independent migration. As a consequence, the parent account and sub-accounts may adopt different modes.
For example, if the parent account is under um mode and the sub-account is under the classic model, the from the account is the parent and the ‘to’ account is a sub, the transfer type will support 6. um account to contract 8. um, account to spot. If the transfer type does not match the account mode, the transfer will fail.
Sub user transfer history (only for parent user)
GET /v1/wallet/sub-user-transfer
curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/sub-user-transfer?currency=BTC&count=10&offset=0×tamp=1589522687689&signature=signature"
Response
{
"code": 0,
"data": {
"count": 2,
"items": [{
"status": "done",
"currency": "BTC",
"amount": "1.2",
"type": 1,
"created_at": 1608606000000,
"id": "123"
}, {
"status": "done",
"currency": "ETH",
"amount": "1.2",
"type": 2,
"created_at": 1608606000000,
"id": "124"
}]
}
}
Query parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
currency | string | false | ||
limit | int | false | 10 | Number of requested items, Max - 50 |
page | int | false | 1 | the offset for pagination |
sub_user_id | int | true |
Response
Name | Type | Description |
---|---|---|
type | int | 1:spot-to-spot 2:contract-to-contract, 3: spot-to-contract, 4: contract-to-spot, 5: um-to-um, 6: um-to-contract, 7: contract-to-um, 8: um-to-spot, 9: spot-to-um |
currency | string | |
amount | string | |
created_at | int | Timestamp of the order created |
order_id | string | transfer id |
from | int | |
to | int |