476052856 1b8b3d1b62 dcrwallet | 7 years ago | |
---|---|---|
bitcointest | 7 years ago | |
bucashtest | 7 years ago | |
litetest | 7 years ago | |
src | 7 years ago | |
zcashtest | 7 years ago | |
README.md | 7 years ago | |
coinproxy.toml | 7 years ago | |
coinsapi | 7 years ago | |
config.go | 7 years ago | |
data.go | 7 years ago | |
db.go | 7 years ago | |
err.go | 7 years ago | |
httphandler.go | 7 years ago | |
httpserver.go | 7 years ago | |
list.go | 7 years ago | |
main.go | 7 years ago | |
makefile | 7 years ago | |
taskprocess.go | 7 years ago |
CoinProxy 接口使用说明
1 程序接口设计说明 1.1 创建用户地址 请求方式:post 协议:http url路径: http://ip:port/coinproxy/createaddr Postdata: 关键字 必需 描述 signature 是 Sha1(postdata+timestamp+apikey) timestamp 是 Unix 时间戳 cointype 是 货币类型。Sia 暂定类型为:SC
返回结果: 成功:{“errcode”:0.”address”:”xxxxxx”} 失败:{“errcode”:-xx,”msg”:”xxx”}
1.2 获取的交易输出(入币) 采用http get 方法,定时查询获取。
请求方式:get 协议:http url路径: http://ip:port/coinproxy/query /transinfo Postdata: 关键字 必需 描述 signature 是 Sha1(postdata+timestamp+apikey) timestamp 是 Unix 时间戳 starth 是 启始块链高度 endh 是 尾块链高度 cointype 是 货币类型,sia 币暂定为SC
返回结果: 成功:{ “errcode”:0, “cointype”:”SC” “outputs”[
{
"id":"4b5bec08e5280d5b5bee92352ab683a3fbf2b67dcf257ed8adab5cca877b974c",
"walletaddress":true,
"address":"1e8314b279863594ba4405475a6243dfe2369d7f87db94a5d304bb721b096e118b9882fbf1f5",
"value":"98962100000000000000000000"
"transactionid":"306510bf6a4f8054dd29a65d80fa71764249e5a00d8e70cbef39b5e08d8e780c",
"confirmationheight":108660,
"confirmationtimestamp":1496911746
},
]
} 失败:{“errcode”:-xx,”msg”:”xxx”}
1.3 SC 币转账 把钱包的余额转账到指定地址上
请求方式:post 协议:http url路径: http://ip:port/coinproxy/sendcoins Postdata: json 关键字 必需 描述 signature 是 Sha1(postdata+timestamp+apikey) timestamp 是 Unix 时间戳 amount 是 转账的数目 address 是 转账的目的地址
返回结果: 成功: {“errcode”:0.”msg”:”xxxxxx”,”transcationids”:[“xxx”,”xxxx”]}
//示例: {“errcode”:0.”msg”:”xxxx",transactionids":["ce3d01e9c4c1476365eaa64c9cf6429b97a248e088dc3f0db42abaf013949aa6","29278ffe74df1b05780a608d201d96c3e5add8ae9018dad0ce8ca75d62a44cbc"]}
失败:{“errcode”:xx,”msg”:”xxx”}
1.4 查询钱包余额 获取钱包余额
请求方式:post 协议:http url路径: http://ip:port/coinproxy/coinbalance postdata: json 关键字 必需 描述 signature 是 Sha1(postdata+timestamp+apikey) timestamp 是 Unix 时间戳 cointype 是 货币类型。Sia 暂定类型为:SC
返回结果: 成功:{“errcode”:0.”confirmedbalance”:”xxxxxx”,”exact”:”xxxxx”,”unconfirmed”:”xxxx”}
//confirmed balance 确认的余额 //exact :精确的余额,bigint 表示。 例如: Confirmed Balance: 986.8 SC Exact: 986770999999999999999999752 H Unconfirmed: -1.5 SC
失败:{“errcode”:xx,”msg”:”xxx”}