SVDB
开发者可以通过打点平台授权机制查询一些相关的链上信息,目前提供免费接口,每日可以查询一万次
获取免费 token
参数名 |
类型 |
是否必须 |
说明 |
appid |
string |
是 |
商家应用账户 |
appsecret |
string |
是 |
商家应用密钥 |
错误码 code
为 0 时表示成功
{
"code": 0,
"msg": "",
"data": "xxxxxxxxxxxxxxxxxxxxx"
}
参数名 |
类型 |
说明 |
data |
string |
token |
查询 token 剩余次数
查询剩余次数
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
{
"code": 0,
"msg": "",
"data": 1000
}
merkle-tree 查询
通过 txid 查询交易的 merkle 路径
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
必选 |
类型 |
说明 |
txid |
是 |
string |
交易的 id |
{
"code": 0,
"msg": "",
"data": {
"txs": 156,
"hashes": [
"7ae2ab185a6e501753f6e29e5b6a98ba040098acb7c11ffed9430f22ed5263a3",
"cf2a9a7d357a90dc1aad8740f45c60f5f6b878c198153be197a76486382546d2",
"95843caf747674b117111bd850ffdf8ae2b0297618d7cd5227c65ff11978c15e",
"c96833b5711cdcd1c615b1b037618bbd8f9cea57d147768e94b2e32a190dba6b",
"637f452dbceaca1f184ebc385ac675d40e0fc2cca1d5cafa9a908ce3b62e9290",
"5a0bc3772c7510405781b4856085eb9f2f3ccfa5a7c67830f7b6d64d15a056b1",
"b1918268ba355b551fee2e55292f48292a2b7ff8bbc951a7acb6db97d8223765",
"e4eaecd1de4594749a816042d7d80d66c64d5b801f0830e726874aab8345233a",
"e64e32e120aced23171e71f99b56bcea3d24e5d18a475792fbe3d41cebb31c76"
],
"flags": "ff0200",
"blockhash": "000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214"
}
}
参数名 |
类型 |
说明 |
txs |
int |
该交易所在的区块的交易数量 |
flags |
string |
经过 16 进制编码的 bip37 描述的 flag,用来配合 hash 数组计算 mekle root |
blockhash |
string |
区块 hash |
hashes |
string 数组 |
merkle 路径上的 hash 值 |
区块头部查询
通过区块 hash 获取 raw block header
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
blockhash |
string |
是 |
区块 hash |
{
"code": 0,
"msg": "",
"data": "02000000028f2cb75e0b6b2bcaba83efa34cb6af4a7bc04e882de8c2090000000000000023d7fee87f54bfb980f383b80742ac060bb5294ff9cb82d159caa8acaf1eec1647f9fc51f2db721961769100"
}
参数名 |
类型 |
说明 |
data |
string |
16 进制区块头 |
交易查询
通过 txid 查询交易信息
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
txid |
string |
是 |
交易 hash |
{
"code": 0,
"msg": "",
"data": {
"txid": "016a195a865e57a24d2f606aef89d8775ed2f8ae9016419542b9ad798574f6f6",
"vins": [
{
"index": 0,
"script": "4730440220493447148876bb55b63712c93004384ad0e0b35500ce96949751682afe8e7d4d022050ff787468c73a3ca51207a93805e96de032a2fa2a6fd8a0153c5d99daf92ae6412103396952494b704fd57dbadfb22951c83f700f6dba06d6bcc32da608d4807067e8",
"value": 1110213
},
{
"index": 1,
"script": "4730440220449daee99fd72d026864fa084ec5a338be4e3c355ff3a7f6d01951c25957b6b702200fe26fb621da1c2df8d870a5bf6029bb6fb775a58c320f5589e90fb7039bbdf5412102e44bf284602e8d6b3cd2492c783a03ee44cd6965c3f91c07f6c2bbe9d8c6ff46",
"value": 3602800
},
{
"index": 2,
"script": "483045022100c3d55580d62ac027676e5d352be4cc710051726c68d5ff76085682dd4b3636fb02203b5ff2f5b298a42efbabde5273efda8329547de469f32279cae25d5b3984edfd41210286f4ff4da872b42529007bbbfe6bef8368b601874f6e34610028d7e54614c0a4",
"value": 1424703
},
{
"index": 3,
"script": "473044022047ae5c1c2ac3211418708141633fe6952f8dd8e7d9baa878d2323323f25c3c38022076af30794eabb63dc9d840152c1b29921adeb67c93e8eb39efaa246367524492412102b25439ce52f3b0114575afc12dccffa0583f911a5d99a569d1c3aacb808f0c1c",
"value": 254000
},
{
"index": 4,
"script": "483045022100d9522a1e107375b184459091855c36c0a2fff577d9270ca140c4f6a253986a1e02200cd4934de777f188fe5d85fc8bbe111569c58b48cb46c0b3cfdc7efad8ce802841210248b88693adf60fbce82045a6885ceba6840d0977f1a64c3504a76a63b024574c",
"value": 144110712
}
],
"vouts": [
{
"index": 0,
"script": "76a9142fa431e514155b7d36955a7b204aca593043128288ac",
"value": 149500000
},
{
"index": 1,
"script": "76a914cb13d2b179851b7b37a34763a698fabfe401c7bf88ac",
"value": 1001610
}
],
"height": 625876,
"size": 815,
"timestamp": 1583995981,
"confirmation": 6
}
}
参数名 |
类型 |
说明 |
vouts |
json |
所有的 vout |
vins |
json |
所有的 vin |
index |
int |
vin 或者 vout 的 index |
confirmation |
int |
确认数 |
timestamp |
int |
时间戳 |
size |
int |
交易大小 (单位:byte) |
value |
int |
交易金额 (单位:satoshi) |
script |
string |
16 进制编码过的脚本 |
txid |
string |
交易的 txid |
height |
int |
区块高度,-1 表示未确认 |
地址信息查询
通过地址查询地址的交易数量以及余额,只支持 p2pkh 的地址
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
address |
string |
是 |
地址 |
{
"code": 0,
"msg": "",
"data": {
"transactions": 161,
"balance": 10000000000
}
}
参数名 |
类型 |
说明 |
transactions |
int |
该地址参与的交易数量 |
balance |
int |
该地址的余额 |
地址 utxo 查询
通过地址查询地址 utxo,只支持 p2pkh 的地址
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
address |
string |
string |
地址 |
offset |
int |
int |
偏移, 例:[1,2,3,4,5] offset:2, limit:3 得到[3,4,5] |
limit |
int |
int |
条目,最大为 100 |
{
"code": 0,
"msg": "",
"data": [
{
"value": 10000000000,
"txid": "35f81304c4966b3be6ee750069071005810c2006adf962bbca368840f7561581",
"index": 3,
"height": 625881,
"sigscript": "dqkUEqpEM1Ja8xNPxBD/Uu7TcZLllEeIrA=="
}
]
}
参数名 |
类型 |
说明 |
txid |
string |
交易 id |
index |
int |
utxo 是该交易的第几个 output |
height |
int |
区块高度,-1 表示未确认 |
value |
int |
交易金额 (单位:satoshi) |
sigscript |
string |
utxo 锁定脚本 |
地址流水查询
通过地址查询地址流水,只支持 p2pkh 的地址
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
address |
string |
是 |
地址 |
offset |
int |
int |
偏移, 例:[1,2,3,4,5] offset:2, limit:3 得到[3,4,5] |
limit |
int |
是 |
条目,最大为 100 |
{
"code": 0,
"msg": "",
"data": [
{
"txid": "b064989072bab185984b0106b7f7d3588083f2e2e148a5eb4000f554c9508f66",
"value": -10000000000,
"height": -1
},
{
"txid": "35f81304c4966b3be6ee750069071005810c2006adf962bbca368840f7561581",
"value": 10000000000,
"height": 625881
},
{
"txid": "24c4c256cc609596af588fd68100c2ca97f5b8fdea7bbce8f510e9ce4ee6d9ee",
"value": -10000000000,
"height": 625852
}
]
}
参数名 |
类型 |
说明 |
txid |
string |
交易 id |
height |
int |
该交易的高度,-1 表示为确认 |
value |
int |
金额 |
sigscript |
string |
utxo 锁定脚本 |
根据 hash 查询区块信息
根据区块 hash 查询区块信息
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
hash |
string |
string |
区块 hash |
{
"code": 0,
"msg": "",
"data": {
"height": 625882,
"reward": 1250601893,
"timestamp": 1583999952,
"transaction_count": 1771,
"size": 1015875,
"hex_coinbase": "03da8c092f68747470733a2f2f636f696e6765656b2e636f6d2f6d696e65722d6f757472656163682f2f4b37633144d892a7db975fcb22337800c0",
"hash": "0000000000000000017d4326a7232eaefde92465ae77d762c6d1892914e5f0e5"
}
}
参数名 |
类型 |
说明 |
|
height |
int |
高度 |
|
hash |
string |
区块 hash |
|
size |
int |
大小(单位:byte) |
|
timestamp |
int |
时间戳 |
|
reward |
int |
出块奖励(单位:satoshi) |
|
hex_coinbase |
string |
16 进制编码脚本 |
|
transaction_count |
int |
交易数量 |
|
根据高度查询区块信息
根据高度查询区块信息
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
类型 |
说明 |
height |
int |
int |
区块高度 |
{
"code": 0,
"msg": "",
"data": {
"height": 625882,
"reward": 1250601893,
"timestamp": 1583999952,
"transaction_count": 1771,
"size": 1015875,
"hex_coinbase": "03da8c092f68747470733a2f2f636f696e6765656b2e636f6d2f6d696e65722d6f757472656163682f2f4b37633144d892a7db975fcb22337800c0",
"hash": "0000000000000000017d4326a7232eaefde92465ae77d762c6d1892914e5f0e5"
}
}
参数名 |
类型 |
说明 |
height |
int |
高度 |
hash |
string |
区块 hash |
size |
int |
大小(单位:byte) |
timestamp |
int |
时间戳 |
reward |
int |
出块奖励(单位:satoshi) |
hex_coinbase |
string |
16 进制编码脚本 |
transaction_count |
int |
交易数量 |
根据高度批量查看区块信息
以高度倒序,批量获取区块
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
offset |
int |
int |
偏移, 例:[1,2,3,4,5] offset:2, limit:3 得到[3,4,5] |
{
"code": 0,
"msg": "",
"data": [
{
"height": 625890,
"reward": 1250171398,
"timestamp": 1584005058,
"transaction_count": 782,
"size": 284711,
"hex_coinbase": "03e28c0904b8ff695e322f537069646572506f6f6c2ffabe6d6dda153ebb0e68d606ba543955fc4aece1fa6ebf31c8dec55114914bb4cfc20a2401000000000000000100076acb69000000000000",
"hash": "00000000000000000080a268f9d00b7e05a3362884cd525fa540308205af8e04"
},
{
"height": 625889,
"reward": 1250319195,
"timestamp": 1584004809,
"transaction_count": 802,
"size": 368455,
"hex_coinbase": "03e18c0904c9fe695e088100079a7606000057617270486173685c30",
"hash": "00000000000000000226910abdfddb05cea178e3eb7f9086b8600a9970fecd9c"
}
]
}
参数名 |
类型 |
说明 |
height |
int |
高度 |
hash |
string |
区块 hash |
size |
int |
大小(单位:byte) |
timestamp |
int |
时间戳 |
reward |
int |
出块奖励(单位:satoshi) |
hex_coinbase |
string |
16 进制编码脚本 |
transaction_count |
int |
交易数量 |
获取区块交易列表
获取区块交易列表
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
参数名 |
类型 |
是否必须 |
说明 |
hash |
string |
i |
区块 hash |
offset |
int |
是 |
偏移, 例:[1,2,3,4,5] offset:2, limit:3 得到[3,4,5] |
limit |
int |
是 |
条目,最大为 100 |
{
"code": 0,
"msg": "",
"data": [
"4ef83acd026495adff7dfb276bfaf271b0e6ba6c2bc462ef105dd8e1c5fc29f4",
"9de197b307f650835765150bff25220408eb6d2d753990645d38bd085ff72053",
"1d6982b15f828b77f48146cee3f4f8a4658c0a9dce287e59b27dc14ee9654780",
"51679f5421403d13b204827f5e09f0c1316a311645f850ec925007d6ae135fe4",
"81a95fab656ca6fe6060d9d202419e00a34c400d3c8215b33ec06e5f10a4b033"
]
}
参数名 |
类型 |
说明 |
data |
array |
txid 数组 |
获取区块链基础信息
查询区块链的一些基础信息
参数名 |
类型 |
是否必须 |
说明 |
token |
string |
是 |
token |
{
"code": 0,
"msg": "",
"data": {
"bestblock": 625891,
"unconfirm_tx_count": 37525,
"bestfeerate": {
"feebyte": 1,
"feesatoshi": 1
},
"hashes_per_sec": 2829162.275754181,
"diffculty": 415922505851.8293
}
}
参数名 |
类型 |
说明 |
bestblock |
int |
最新高度 |
unconfirm_tx_count |
int |
未确认交易数量 |
bestfeerate |
json |
btc:表示当前内存池内交易小于 0.8m 的交易费率;bsv:固定返回 1:1 |
feebyte |
int |
与 feesatoshi 配合,表示几聪 /几字节 中的几字节 |
feesatoshi |
int |
与 feebyte 配合,表示几聪 /几字节 中的几聪 |
hashes_per_sec |
float |
算力 |
diffculty |
float |
难度 |