NAV Navbar
json

钱包-更新日志

版本 时间 内容
V1.0.0 2022-02-14 初始版本

介绍

访问限制

为了保证系统运行效率,bit.com实施API访问限流措施。公有接口按IP进行频率限制,私有接口按UID进行频率限制。当请求频率超限时,会返加“429 too many requests” 提示。每个UID的API限制参数可在bit.com网站的交易中心页面进行查看。如需提高限制参数,请联系我们的用户支持(support@bit.com)。

接口目录

Path Method Description Scope Rate Limit Type Permission
/v1/wallet/um-withdraw POST 账户提现 private wallet wallet
/v1/wallet/um-withdrawals GET 账户提现记录 private wallet read
/v1/wallet/um-deposits GET 账户充值记录 private wallet read
/v1/wallet/sub-user-transfer POST 子母账户转账 private transfer transfer
/v1/wallet/sub-user-transfer GET 子母账户转账记录 private transfer read
/v1/wallet/um/currencies GET 获取币种列表(充提信息) private wallet read

钱包

账户提现

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"}'

返回数据


{
    "code": 0,
    "message": "",
    "data": {
        "withdraw_id": "b61c2b93-8a25-44d4-9715-023cce61dc50"
    }
}

用户可通过此接口账户向外提取资金。提现地址首先要在bit.com网站的提现页面 设置为白名单地址。资金密码pwd字段需要通过base64(sha256(pwd))进行编码。例如,假设密码是123456,编码后的密码为“jZae727K08KaOmKSgOaGzww/XVqGr/PKEgIMkjrcbJI=”

请求参数

字段名称 数据类型 是否必填 默认值 说明
currency string true "" 币种, BTC
address string true "" 提现的目标地址
amount string true "" 提现金额
pwd string true "" 资金密码
chain string false "" 链名 提现USDT时,要提到USDTERC应填ETH,要提到USDTTRE应填TRX

返回数据

字段名称 数据类型 说明
withdraw_id string 提现订单ID, 可用于后续的查询

账户提现记录

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&timestamp=1589522687689&signature=signature"

返回数据


{
    "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"
        }]
    }
}

用户可指定币种查询账户的提现记录。

请求参数

字段名称 数据类型 是否必填 默认值 说明
currency String true "" 币种名称
limit int false 10 分页大小,最大50
offset int false 0 分页偏移
withdraw_id string false "" 提现订单ID

返回数据

字段名称 数据类型 说明
code int 错误码,0代表正常,其他值代表失败
state string 提现状态
address string 提现目标地址
amount string 提现金额
confirmations int 确认数,如果是内部地址,由于不会上链,一直为0
currency string 币种
fee string 提现手续费
transaction_id string 链上交易哈希
created_at int 订单创建时间戳
updated_at int 订单更新时间戳
is_onchain bool 订单是否上链(内部地址提现不上链)
withdraw_id string 提现订单ID

账户充值记录

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&timestamp=1589522687689&signature=signature"

返回数据


{
    "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
        }]
    }
}

用户指定币种,查询账户的充值记录。

请求参数

字段名 类型 是否必填 默认值 说明
currency String true "" 币种名称
limit int false 10 分页大小,最大50
offset int false 0 分页偏移

返回数据

字段名称 数据类型 说明
code int 错误码,0代表正常,其他值代表失败
state string 充值状态
address string 充值来源地址
amount string 充值金额
confirmations int 确认数,如果是内部地址,由于不会上链,一直为0
currency string 币种
transaction_id string 链上交易哈希
created_at int 订单创建时间戳
updated_at int 订单更新时间戳
is_onchain bool 订单是否上链(内部地址充值不上链)

查询充值地址

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&timestamp=1589522687689&signature=signature"

Response


{
    "code": 0,
    "data": {
            "address": "mfaFpdVCb6UFS5AXUhC8VGXgj9dnJ37nLP",
            "tag": ""
    }
}

Get deposit address

请求参数

字段名 类型 是否必填 默认值 说明
currency string true
chain string true
wallet string false 选择钱包类型(cobo/cactus),默认不填写

返回数据

字段名称 数据类型 说明
address string address
tag string

查询token

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.

请求参数

None

返回数据

字段名称 数据类型 说明
currency string currency
chains []string

获取币种列表

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": ""
}

获取与当前实体相关的所有可用货币的列表(如果有不符合的币种查询,会在message里返回错误信息)

Query parameters

Parameter Type Required Default Description
ccy string false 币种,支持多币种查询(不超过20个),币种之间半角逗号分隔

Response

Name Type Description
ccy string 币种名称
chain string 网络
min_withdraw string 最小提币量
withdraw_fee string 提现手续费
deposit_confirm string 充值入账确认数
min_deposit string 最小充值量
deposit_success string 充值解锁确认数
can_withdraw string 是否可以提币
can_deposit string 是否可以充值

子母账号

子母账号转账

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, "signature": "signature"}'

返回数据

{
    "code": 0,
    "message": ""
}

请求参数

参数名 类型 是否必填 说明
from int 转出用户ID
to int 转入用户ID
currency string 币种, BTC, BCH, ETH
amount string 划转金额,单位个,例如1.23
type int 转账类型,1.现货到现货,2.合约到合约,3.现货到合约,4.合约到现货,5.统一账户到统一账户,6.统一账户到合约,7.合约到统一账户,8.统一账户到现货,9.现货到统一账户

注意


子母账号转账记录查询

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&timestamp=1589522687689&signature=signature"

返回数据

{
    "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"
        }]
    }
}

请求参数

参数名 类型 是否必填 说明
sub_user_id int
currency string
page int 默认1
limit int 默认50

返回

字段 类型 说明
type int 1.现货到现货,2.合约到合约,3.现货到合约,4.合约到现货,5.统一账户到统一账户,6.统一账户到合约,7.合约到统一账户,8.统一账户到现货,9.现货到统一账户
from int
to int
currency string
amount string
order_id string
created_at int 创建时间戳,单位秒