NAV Navbar
json

钱包-更新日志

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

介绍

访问限制

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

接口目录

Path Method Description Scope Rate Limit Type Permission
/v1/wallet/transfer POST 划转 private transfer transfer
/v1/wallet/transfer GET 查询划转记录 private transfer read
/v1/wallet/spot-withdraw POST 现货账户提现 private wallet wallet
/v1/wallet/withdraw POST 合约账户提现 private wallet wallet
/v1/wallet/um-withdraw POST 统一账户提现 private wallet wallet
/v1/wallet/spot-withdrawals GET 现货账户提现记录 private wallet read
/v1/wallet/withdraw GET 合约账户提现状态 private wallet read
/v1/wallet/withdrawals GET 合约账户提现记录 private wallet read
/v1/wallet/um-withdrawals GET 统一账户提现记录 private wallet read
/v1/wallet/deposits GET 合约账户充值记录 private wallet read
/v1/wallet/um-deposits GET 统一交易账户充值记录 private wallet read
/v1/wallet/spot-deposits GET 现货账户充值记录 private wallet read
/v1/wallet/sub-user-transfer POST 子母账户转账 private transfer transfer
/v1/wallet/sub-user-transfer GET 子母账户转账记录 private transfer read

钱包

Bit.com有3种类型的账户:现货账户,合约账户,统一交易账户。 Matrixport.com(简称M站)有余额账户

现货账户提现

POST /v1/wallet/spot-withdraw

curl -X POST "https://betaapi.bitexch.dev/v1/wallet/spot-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/spot-withdrawals

curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/spot-withdrawals?currency=BTC&limit=10&offset=0&timestamp=1589522687689&signature=signature"

返回数据


{
    "code": 0,
    "data": {
        "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
        }, {
            "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
        }]
    }
}

经典用户,可根据币种查询现货账户的提现记录。

请求参数

字段名称 数据类型 是否必填 默认值 说明
currency String true "" 币种名称
limit int false 10 分页大小,最大50
offset int false 1 分页偏移
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 订单是否上链(内部地址提现不上链)

现货账户充值记录

GET /v1/wallet/spot-deposits

curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/spot-deposits?currency=BTC&limit=10&offset=0&timestamp=1589522687689&signature=signature"

返回数据


{
    "code": 0,
    "data": {
        "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 1 分页偏移

返回数据

字段名称 数据类型 说明
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 订单是否上链(内部地址充值不上链)

合约账户提现

POST /v1/wallet/withdraw

curl -X POST "https://betaapi.bitexch.dev/v1/wallet/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"}'

Response


{
    "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 "" 资金密码

返回数据

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

合约账户提现状态

GET /v1/wallet/withdraw

curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/withdraw?withdraw_id=b61c2b93-8a25-44d4-9715-023cce61dc50&timestamp=1589522687689&signature=signature"

Response


{
    "code": 0,
    "data": {
        "address": "mfaFpdVCb6UFS5AXUhC8VGXgj9dnJ37nLP",
        "amount": "0.001",
        "code": 0,
        "confirmations": 0,
        "currency": "BTC",
        "fee": "0.00001",
        "state": "unconfirmed",
        "transaction_id": "52e1537002f51acbf5f52b9dfeab6a9e7cc185a669cda2573e768420b0839523",
        "created_at": 1608606000000,
        "updated_at": 1608606000000,
        "is_onchain": true
    },
    "message": ""
}

Inquire withdraw state based on withdraw ID

请求参数

字段名称 数据类型 是否必填 默认值 说明
withdraw_id String true "" Withdraw ID

返回数据

字段名称 数据类型 说明
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 transafers 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

合约账户提现记录

GET /v1/wallet/withdrawals

curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/withdrawals?currency=BTC&count=10&offset=0&timestamp=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
        }, {
            "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
        }]
    }
}

经典用户,指定币种查询合约账户的提现记录。

请求参数

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

返回数据

字段名称 数据类型 说明
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 订单是否上链

合约账户充值记录

GET /v1/wallet/deposits

curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/deposits?currency=BTC&count=10&offset=0&timestamp=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
        }]
    }
}

经典用户,查询合约账户的充值记录。

请求参数

字段名 类型 是否必填 默认值 说明
currency String true "" 币种
count 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 链上交易hash
created_at int 订单创建时间
updated_at int 订单更新时间

统一UM账户提现

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

UM用户,可通过此接口从统一交易账户向外提取资金。提现地址首先要在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, 可用于后续的查询

统一UM账户提现记录

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

UM用户,可指定币种查询统一交易账户的提现记录。

请求参数

字段名称 数据类型 是否必填 默认值 说明
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 订单是否上链(内部地址提现不上链)

统一UM账户充值记录

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

UM用户,指定币种,询统一交易账户的充值记录。

请求参数

字段名 类型 是否必填 默认值 说明
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 订单是否上链(内部地址充值不上链)

划转

POST /v1/wallet/transfer

curl -X POST "https://betaapi.bitexch.dev/v1/wallet/transfer" -H "Content-Type: application/json" -H "X-Bit-Access-Key: Your Access Key" -d '{"currency": "BTC", "amount": "1.2", "type": 1, "timestamp": 1589523989378, "signature": "signature"}'

返回数据


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

Bit.com有3种类型的账户:现货账户,合约账户,统一交易账户。 Bit的账户都支持和Matrixport账户之间的互相划转。

请求参数

字段名 类型 是否必填 默认值 说明
currency string true 币种名称
amount string true 转账金额
type int true 转账类型 1.现货到合约,2.合约到现货,3.现货到Matrixport账户, 4.Matrixport账户到现货,5.合约到Matrixport账户,6.Matrixport账户到合约,7.统一账户到Matrixport账户,8.Matrixport账户到统一账户

划转记录查询

GET /v1/wallet/transfer

curl -H "X-Bit-Access-Key: Your Access Key" "https://betaapi.bitexch.dev/v1/wallet/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"
        }]
    }
}

请求参数

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

返回数据

字段名称 数据类型 说明
status string 转账状态 失败/成功/处理中
type int 转账类型
currency string 币种名称
amount string 转账金额
created_at int 转账创建时间戳
order_id string 转账订单ID

子母账号

子母账号转账

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 创建时间戳,单位秒