获取收币地址
通过CoinsDo API可快速获取海量收币地址,分发给用户完成收币,无需额外接入第三方支付系统。
归集钱包客户端将签名后的地址提交给CoinsDo服务器
企业业务服务器对地址进行验签保证地址来自企业归集钱包客户端
接口描述
请求地址
请求方式
请求参数
{
"apiKey": "cd384rt80f5575dc",
"mainnet": "TRX",
"targetDeviceUuid": "085C28EC-0BD6-442B-8232-D23BC8F4D58E",
"timestamp": "1622775712229",
"addressRemark": "trx address"
}
请求示例1
{
"data": "{\"apiKey\":\"cd384rt80f5575dc\",\"mainnet\":\"TRX\",\"targetDeviceUuid\":\"085C28EC-0BD6-442B-8232-D23BC8F4D58E\",\"timestamp\":\"1622775712229\",\"addressRemark\":\"trx address\"}",
"sign": "67355f9ad0db846edd05761462edfc1f8d396af2624e8998ee52c010c7a60dbd"
}
请求示例2
{
"data":"{\"mainnet\":\"BCH\",\"targetDeviceUuid\":\"92E30E38-63A1-41DC-B95C-8E729DFDDE7A\",\"apiKey\":\"4c90b98cc97b45b2\",\"isConvert\":\"1\",\"timestamp\":2639477935817}",
"sign":"7d9ae0b10068422ff30be92f45bdda0fe69bf405224564cefdc81775241d4081"
}
返回示例1
{
"code": 200, // 状态码
"msg": "成功", // 提示信息
"data": {
"address": "TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR",
"addrSign": "TESTTESTU4u0dj5xXEoZ9E4EXSes9WawqfpxrRfOIHgXV1BnPNM2tt0DLloCnJkzR7smC26+z6kuZb87s3hitZWgM3UaWWghB8/qNMQImvCZ6MREqChoNmEVyaqCnTbjorKsrU/V0=",
"convertedAddr": null
}
}
返回示例2
{
"code": 200,
"msg": "成功",
"data": {
"address": "bchtest:qzfr5996z72me99flf32jf6yfs38hshcwcp3dx8eja",
"addrSign": "ZJA+/GJGNUXFw2soBGBaEbWFSOPtNMD8eRdVLTyZyuKHjnyklWvGe8SqkV8xxhwlFcT1+td9AbKstLD6b+lJ4jSCIqm5WbcMJjo0k1mCdihAagsbn5zVyTYEO7LQac341wP/76jopdYnH/yVvP5VtcNq8ZgkrcOi08ReLaQsMO8=",
"convertedAddr": "mtr8XbbzhJVG2TYy3bYFxfV5TBw8PSEzkB"
}
}
返回状态码
BCH地址转换
BCH 地址格式:Legacy格式(经典地址)和CashAddr格式(标准地址),CoinsDo提供此BCH地址转换API以兼容用户不同格式的地址
接口描述
请求地址
请求方式
{
"apiKey": "4c90b98cc97b45b2",
"address": "msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s",
"timestamp": "2639474345487"
}
请求示例1
{
"data":"{\"apiKey\":\"4c90b98cc97b45b2\",\"address\":\"msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s\",\"timestamp\":\"2639474345487\"}",
"sign":"fc2ed2d7713a499ff718e69507cb95b1a49ac00f4be1daf34187381b8afc43c9"
}
请求示例2
{
"data":"{\"apiKey\":\"4c90b98cc97b45b2\",\"address\":\"bchtest:qzq0gjkv2qmwe0ph25nuh28c2gxn7dezqgvc8c2aca\",\"timestamp\":\"2639474345487\"}",
"sign":"7acecc69f1b8c05be5ebfc8435d9fea0cf39aa9138af22084f3a9aa96b323844"
}
返回示例1
{
"code": 200,
"msg": "成功",
"data": {
"legacyAddr": "msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s",
"cashAddr": "bchtest:qzq0gjkv2qmwe0ph25nuh28c2gxn7dezqgvc8c2aca"
}
}
返回示例2
{
"code": 200,
"msg": "成功",
"data": {
"legacyAddr": "msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s",
"cashAddr": "bchtest:qzq0gjkv2qmwe0ph25nuh28c2gxn7dezqgvc8c2aca"
}
}
返回状态码
回调通知
通过回调通知API将归集收币到账确认状态通知至商户后台设置的回调URL。
请求方式
请求参数
收币通知
CoinsDo的钱包节点检测到钱包地址有充值后通知企业部署的CoinGet客户端
企业CoinGet客户端对地址进行验签保证地址是属于自己的钱包
企业CoinGet客户端透过第三方区块链浏览器验证充值
当CoinGet钱包客户端收到验证成功后会对信息进行签名然后提交给CoinsDo服务器
企业透过CoinsDo API接收带有签名的回调信息
企业业务服务器对信息进行验签保证信息来自企业CoinGet客户端
链上达到一个确认数通知
主币:
{
"coinType": "0",
"deviceUuid": "B65EB9AC-75DB-4B08-A84A-1C70349E61E8",
"blockConfirm": "1",
"amount": "0.012",
"flag": "BCH",
"txTime": "1660604310",
"mainnet": "BCH",
"toAddress": "bchtest:qzc0k3j8a8gq3egaw4n7xxd6eanp9vehnuwcu4teup",
"isReachedConfirm": "0",
"tokenAddress": "",
"protocol": "",
"blockNumber": "1513202",
"txFee": "0.00001",
"coinsDoId": "9",
"fromAddress": "bchtest:qpn3cx8vqd22ut5lpkd0xqzda65nlxphwgu3v7v4na",
"currency": "BCH",
"coinName": "BCH",
"txHash": "e5223b3cce8c54514394e728972a0056ef487b3295026412e12a4bc47cfd659e",
"txIndex": "0"
}
协议:
{
"coinType": "1",
"deviceUuid": "B65EB9AC-75DB-4B08-A84A-1C70349E61E8",
"blockConfirm": "1",
"amount": "5",
"flag": "TF17BgPaZYbz8oxbjhriubPDsA7ArKoLX3",
"txTime": "1661336430",
"mainnet": "TRX",
"toAddress": "TKTBQ6zk8fQazY1r2vJys6VanoiWmJDXqh",
"isReachedConfirm": "0",
"txMemo": "0",
"tokenAddress": "TF17BgPaZYbz8oxbjhriubPDsA7ArKoLX3",
"protocol": "TRC20",
"blockNumber": "29232059",
"txFee": "8.34196",
"coinsDoId": "38",
"fromAddress": "TNX41cJ4Cy3WKd6NVkqtUp6nbrGLmT5Vy9",
"currency": "TRC20",
"coinName": "JST",
"txHash": "b29e917066ed433b5d2753ae07a9b4bd71245509f8f9de51ec5a2e43425f91a8",
"txIndex": "0"
}
请求示例
主币:
{
"data": "{\"coinType\":\"0\",\"deviceUuid\":\"B65EB9AC-75DB-4B08-A84A-1C70349E61E8\",\"blockConfirm\":\"1\",\"amount\":\"0.012\",\"flag\":\"BCH\",\"txTime\":\"1660604310\",\"mainnet\":\"BCH\",\"toAddress\":\"bchtest:qzc0k3j8a8gq3egaw4n7xxd6eanp9vehnuwcu4teup\",\"isReachedConfirm\":\"0\",\"tokenAddress\":\"\",\"protocol\":\"\",\"blockNumber\":\"1513202\",\"txFee\":\"0.00001\",\"coinsDoId\":\"9\",\"fromAddress\":\"bchtest:qpn3cx8vqd22ut5lpkd0xqzda65nlxphwgu3v7v4na\",\"currency\":\"BCH\",\"coinName\":\"BCH\",\"txHash\":\"e5223b3cce8c54514394e728972a0056ef487b3295026412e12a4bc47cfd659e\",\"txIndex\":\"0\"}",
"sign": "ef7a1fc9cebe9b135954c8a1a4263c06f9b05e5cb608bdeed45e1c64f4f67b26"
}
协议:
{
"data": "{\"coinType\":\"1\",\"deviceUuid\":\"B65EB9AC-75DB-4B08-A84A-1C70349E61E8\",\"blockConfirm\":\"1\",\"amount\":\"5\",\"flag\":\"TF17BgPaZYbz8oxbjhriubPDsA7ArKoLX3\",\"txTime\":\"1661336430\",\"mainnet\":\"TRX\",\"toAddress\":\"TKTBQ6zk8fQazY1r2vJys6VanoiWmJDXqh\",\"isReachedConfirm\":\"0\",\"txMemo\":\"0\",\"tokenAddress\":\"TF17BgPaZYbz8oxbjhriubPDsA7ArKoLX3\",\"protocol\":\"TRC20\",\"blockNumber\":\"29232059\",\"txFee\":\"8.34196\",\"coinsDoId\":\"38\",\"fromAddress\":\"TNX41cJ4Cy3WKd6NVkqtUp6nbrGLmT5Vy9\",\"currency\":\"TRC20\",\"coinName\":\"JST\",\"txHash\":\"b29e917066ed433b5d2753ae07a9b4bd71245509f8f9de51ec5a2e43425f91a8\",\"txIndex\":\"0\"}",
"sign": "1ca1cf273bab9f63b5b1dcbbf72d1a56efab7ea4e3e7e2bbc1e7710e130c3f9f"
}
达到指定链上确认数收币通知
主币:
{
"coinType": "0",
"deviceUuid": "85FE7308-A6B8-4D17-9849-1077FC082BA3",
"blockConfirm": "250",
"amount": "0.0501",
"flag": "ETC",
"checkSign": "aHo/lkSIgYqh76sK3DQi3HdPJJ1BcftunimAnub6ucl8rTnlj4HcXfczgIyhkr4HcOrFqF1PAentnEvRKGu8BzwoxmOyWyHMxjJjYSnLmO9/53MoQ/1Y/0+tS+7YQo0WWa3A2gdnRjGaHoIjLBn5WynM15zgXnEeCiN4qlHEu6o=",
"txTime": "1673328422",
"mainnet": "ETC",
"toAddress": "0x9975843827d799262f2b4209489e9232d52b9a53",
"isReachedConfirm": "1",
"checkCode": "0",
"feeSymbol": "ETC",
"tokenAddress": "",
"recordId": "4590533727417345",
"protocol": "",
"checkMode": "0",
"blockNumber": "7954343",
"txFee": "0.000105",
"coinsDoId": "7",
"fromAddress": "0x5e27188508a19e8884ab6a268a39964932301553",
"currency": "ETC",
"coinName": "ETC",
"txHash": "0xb2377b314be008590b70d5ca81892e3d4169a567df7ac2cf810618f30ea68687",
"txIndex": "null"
}
协议:
{
"coinType": "1",
"deviceUuid": "85FE7308-A6B8-4D17-9849-1077FC082BA3",
"blockConfirm": "15",
"amount": "10.1",
"flag": "0x378da755324ee4f1a5735a4f13499a410d82d122",
"checkSign": "BLVMetTZSNEzI2apnOpSRIdhrwDjyAsOVpJprEHZeWsrL4CGq3t50G1L7MjIlVFknEaAmvlKFgLu22oEhD4NRZOUU7rIcfTldzWpYct8s+/Ais9LMqCu3Uw0mfhYXO7fB11BA3q+glaH0JEQ1Wnmcvt5OIfzlCW2rG9vethipxY=",
"txTime": "1673328446",
"mainnet": "BSC",
"toAddress": "0x30a5c679978b8ab5bfb8b31123366d405d5efa62",
"isReachedConfirm": "1",
"checkCode": "0",
"feeSymbol": "BNB",
"tokenAddress": "0x378da755324ee4f1a5735a4f13499a410d82d122",
"recordId": "4590542064244737",
"protocol": "BEP20",
"checkMode": "0",
"blockNumber": "26216212",
"txFee": "0.00051248",
"coinsDoId": "139",
"fromAddress": "0xcbb98240d7cf185ef8c3867d2aa56e500d103d17",
"currency": "BEP20",
"coinName": "CD",
"txHash": "0x2f8160ad2ab556be36003a77087968387843ef9104fa7bca5fda5a1f7b2c6c1d",
"txIndex": "4"
}
请求示例
主币:
{
"data": "{\"coinType\":\"0\",\"deviceUuid\":\"85FE7308-A6B8-4D17-9849-1077FC082BA3\",\"blockConfirm\":\"250\",\"amount\":\"0.0501\",\"flag\":\"ETC\",\"checkSign\":\"aHo/lkSIgYqh76sK3DQi3HdPJJ1BcftunimAnub6ucl8rTnlj4HcXfczgIyhkr4HcOrFqF1PAentnEvRKGu8BzwoxmOyWyHMxjJjYSnLmO9/53MoQ/1Y/0+tS+7YQo0WWa3A2gdnRjGaHoIjLBn5WynM15zgXnEeCiN4qlHEu6o=\",\"txTime\":\"1673328422\",\"mainnet\":\"ETC\",\"toAddress\":\"0x9975843827d799262f2b4209489e9232d52b9a53\",\"isReachedConfirm\":\"1\",\"checkCode\":\"0\",\"feeSymbol\":\"ETC\",\"tokenAddress\":\"\",\"recordId\":\"4590533727417345\",\"protocol\":\"\",\"checkMode\":\"0\",\"blockNumber\":\"7954343\",\"txFee\":\"0.000105\",\"coinsDoId\":\"7\",\"fromAddress\":\"0x5e27188508a19e8884ab6a268a39964932301553\",\"currency\":\"ETC\",\"coinName\":\"ETC\",\"txHash\":\"0xb2377b314be008590b70d5ca81892e3d4169a567df7ac2cf810618f30ea68687\",\"txIndex\":\"null\"}",
"sign": "99b488151db83010585d711fe890dad1a15217d288dd6a74411471616044cba9"
}
协议:
{
"data": "{\"coinType\":\"1\",\"deviceUuid\":\"85FE7308-A6B8-4D17-9849-1077FC082BA3\",\"blockConfirm\":\"15\",\"amount\":\"10.1\",\"flag\":\"0x378da755324ee4f1a5735a4f13499a410d82d122\",\"checkSign\":\"BLVMetTZSNEzI2apnOpSRIdhrwDjyAsOVpJprEHZeWsrL4CGq3t50G1L7MjIlVFknEaAmvlKFgLu22oEhD4NRZOUU7rIcfTldzWpYct8s+/Ais9LMqCu3Uw0mfhYXO7fB11BA3q+glaH0JEQ1Wnmcvt5OIfzlCW2rG9vethipxY=\",\"txTime\":\"1673328446\",\"mainnet\":\"BSC\",\"toAddress\":\"0x30a5c679978b8ab5bfb8b31123366d405d5efa62\",\"isReachedConfirm\":\"1\",\"checkCode\":\"0\",\"feeSymbol\":\"BNB\",\"tokenAddress\":\"0x378da755324ee4f1a5735a4f13499a410d82d122\",\"recordId\":\"4590542064244737\",\"protocol\":\"BEP20\",\"checkMode\":\"0\",\"blockNumber\":\"26216212\",\"txFee\":\"0.00051248\",\"coinsDoId\":\"139\",\"fromAddress\":\"0xcbb98240d7cf185ef8c3867d2aa56e500d103d17\",\"currency\":\"BEP20\",\"coinName\":\"CD\",\"txHash\":\"0x2f8160ad2ab556be36003a77087968387843ef9104fa7bca5fda5a1f7b2c6c1d\",\"txIndex\":\"4\"}",
"sign": "2efb88ef2043329e60a5dad1cabc622fd076c1d1fa45648c799a0529e3babf39"
}
收币通知 data 参数
❗客户端在线状态方可进行核查,关闭核查将忽略客户端的核查直接回调;正常情况下核查成功后将会回调,如遇核查异常情况则核查超过10次后再回调
❗关闭了核查请忽略checkSign,因为该字段可能为空
❗核查的签名验签规则:
使用RSA-SHA256验证钱包公钥对签名数据和签名的结果
签名数据是由checkCode+recordId+txHash组成
比如请求示例中checkCode是0;
recordId是4590542064244737;
txHash是0x2f8160ad2ab556be36003a77087968387843ef9104fa7bca5fda5a1f7b2c6c1d;
签名数据就是045905420642447370x2f8160ad2ab556be36003a77087968387843ef9104fa7bca5fda5a1f7b2c6c1d,
85FE7308-A6B8-4D17-9849-1077FC082BA3的钱包公钥是MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCYmbkVn95lUPYZTybd68Bm5CoW0UjMpEQijaGZLPm6NH0YGJiPsQa6n3jBWEm2zhiG+oLAjZnNNl+SPxEO7dJC/PhTCuFp1muGOn5xm6ItS11ByEbAOZrSMWkV7mqFQZQkTZw0tHGP7X8AqoiXClFwc+m/lkVawHqq2NUSJbafJQIDAQAB,
checkSign(签名结果)是BLVMetTZSNEzI2apnOpSRIdhrwDjyAsOVpJprEHZeWsrL4CGq3t50G1L7MjIlVFknEaAmvlKFgLu22oEhD4NRZOUU7rIcfTldzWpYct8s+/Ais9LMqCu3Uw0mfhYXO7fB11BA3q+glaH0JEQ1Wnmcvt5OIfzlCW2rG9vethipxY=
❗建议直接使用coinsDoId判断是什么币种到账,或者根据mainnet + coinType判断,例:
主币:mainnet=ETH coinType=0 就是coinsDoId为2的币种ETH,
代币:mainnet=ETH coinType=1 ,再根据tokenAddress判断是什么币种,比如tokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7就是coinsDoId为6的币种USDT
❗coinName不能做币种到账判断,只做展示作用,因为同个链可能存在相同币种名称
返回示例
{
"code": 200, // 状态码
"msg": "成功", // 提示信息
"data": null //返回信息
}
手动归集
未触发自动归集时,支持人工手动发起归集操作,可全额或定额归集。
接口描述
请求提交成功后,需等待CoinGet客户端处理,归集结果需查看归集记录或钱包客户端日志
请求地址
请求方式
{
"apiKey": "4c90b98cc97b45b2",
"address": "0xd065380c78847bfba75ad158067a5e8e845205f0",
"coinsDoId": "22",
"collectAmount": "0.12",
"timestamp": "1671699594204"
}
请求示例1
{
"data":"{\"address\":\"0xd065380c78847bfba75ad158067a5e8e845205f0\",\"apiKey\":\"4c90b98cc97b45b2\",\"coinsDoId\":\"22\",\"timestamp\":\"1671698862478\"}",
"sign":"bca9130ebc1998e2fea8c81bf480f13dbdd7259f05ac7019f47a70bc8bae407f"
}
请求示例2
{
"data":"{\"address\":\"0xd065380c78847bfba75ad158067a5e8e845205f0\",\"apiKey\":\"4c90b98cc97b45b2\",\"coinsDoId\":\"22\",\"collectAmount\":\"0.12\",\"timestamp\":\"1671699594204\"}",
"sign":"278682f15ae9afba34566b79eb26d90b1ba5d5542f53a2a6b650542265aac429"
}
返回示例
{
"code": 200, // 状态码
"msg": "成功", // 提示信息
"data": null // 返回内容
}
返回状态码
获取收币地址余额
可通过此API查询某一收币地址的余额
接口描述
请求地址
请求方式
{
"apiKey": "d3a0beaa70474d3b",
"address": "r4NXBFySVyhwR1yFBLm2ocxq731KvZKcVR",
"coinsDoId": "30",
"timestamp": 1679397493762
}
请求示例
{
"data":"{\"address\":\"r4NXBFySVyhwR1yFBLm2ocxq731KvZKcVR\",\"apiKey\":\"d3a0beaa70474d3b\",\"coinsDoId\":\"30\",\"timestamp\":\"1679497593762\"}",
"sign":"03dabf4073bad9d5fcde3b881bba076cae211ac28b11995289740f96f51162a5"
}
返回示例
{
"code": 200,
"msg": "成功",
"data": {
"balance": 15.000000000000000000,
"balanceUpdateTime": "1669712411"
}
}
返回状态码