# Viawallet 开发者文档


# 接口说明

# 说明

Endpoint: https://developers.viawallet.com/openapi/api

如无特别说明,BTC及其类似币种接口支持的币种为:BTC、BCH、BSV、LTC、DASH、DOGE、ZEC、DCR、FCH、DGB、LBC、BHA、RVN、ZEN、HNS

ETH及其类似币种接口支持的币种为:ETH、ETC、BNB、HT、TRX

URL中的{coin}参数对应为各个币种的小写缩写

API接口均返回如下json对象,错误码code=0时成功,其他表示失败,message描述错误原因。data为json对象或数组,null值为查询无结果。

{
  "code": 0,          // 错误码
  "data": {},         // 请求结果,json对象或者数组
  "message": "OK"     // 错误信息
}

特别的,对于提供翻页功能的接口,返回格式如下所示。

{
    "code": 0,
    "data": {
        "items": [],   // 结果数组
        "limit": 10,   // 每页数量
        "nextkey": "", // 翻页游标
        "page": 1      // 页数
    },
    "message": "OK"
}

对于GET和DELETE请求,请求参数应放在url中。

对于POST, PUT请求,请求参数应是json字符串,放在请求体中,并带上Content-Type: application/json请求头

所有的请求都带tonce 查询参数,用于签名和校验。tonce取值为精确到毫秒的时间戳,确保该时间戳小于服务器时间,并且跟服务器时间相差不超过1分钟

API接口返回的日数据统计周期为北京时间0点~24点

# 鉴权

每个账户或子账户都有一对 api key 和 private key, 可在API管理 (opens new window)页面找到。api key 用于标识用户身份,private key 用于签名,以验证用户身份,请勿泄露

Key Value
api key BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw
private key mpEFG56Nc9u5fUFjrg9mWoTEe8uk343X

每个API接口均需要鉴权,鉴权方式为在请求中带上X-API-KEY: <your_api_key>的请求头。例如:

curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/block?hashOrHeight=675871' -H 'X-API-KEY: 16289e05354c3c3814b8f3045950395f'

除鉴权外,还需要签名。签名及请求步骤如下:

  1. 将request url和tonce参数组合成如下形式
/openapi/api/btc/v1/block?tonce=1513746038205
  1. 用密钥 private key 计算request url 和 tonce 的HMAC SHA256签名
echo -n '/openapi/api/btc/v1/webhook/addresses?tonce=1513746038205' | openssl dgst -sha256 -hmac "mpEFG56Nc9u5fUFjrg9mWoTEe8uk343X"
# output: 8c640807d23a80b32f52fbb163afaa677fb33d5b0784017cf47074594ff72f16
  1. 在请求中带上X-API-KEY: < your_api_key >以及X-SIGNATURE: < signature >的请求头,signature即是上一步中计算出的签名
curl 'https://developers.viawallet.com/openapi/api/btc/v1/block?hashOrHeight=666666&tonce=1513746038205' -H 'X-API-KEY: BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw' -H 'X-SIGNATURE: 8c640807d23a80b32f52fbb163afaa677fb33d5b0784017cf47074594ff72f16'
Example Request
Example Response
200 OK

# 接口说明

# 说明

Endpoint: https://developers.viawallet.com/openapi/api

如无特别说明,BTC及其类似币种接口支持的币种为:BTC、BCH、BSV、LTC、DASH、DOGE、ZEC、DCR、FCH、DGB、LBC、BHA、RVN、ZEN、HNS

ETH及其类似币种接口支持的币种为:ETH、ETC、BNB、HT、TRX

URL中的{coin}参数对应为各个币种的小写缩写

API接口均返回如下json对象,错误码code=0时成功,其他表示失败,message描述错误原因。data为json对象或数组,null值为查询无结果。

{
  "code": 0,          // 错误码
  "data": {},         // 请求结果,json对象或者数组
  "message": "OK"     // 错误信息
}

特别的,对于提供翻页功能的接口,返回格式如下所示。

{
    "code": 0,
    "data": {
        "items": [],   // 结果数组
        "limit": 10,   // 每页数量
        "nextkey": "", // 翻页游标
        "page": 1      // 页数
    },
    "message": "OK"
}

对于GET和DELETE请求,请求参数应放在url中。

对于POST, PUT请求,请求参数应是json字符串,放在请求体中,并带上Content-Type: application/json请求头

所有的请求都带tonce 查询参数,用于签名和校验。tonce取值为精确到毫秒的时间戳,确保该时间戳小于服务器时间,并且跟服务器时间相差不超过1分钟

API接口返回的日数据统计周期为北京时间0点~24点

# 鉴权

每个账户或子账户都有一对 api key 和 private key, 可在API管理 (opens new window)页面找到。api key 用于标识用户身份,private key 用于签名,以验证用户身份,请勿泄露

Key Value
api key BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw
private key mpEFG56Nc9u5fUFjrg9mWoTEe8uk343X

每个API接口均需要鉴权,鉴权方式为在请求中带上X-API-KEY: <your_api_key>的请求头。例如:

curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/block?hashOrHeight=675871' -H 'X-API-KEY: 16289e05354c3c3814b8f3045950395f'

除鉴权外,还需要签名。签名及请求步骤如下:

  1. 将request url和tonce参数组合成如下形式
/openapi/api/btc/v1/block?tonce=1513746038205
  1. 用密钥 private key 计算request url 和 tonce 的HMAC SHA256签名
echo -n '/openapi/api/btc/v1/webhook/addresses?tonce=1513746038205' | openssl dgst -sha256 -hmac "mpEFG56Nc9u5fUFjrg9mWoTEe8uk343X"
# output: 8c640807d23a80b32f52fbb163afaa677fb33d5b0784017cf47074594ff72f16
  1. 在请求中带上X-API-KEY: < your_api_key >以及X-SIGNATURE: < signature >的请求头,signature即是上一步中计算出的签名
curl 'https://developers.viawallet.com/openapi/api/btc/v1/block?hashOrHeight=666666&tonce=1513746038205' -H 'X-API-KEY: BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw' -H 'X-SIGNATURE: 8c640807d23a80b32f52fbb163afaa677fb33d5b0784017cf47074594ff72f16'
Example Request
Example Response
200 OK

# 公共接口

地址监控功能用于及时接收被监控地址的充值/提现(收款/打款)交易成功上链的通知。如果监控的地址,发生了交易,且余额有变化,ViaWallet的后台系统就会通过webhook的方式, 把此交易的相关消息POST到您设置的Webhook URL上。

# POST 设置webhook URL

/{coin}/v1/webhook/url
参数 类型 必须 备注
address string yes 地址
webhook_url string yes 回调的url

设置webhook URL,如果订阅的地址,发生了交易,且余额有变化,ViaWallet的后台系统就会调用您设置的这个URL, 把消息POST过去。您的服务器收到通知后,务必要返回200 OK。

余额变化通知POST的消息为 JSON 文本, 格式如下

{
    "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",                            // 地址hash
    "tx_id":"df244cbc60f4220e5d90de0833b647bd7f376f5132314a1672dd9b5128302659", // 交易hash
    "date": 1612015420,                                                        // 交易发生时间UTC
    "confirmations": 1,                                                        // 通知第一次发出时此交易的确认数
    "value": "-0.002135942",                                                   // 余额变化数量
    "coin": "BTC",                                                             // 交易发生在哪条链上
    "height": 10254665,                                                        // 交易被打包的区块高度
}
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/url' \
--header 'Content-Type: application/json' \
--data-raw '{address=1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj,webhook_url=www.developers.viawallet.com}'
Example Response
200 OK
{
  "code": 0,
  "data": {},
  "message": "OK"
}

# 公共接口

地址监控功能用于及时接收被监控地址的充值/提现(收款/打款)交易成功上链的通知。如果监控的地址,发生了交易,且余额有变化,ViaWallet的后台系统就会通过webhook的方式, 把此交易的相关消息POST到您设置的Webhook URL上。

# POST 设置webhook URL

/{coin}/v1/webhook/url
参数 类型 必须 备注
address string yes 地址
webhook_url string yes 回调的url

设置webhook URL,如果订阅的地址,发生了交易,且余额有变化,ViaWallet的后台系统就会调用您设置的这个URL, 把消息POST过去。您的服务器收到通知后,务必要返回200 OK。

余额变化通知POST的消息为 JSON 文本, 格式如下

{
    "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",                            // 地址hash
    "tx_id":"df244cbc60f4220e5d90de0833b647bd7f376f5132314a1672dd9b5128302659", // 交易hash
    "date": 1612015420,                                                        // 交易发生时间UTC
    "confirmations": 1,                                                        // 通知第一次发出时此交易的确认数
    "value": "-0.002135942",                                                   // 余额变化数量
    "coin": "BTC",                                                             // 交易发生在哪条链上
    "height": 10254665,                                                        // 交易被打包的区块高度
}
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/url' \
--header 'Content-Type: application/json' \
--data-raw '{address=1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj,webhook_url=www.developers.viawallet.com}'
Example Response
200 OK
{
  "code": 0,
  "data": {},
  "message": "OK"
}

# DELETE 删除一个地址的回调URL

/{coin}/v1/webhook/url

删除一个地址的回调,一个地址可以有多个回调的url,可以选择删除其中的某个

参数 类型 必须 备注
address string yes 地址
webhook_url string yes 回调的url
Example Request
curl --location --request DELETE 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/url?address=1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj&webhook_url=www.developers.viawallet.com' \
Example Response
200 OK
{
    "code": 0,
    "data": {},
    "message": "OK"
}

# DELETE 删除一个地址的回调URL

/{coin}/v1/webhook/url

删除一个地址的回调,一个地址可以有多个回调的url,可以选择删除其中的某个

参数 类型 必须 备注
address string yes 地址
webhook_url string yes 回调的url
Example Request
curl --location --request DELETE 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/url?address=1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj&webhook_url=www.developers.viawallet.com' \
Example Response
200 OK
{
    "code": 0,
    "data": {},
    "message": "OK"
}

# POST 增加一个监控地址

/{coin}/v1/webhook/address

增加一个新的订阅地址, 需要指定币种名称,监控的地址以及回调URL。回调的时候,会添加X-SIGNATURE头部,X-SIGNATURE的值会被设置为用secret做的 {webhook_url}?tonce={timestamp} 的HMAC SHA256签名, 此处的webhook_url是监控地址的回调地址,timestamp是单位为毫秒的时间戳。如:

webhook_url: https://developers.viawallet.com
tonce: 1513746038205

echo -n 'https://developers.viawallet.com?tonce=1513746038205' | openssl dgst -sha256 -hmac "mpEFG56Nc9u5fUFjrg9mWoTEe8uk343X"
# output: b9d55b0c5385137611542f8b85178329e5cbec22cb0780f9d9c3ce07f778ba9f

# 添加的头部
X-SIGNATURE: b9d55b0c5385137611542f8b85178329e5cbec22cb0780f9d9c3ce07f778ba9f
参数 类型 必须 备注
secret string yes 回调使用的签名密钥
address string yes 地址
webhook_urls string yes 多个url地址用,隔开
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/address'\
--header 'Content-Type: application/json' \
--data-raw '{
    "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",
    "webhook_urls":"www.viawallet.com,www.coinex.org"
}'
Example Response
200 OK
{
  "code": 0,
  "data": {},
  "message": "OK"
}

# POST 增加一个监控地址

/{coin}/v1/webhook/address

增加一个新的订阅地址, 需要指定币种名称,监控的地址以及回调URL。回调的时候,会添加X-SIGNATURE头部,X-SIGNATURE的值会被设置为用secret做的 {webhook_url}?tonce={timestamp} 的HMAC SHA256签名, 此处的webhook_url是监控地址的回调地址,timestamp是单位为毫秒的时间戳。如:

webhook_url: https://developers.viawallet.com
tonce: 1513746038205

echo -n 'https://developers.viawallet.com?tonce=1513746038205' | openssl dgst -sha256 -hmac "mpEFG56Nc9u5fUFjrg9mWoTEe8uk343X"
# output: b9d55b0c5385137611542f8b85178329e5cbec22cb0780f9d9c3ce07f778ba9f

# 添加的头部
X-SIGNATURE: b9d55b0c5385137611542f8b85178329e5cbec22cb0780f9d9c3ce07f778ba9f
参数 类型 必须 备注
secret string yes 回调使用的签名密钥
address string yes 地址
webhook_urls string yes 多个url地址用,隔开
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/address'\
--header 'Content-Type: application/json' \
--data-raw '{
    "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",
    "webhook_urls":"www.viawallet.com,www.coinex.org"
}'
Example Response
200 OK
{
  "code": 0,
  "data": {},
  "message": "OK"
}

# DELETE 删除一个监控地址

/{coin}/v1/webhook/address
参数 类型 必须 备注
address string yes 待删除的监控地址
Example Request
curl --location --request DELETE 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/address/1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj'
Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": {}
}

# DELETE 删除一个监控地址

/{coin}/v1/webhook/address
参数 类型 必须 备注
address string yes 待删除的监控地址
Example Request
curl --location --request DELETE 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/address/1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj'
Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": {}
}

# GET 查询已经监控的地址列表

/{coin}/v1/webhook/addresses

查询监控地址,需要指定币种名称和页码

参数 类型 必须 备注
page int no 页数
limit int no 返回数量

返回内容格式如下:

{
  "code": 0,
  "message": "OK",
  "data": [
    {
      "address": "1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj", // 监控的地址
      "coin": "BTC",                                   // 币种
      "webhook_urls": [                                // webhook地址列表
          "www.viawallet.com"
      ]
    }
  ]
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/addresses'
Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": [
    {
      "address": "1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",
      "coin": "BTC",
      "webhook_urls": [
          "www.viawallet.com"
      ]
    }
  ]
    
}

# GET 查询已经监控的地址列表

/{coin}/v1/webhook/addresses

查询监控地址,需要指定币种名称和页码

参数 类型 必须 备注
page int no 页数
limit int no 返回数量

返回内容格式如下:

{
  "code": 0,
  "message": "OK",
  "data": [
    {
      "address": "1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj", // 监控的地址
      "coin": "BTC",                                   // 币种
      "webhook_urls": [                                // webhook地址列表
          "www.viawallet.com"
      ]
    }
  ]
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/webhook/addresses'
Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": [
    {
      "address": "1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",
      "coin": "BTC",
      "webhook_urls": [
          "www.viawallet.com"
      ]
    }
  ]
    
}

# GET 查询webhook调用历史

/{coin}/v1/webhook/logs

查询历史需要指定币种名称和页码

参数 类型 必须 备注
page int no 页数
limit int no 返回数量

应答内容格式如下

{
    "date": 1616342401,                             // 日期
    "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj", // 地址
    "coin":"BTC",                                   // 币种
    "webhook_url":"www.viawallet.com",              // 回调地址
    "status_code":0,                                // 回调url返回的状态码
    "error":"error"                                 // 错误信息
}

Example Request
Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": [
    { 
      "date": 1616342401, 
      "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",
      "coin":"BTC",
      "webhook_url":"www.viawallet.com", 
      "status_code":0, 
      "error":"", 
    }
  ]
}

# GET 查询webhook调用历史

/{coin}/v1/webhook/logs

查询历史需要指定币种名称和页码

参数 类型 必须 备注
page int no 页数
limit int no 返回数量

应答内容格式如下

{
    "date": 1616342401,                             // 日期
    "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj", // 地址
    "coin":"BTC",                                   // 币种
    "webhook_url":"www.viawallet.com",              // 回调地址
    "status_code":0,                                // 回调url返回的状态码
    "error":"error"                                 // 错误信息
}

Example Request
Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": [
    { 
      "date": 1616342401, 
      "address":"1EaSi5xycF5Ufpy2uSvCbjtSfnVPgeCiaj",
      "coin":"BTC",
      "webhook_url":"www.viawallet.com", 
      "status_code":0, 
      "error":"", 
    }
  ]
}

# BTC及其类似币种

# GET 查询公链基本信息

/{coin}/v1/chain/info

通过公链简称,获得公链基本信息包括:区块高度、交易数量、原生代币流通量、网络大小等 应答内容格式如下:

{
    "symbol": "BTC",                                                            // 代币符号
    "name": "Bitcoin",                                                          // 代币全称
    "decimals": 8,                                                              // 精度
    "block_time": 600000,                                                       // 区块时间
    "sample_address": "bc1quvuarfksewfeuevuc6tn0kfyptgjvwsvrprk9d",             // 示例地址
    "height": 675870,                                                           // 当前区块块高
    "hash": "0000000000000000000cd537a29662f9003844d40cd7fbd6bd34e04b5adb354f", // 当前区块哈希 可能不会返回当前字段
    "size": 70390928311,                                                        // 链的大小 可能不会返回当前字段
    "tota_txs": 29045598,                                                       // 交易总量 可能不会返回当前字段
    "circulation":16923962                                                      // 网络流通量 可能不会返回当前字段
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/chain/info'
Example Response
200 OK
{

  "code": 0,
  "message": "OK",
  "data": {
    "id": 0,
    "symbol": "BTC",
    "name": "Bitcoin",
    "decimals": 8,
    "block_time": 600000,
    "sample_address": "bc1quvuarfksewfeuevuc6tn0kfyptgjvwsvrprk9d",
    "height": 675870,
    "hash": "0000000000000000000cd537a29662f9003844d40cd7fbd6bd34e04b5adb354f",
    "size": 70390928311,
    "tota_txs": 29045598
  }
}

# BTC及其类似币种

# GET 查询公链基本信息

/{coin}/v1/chain/info

通过公链简称,获得公链基本信息包括:区块高度、交易数量、原生代币流通量、网络大小等 应答内容格式如下:

{
    "symbol": "BTC",                                                            // 代币符号
    "name": "Bitcoin",                                                          // 代币全称
    "decimals": 8,                                                              // 精度
    "block_time": 600000,                                                       // 区块时间
    "sample_address": "bc1quvuarfksewfeuevuc6tn0kfyptgjvwsvrprk9d",             // 示例地址
    "height": 675870,                                                           // 当前区块块高
    "hash": "0000000000000000000cd537a29662f9003844d40cd7fbd6bd34e04b5adb354f", // 当前区块哈希 可能不会返回当前字段
    "size": 70390928311,                                                        // 链的大小 可能不会返回当前字段
    "tota_txs": 29045598,                                                       // 交易总量 可能不会返回当前字段
    "circulation":16923962                                                      // 网络流通量 可能不会返回当前字段
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/chain/info'
Example Response
200 OK
{

  "code": 0,
  "message": "OK",
  "data": {
    "id": 0,
    "symbol": "BTC",
    "name": "Bitcoin",
    "decimals": 8,
    "block_time": 600000,
    "sample_address": "bc1quvuarfksewfeuevuc6tn0kfyptgjvwsvrprk9d",
    "height": 675870,
    "hash": "0000000000000000000cd537a29662f9003844d40cd7fbd6bd34e04b5adb354f",
    "size": 70390928311,
    "tota_txs": 29045598
  }
}

# GET 获取区块信息

/{coin}/v1/block

根据块高或者hash获取区块信息

参数 类型 必须 备注
hashOrHeight string no 区块哈希或者区块高度

返回的内容格式如下:

{
    "version": "549453824",                                                            // 版本 为空的时候不会返回当前字段
    "hash": "000000000000000000068bcb8f679a0783d3fb575ce34a968b14cbaf4744db59",        // 当前块高的hash
    "merkle_root": "5a4d3d153156039a027fc2390a29de4b052ca89bc01dbb1adaab4da9340404cc", // 默克尔根
    "confirmations": 1,                                                                // 确认数
    "stripped_size": 555212,
    "size": 2327663,                                                                   // 当前区块大小
    "date": 1616467429,                                                                // 时间戳
    "nonce": 2854784024, 
    "bits ": 386719599,
    "txs":[
        "ddb91aeb7e7d0f7a45da6bd5d31eac569f1104795d0d1d45801b212a9e4bb9b1",            // 交易的hash
    ]
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/block?hashOrHeight=000000000000000000068bcb8f679a0783d3fb575ce34a968b14cbaf4744db59'

Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": {
    "version": "549453824",
    "hash": "000000000000000000068bcb8f679a0783d3fb575ce34a968b14cbaf4744db59", 
    "merkle_root": "5a4d3d153156039a027fc2390a29de4b052ca89bc01dbb1adaab4da9340404cc", 
    "confirmations": 1,
    "stripped_size": 555212, 
    "size": 2327663, 
    "date": 1616467429, 
    "nonce": 2854784024, 
    "bits ": 386719599, 
    "txs":[
        "ddb91aeb7e7d0f7a45da6bd5d31eac569f1104795d0d1d45801b212a9e4bb9b1", 
    ],   
  }
}

# GET 获取区块信息

/{coin}/v1/block

根据块高或者hash获取区块信息

参数 类型 必须 备注
hashOrHeight string no 区块哈希或者区块高度

返回的内容格式如下:

{
    "version": "549453824",                                                            // 版本 为空的时候不会返回当前字段
    "hash": "000000000000000000068bcb8f679a0783d3fb575ce34a968b14cbaf4744db59",        // 当前块高的hash
    "merkle_root": "5a4d3d153156039a027fc2390a29de4b052ca89bc01dbb1adaab4da9340404cc", // 默克尔根
    "confirmations": 1,                                                                // 确认数
    "stripped_size": 555212,
    "size": 2327663,                                                                   // 当前区块大小
    "date": 1616467429,                                                                // 时间戳
    "nonce": 2854784024, 
    "bits ": 386719599,
    "txs":[
        "ddb91aeb7e7d0f7a45da6bd5d31eac569f1104795d0d1d45801b212a9e4bb9b1",            // 交易的hash
    ]
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/block?hashOrHeight=000000000000000000068bcb8f679a0783d3fb575ce34a968b14cbaf4744db59'

Example Response
200 OK
{
  "code": 0,
  "message": "OK",
  "data": {
    "version": "549453824",
    "hash": "000000000000000000068bcb8f679a0783d3fb575ce34a968b14cbaf4744db59", 
    "merkle_root": "5a4d3d153156039a027fc2390a29de4b052ca89bc01dbb1adaab4da9340404cc", 
    "confirmations": 1,
    "stripped_size": 555212, 
    "size": 2327663, 
    "date": 1616467429, 
    "nonce": 2854784024, 
    "bits ": 386719599, 
    "txs":[
        "ddb91aeb7e7d0f7a45da6bd5d31eac569f1104795d0d1d45801b212a9e4bb9b1", 
    ],   
  }
}

# GET 获取地址的详细信息

/{coin}/v1/address/info

通过公链简称和地址,获得该地址信息,包括:余额,余额排名,交易次数,转出数量,收入数量,以及最近一笔交易详情

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:

{
    "address": "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2",                                // 地址
    "balance": 9973,                                                                // 地址余额 需要除以币种的精度
    "balance_rank": 9758350,                                                        // 地址余额全网排名
    "total_txs": 27,                                                                // 总交易数
    "total_tx_in": "15484598",                                                      // 总的入账金额 需要除以币种的精度
    "total_tx_out": "15474625",                                                     // 总的出账金额 需要除以币种的精度
    "latest_tx":{ 
          "id": "992b8c0b21b2df1fadee7977ef88cb311a307cd39d2ece3851d9a3e810167894", // 交易id
          "fee": "3008",                                                            // 手续费 需要除以币种的精度
          "date": 1616367320,                                                       // 时间戳 精确到秒
          "block": 675691,                                                          // 块高
          "confirmation": 182,                                                      // 确认数
          "status": "completed",                                                    // 交易状态
          "inputs": [
            {
                "addresses": [
                    "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2"                            // input 地址
                ],
                "tx": "f18b8e446b0270e57c0a1def0c7dc84d40aee9beaedb9482204b7f870397cabb", // input 交易哈希
                "script_sig": "483045022100c5aab529b01b16a772f911f2b402173245d8b5ad0ac7db82b16f394567db387302205a4ee767d726037449710a7cb0d42ed3294570466c256f0221e7bc8f62d8d06601210264d52cd6e3019188ae97178384a6c6c15d9ca25c019ad1ccbd5e5f72304c48b3",
                "type": "pubkeyhash",
                "value": 40700,                                                     // 金额
                "vfp": 0,                                                           // 上一笔交易所处output的index
                "sequence": 4294967295
            },
            {
                "addresses": [
                   "1AQ1J6KJfM4AMjE33d2mZVyVnXoin1HpDM"
                 ],
                "tx": "fec9bcbdf5637b89424885dd219e51d50bde6ab73b508043e3037106f03cd0f8",
                "script_sig": "47304402203b2bea0ebfc925ae515cf48ac19bf750c0e9f313c3faf07b7efde8ae56d79838022020fe4eaa9c71ab962c13eab49107956e64dfc7ca07da6823d0b33f42b315dd4b0121032c791c9cecbe143c582f908396bf414775ce8c698ea5eb8d61ff1e8dfc652949",
                "type": "pubkeyhash",
                "value": 346572,
                "vfp": 0,
                "sequence": 4294967295
            }
          ],
            "outputs": [
                {
                    "addresses": [
                        "1H3YKH5EX6E7iMRoPZxuHwRPJnRSwGPnC"
                    ],
                    "script": "76a9140308c68df6134b45459f1384286b1137d32f8f1988ac",
                    "type": "pubkeyhash",
                    "value": 36132,
                    "n": 0,                                                         // ouput index
                    "next_position": 0,                                             // 被花费的交易里面所在的index
                    "ntx":"",                                                       // 在哪一笔交易哈希里面被花费
                },
                {
                    "addresses": [
                        "1KPW6tY3RovXNak2zAme4JCdcVunh6DLEL"
                    ],
                    "script": "76a914c9b3b53f60d100c362593bf86c89ac0ec8cdf5d688ac",
                    "type": "pubkeyhash",
                    "value": 348132,
                    "n": 1,
                    "next_position": 0,
                    "ntx":""
                }
            ],
            "memo": "",
            "metadata": null
        } 
    } // 最近一笔交易,字段详细解释见 《根据块高/hash获取区块信息》
}
Example Request
curl --localtion --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/address/info?address=1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "address": "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2",
        "balance": 9973,
        "balance_rank": 9758350,
        "total_txs": 27,
        "total_tx_in": "15484598",
        "total_tx_out": "15474625",
        "latest_tx": {
            "id": "992b8c0b21b2df1fadee7977ef88cb311a307cd39d2ece3851d9a3e810167894",
            "fee": "3008",
            "date": 1616367320,
            "block": 675691,
            "confirmation": 182,
            "status": "completed",
            "inputs": [
                {
                    "addresses": [
                        "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2"
                    ],
                    "tx": "f18b8e446b0270e57c0a1def0c7dc84d40aee9beaedb9482204b7f870397cabb",
                    "script_sig": "483045022100c5aab529b01b16a772f911f2b402173245d8b5ad0ac7db82b16f394567db387302205a4ee767d726037449710a7cb0d42ed3294570466c256f0221e7bc8f62d8d06601210264d52cd6e3019188ae97178384a6c6c15d9ca25c019ad1ccbd5e5f72304c48b3",
                    "type": "pubkeyhash",
                    "value": 40700,
                    "vfp": 0,
                    "sequence": 4294967295
                },
                {
                    "addresses": [
                        "1AQ1J6KJfM4AMjE33d2mZVyVnXoin1HpDM"
                    ],
                    "tx": "fec9bcbdf5637b89424885dd219e51d50bde6ab73b508043e3037106f03cd0f8",
                    "script_sig": "47304402203b2bea0ebfc925ae515cf48ac19bf750c0e9f313c3faf07b7efde8ae56d79838022020fe4eaa9c71ab962c13eab49107956e64dfc7ca07da6823d0b33f42b315dd4b0121032c791c9cecbe143c582f908396bf414775ce8c698ea5eb8d61ff1e8dfc652949",
                    "type": "pubkeyhash",
                    "value": 346572,
                    "vfp": 0,
                    "sequence": 4294967295
                }
            ],
            "outputs": [
                {
                    "addresses": [
                        "1H3YKH5EX6E7iMRoPZxuHwRPJnRSwGPnC"
                    ],
                    "script": "76a9140308c68df6134b45459f1384286b1137d32f8f1988ac",
                    "type": "pubkeyhash",
                    "value": 36132,
                    "n": 0,
                    "next_position": 0,
                },
                {
                    "addresses": [
                        "1KPW6tY3RovXNak2zAme4JCdcVunh6DLEL"
                    ],
                    "script": "76a914c9b3b53f60d100c362593bf86c89ac0ec8cdf5d688ac",
                    "type": "pubkeyhash",
                    "value": 348132,
                    "n": 1,
                    "next_position": 0,
                }
            ],
            "memo": "",
            "metadata": null
        }
    },
    "message": "OK"
}

# GET 获取地址的详细信息

/{coin}/v1/address/info

通过公链简称和地址,获得该地址信息,包括:余额,余额排名,交易次数,转出数量,收入数量,以及最近一笔交易详情

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:

{
    "address": "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2",                                // 地址
    "balance": 9973,                                                                // 地址余额 需要除以币种的精度
    "balance_rank": 9758350,                                                        // 地址余额全网排名
    "total_txs": 27,                                                                // 总交易数
    "total_tx_in": "15484598",                                                      // 总的入账金额 需要除以币种的精度
    "total_tx_out": "15474625",                                                     // 总的出账金额 需要除以币种的精度
    "latest_tx":{ 
          "id": "992b8c0b21b2df1fadee7977ef88cb311a307cd39d2ece3851d9a3e810167894", // 交易id
          "fee": "3008",                                                            // 手续费 需要除以币种的精度
          "date": 1616367320,                                                       // 时间戳 精确到秒
          "block": 675691,                                                          // 块高
          "confirmation": 182,                                                      // 确认数
          "status": "completed",                                                    // 交易状态
          "inputs": [
            {
                "addresses": [
                    "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2"                            // input 地址
                ],
                "tx": "f18b8e446b0270e57c0a1def0c7dc84d40aee9beaedb9482204b7f870397cabb", // input 交易哈希
                "script_sig": "483045022100c5aab529b01b16a772f911f2b402173245d8b5ad0ac7db82b16f394567db387302205a4ee767d726037449710a7cb0d42ed3294570466c256f0221e7bc8f62d8d06601210264d52cd6e3019188ae97178384a6c6c15d9ca25c019ad1ccbd5e5f72304c48b3",
                "type": "pubkeyhash",
                "value": 40700,                                                     // 金额
                "vfp": 0,                                                           // 上一笔交易所处output的index
                "sequence": 4294967295
            },
            {
                "addresses": [
                   "1AQ1J6KJfM4AMjE33d2mZVyVnXoin1HpDM"
                 ],
                "tx": "fec9bcbdf5637b89424885dd219e51d50bde6ab73b508043e3037106f03cd0f8",
                "script_sig": "47304402203b2bea0ebfc925ae515cf48ac19bf750c0e9f313c3faf07b7efde8ae56d79838022020fe4eaa9c71ab962c13eab49107956e64dfc7ca07da6823d0b33f42b315dd4b0121032c791c9cecbe143c582f908396bf414775ce8c698ea5eb8d61ff1e8dfc652949",
                "type": "pubkeyhash",
                "value": 346572,
                "vfp": 0,
                "sequence": 4294967295
            }
          ],
            "outputs": [
                {
                    "addresses": [
                        "1H3YKH5EX6E7iMRoPZxuHwRPJnRSwGPnC"
                    ],
                    "script": "76a9140308c68df6134b45459f1384286b1137d32f8f1988ac",
                    "type": "pubkeyhash",
                    "value": 36132,
                    "n": 0,                                                         // ouput index
                    "next_position": 0,                                             // 被花费的交易里面所在的index
                    "ntx":"",                                                       // 在哪一笔交易哈希里面被花费
                },
                {
                    "addresses": [
                        "1KPW6tY3RovXNak2zAme4JCdcVunh6DLEL"
                    ],
                    "script": "76a914c9b3b53f60d100c362593bf86c89ac0ec8cdf5d688ac",
                    "type": "pubkeyhash",
                    "value": 348132,
                    "n": 1,
                    "next_position": 0,
                    "ntx":""
                }
            ],
            "memo": "",
            "metadata": null
        } 
    } // 最近一笔交易,字段详细解释见 《根据块高/hash获取区块信息》
}
Example Request
curl --localtion --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/address/info?address=1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "address": "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2",
        "balance": 9973,
        "balance_rank": 9758350,
        "total_txs": 27,
        "total_tx_in": "15484598",
        "total_tx_out": "15474625",
        "latest_tx": {
            "id": "992b8c0b21b2df1fadee7977ef88cb311a307cd39d2ece3851d9a3e810167894",
            "fee": "3008",
            "date": 1616367320,
            "block": 675691,
            "confirmation": 182,
            "status": "completed",
            "inputs": [
                {
                    "addresses": [
                        "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2"
                    ],
                    "tx": "f18b8e446b0270e57c0a1def0c7dc84d40aee9beaedb9482204b7f870397cabb",
                    "script_sig": "483045022100c5aab529b01b16a772f911f2b402173245d8b5ad0ac7db82b16f394567db387302205a4ee767d726037449710a7cb0d42ed3294570466c256f0221e7bc8f62d8d06601210264d52cd6e3019188ae97178384a6c6c15d9ca25c019ad1ccbd5e5f72304c48b3",
                    "type": "pubkeyhash",
                    "value": 40700,
                    "vfp": 0,
                    "sequence": 4294967295
                },
                {
                    "addresses": [
                        "1AQ1J6KJfM4AMjE33d2mZVyVnXoin1HpDM"
                    ],
                    "tx": "fec9bcbdf5637b89424885dd219e51d50bde6ab73b508043e3037106f03cd0f8",
                    "script_sig": "47304402203b2bea0ebfc925ae515cf48ac19bf750c0e9f313c3faf07b7efde8ae56d79838022020fe4eaa9c71ab962c13eab49107956e64dfc7ca07da6823d0b33f42b315dd4b0121032c791c9cecbe143c582f908396bf414775ce8c698ea5eb8d61ff1e8dfc652949",
                    "type": "pubkeyhash",
                    "value": 346572,
                    "vfp": 0,
                    "sequence": 4294967295
                }
            ],
            "outputs": [
                {
                    "addresses": [
                        "1H3YKH5EX6E7iMRoPZxuHwRPJnRSwGPnC"
                    ],
                    "script": "76a9140308c68df6134b45459f1384286b1137d32f8f1988ac",
                    "type": "pubkeyhash",
                    "value": 36132,
                    "n": 0,
                    "next_position": 0,
                },
                {
                    "addresses": [
                        "1KPW6tY3RovXNak2zAme4JCdcVunh6DLEL"
                    ],
                    "script": "76a914c9b3b53f60d100c362593bf86c89ac0ec8cdf5d688ac",
                    "type": "pubkeyhash",
                    "value": 348132,
                    "n": 1,
                    "next_position": 0,
                }
            ],
            "memo": "",
            "metadata": null
        }
    },
    "message": "OK"
}

# GET 获取地址UTXO列表

/{coin}/v1/utxo

通过公链简称和地址,获得该地址的未花费UTXO列表,通常用于离线交易签名

参数 类型 必须 备注
address string yes 待查询的地址
nextkey string no 查询游标

返回内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",                        // 地址
                "tx_id": "1733c83851565e7e0a2af7db43708f76a628d9e9efc5928fe0e91c93f82cb785",    // 交易哈希
                "height": 677958,                                                               // 块高
                "value": 649552102,                                                             // utxo 余额
                "position": 0,                                                                  // utxo 在交易中的位置
                "script": "00143156afc4249915008020f932783319f3e610b97d",                       // 脚本值
                "date": 1617675530                                                              // 日期
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/utxo?address=18Zcyxqna6h7Z7bRjhKvGpr8HSfieQWXqj'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",
                "tx_id": "1733c83851565e7e0a2af7db43708f76a628d9e9efc5928fe0e91c93f82cb785",
                "height": 677958,
                "value": 649552102,
                "position": 0,
                "script": "00143156afc4249915008020f932783319f3e610b97d",
                "date": 1617675530
            },
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",
                "tx_id": "e31ff7aab365cd24c351da1d4d427e5389b65c8357325af02c56372fbc3ae582",
                "height": 677952,
                "value": 667970893,
                "position": 0,
                "script": "00143156afc4249915008020f932783319f3e610b97d",
                "date": 1617672757
            },
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",
                "tx_id": "772c7d70f49c0f481bdc27fe37f085093075b2b8f5e48933e2153e0fe3146400",
                "height": 677931,
                "value": 713368079,
                "position": 0,
                "script": "00143156afc4249915008020f932783319f3e610b97d",
                "date": 1617659888
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取地址UTXO列表

/{coin}/v1/utxo

通过公链简称和地址,获得该地址的未花费UTXO列表,通常用于离线交易签名

参数 类型 必须 备注
address string yes 待查询的地址
nextkey string no 查询游标

返回内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",                        // 地址
                "tx_id": "1733c83851565e7e0a2af7db43708f76a628d9e9efc5928fe0e91c93f82cb785",    // 交易哈希
                "height": 677958,                                                               // 块高
                "value": 649552102,                                                             // utxo 余额
                "position": 0,                                                                  // utxo 在交易中的位置
                "script": "00143156afc4249915008020f932783319f3e610b97d",                       // 脚本值
                "date": 1617675530                                                              // 日期
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/utxo?address=18Zcyxqna6h7Z7bRjhKvGpr8HSfieQWXqj'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",
                "tx_id": "1733c83851565e7e0a2af7db43708f76a628d9e9efc5928fe0e91c93f82cb785",
                "height": 677958,
                "value": 649552102,
                "position": 0,
                "script": "00143156afc4249915008020f932783319f3e610b97d",
                "date": 1617675530
            },
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",
                "tx_id": "e31ff7aab365cd24c351da1d4d427e5389b65c8357325af02c56372fbc3ae582",
                "height": 677952,
                "value": 667970893,
                "position": 0,
                "script": "00143156afc4249915008020f932783319f3e610b97d",
                "date": 1617672757
            },
            {
                "address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",
                "tx_id": "772c7d70f49c0f481bdc27fe37f085093075b2b8f5e48933e2153e0fe3146400",
                "height": 677931,
                "value": 713368079,
                "position": 0,
                "script": "00143156afc4249915008020f932783319f3e610b97d",
                "date": 1617659888
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取地址的交易列表

/{coin}/v1/address/txs

通过公链简称和地址,获得该地址的交易历史列表

参数 类型 必须 备注
address string yes 待查询的地址
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",  // 交易哈希
                "fee": "-313828",                                                          // 手续费
                "date": 1617109308,                                                        // 日期
                "block": 676997,                                                           // 块高
                "confirmation": 966,                                                       // 确认数
                "status": "completed",                                                     // 交易状态
                "inputs": [                                                                // 交易 inputs
                    {
                        "addresses": [                                                     // 地址列表
                            "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                        ],
                        "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710", // input 所属交易的哈希
                        "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",                                                       // 签名
                        "type": "pubkeyhash",
                        "value": 347238,                                                    // 数额
                        "vfp": 1,
                        "sequence": 4294967295
                    },
                    {
                        "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                        "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                        "value": 0,
                        "vfp": 0,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [                                                                // 交易 outputs
                    {
                        "addresses": [
                            "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                        ],
                        "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                        "value": 307895,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "addresses": [
                            "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                        ],
                        "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                        "value": 353171,
                        "n": 1,
                        "next_position": 3
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "B1jgkPtsA1FQR21eYU",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/txs?address=1DfDKUMzSxJD8dontsxTvXVUUBZrQ24ZfA'

Example Response
200 OK

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",
                "fee": "-313828",
                "date": 1617109308,
                "block": 676997,
                "confirmation": 966,
                "status": "completed",
                "inputs": [
                    {
                        "addresses": [
                            "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                        ],
                        "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710",
                        "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",
                        "type": "pubkeyhash",
                        "value": 347238,
                        "vfp": 1,
                        "sequence": 4294967295
                    },
                    {
                        "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                        "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                        "value": 0,
                        "vfp": 0,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [
                    {
                        "addresses": [
                            "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                        ],
                        "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                        "value": 307895,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "addresses": [
                            "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                        ],
                        "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                        "value": 353171,
                        "n": 1,
                        "next_position": 3
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "B1jgkPtsA1FQR21eYU",
    },
    "message": "OK"
}

# GET 获取地址的交易列表

/{coin}/v1/address/txs

通过公链简称和地址,获得该地址的交易历史列表

参数 类型 必须 备注
address string yes 待查询的地址
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",  // 交易哈希
                "fee": "-313828",                                                          // 手续费
                "date": 1617109308,                                                        // 日期
                "block": 676997,                                                           // 块高
                "confirmation": 966,                                                       // 确认数
                "status": "completed",                                                     // 交易状态
                "inputs": [                                                                // 交易 inputs
                    {
                        "addresses": [                                                     // 地址列表
                            "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                        ],
                        "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710", // input 所属交易的哈希
                        "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",                                                       // 签名
                        "type": "pubkeyhash",
                        "value": 347238,                                                    // 数额
                        "vfp": 1,
                        "sequence": 4294967295
                    },
                    {
                        "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                        "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                        "value": 0,
                        "vfp": 0,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [                                                                // 交易 outputs
                    {
                        "addresses": [
                            "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                        ],
                        "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                        "value": 307895,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "addresses": [
                            "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                        ],
                        "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                        "value": 353171,
                        "n": 1,
                        "next_position": 3
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "B1jgkPtsA1FQR21eYU",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/txs?address=1DfDKUMzSxJD8dontsxTvXVUUBZrQ24ZfA'

Example Response
200 OK

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",
                "fee": "-313828",
                "date": 1617109308,
                "block": 676997,
                "confirmation": 966,
                "status": "completed",
                "inputs": [
                    {
                        "addresses": [
                            "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                        ],
                        "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710",
                        "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",
                        "type": "pubkeyhash",
                        "value": 347238,
                        "vfp": 1,
                        "sequence": 4294967295
                    },
                    {
                        "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                        "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                        "value": 0,
                        "vfp": 0,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [
                    {
                        "addresses": [
                            "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                        ],
                        "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                        "value": 307895,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "addresses": [
                            "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                        ],
                        "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                        "value": 353171,
                        "n": 1,
                        "next_position": 3
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "B1jgkPtsA1FQR21eYU",
    },
    "message": "OK"
}

# GET 获取待确认交易列表

/{coin}/v1/unconfirmed_txs

通过公链简称,获得该地址待确认交易列表

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:

   "code":0,
    "message":"OK",
    "data": [
        {
            "id": "fce47bbec9029369b511a1474f92c22f3c1687e8df763f1798ab9fdcf519b278",           // 交易哈希
            "fee": "2270",                                                                      // 手续费
            "date": 1616479878,                                                                 // 日期
            "block": 0,
            "confirmation": 0,
            "status": "pending",                                                                // 交易状态
            "inputs": [                                                                         // 交易 inputs
                {
                    "addresses": [
                        "1DTt8RuAbebwuSTpYPAwixShvT6oeck7We"
                    ],
                    "tx": "06208f276801896b42acb1567de9466ebc1ed33650120870d0b04462029d1197",   // input 所属交易的哈希
                    "script_sig": "483045022100b08f642ad75694212911503e51ae95b0e912e4cbb0f5d59ea6bcaecb0b425f520220139bdd50a9f4343faf96b84658a86c32958ab8414ef76ae70a0d38159dbe27a0012103e73051c6b5293f220d033758adfa238d3328e67b79ca5c382060471d8d3b7043", // 签名
                    "type": "pubkeyhash",
                    "value": 983021,                                                            // 数额
                    "vfp": 74,
                    "sequence": 4294967295
                }
            ],
            "outputs": [                                                                        // 交易 outputs
                {
                    "addresses": [
                        "3DNtQzBExZgvo4w2iVuZNPsoQ5PXi4dfuy"
                    ],
                    "script": "a9148033c0de297577714c4883ba6f556ffe8b87c43d87",
                    "type": "scripthash",
                    "value": 14984,
                    "n": 0,
                    "next_position": 0,
                },
                {
                    "addresses": [
                        "1NQz4aMBujoua7t7yDcfcWXHFKNBxesxks"
                    ],
                    "script": "76a914eae3d75b47e6d1043daebe2d3b04bddb67fcb68f88ac",
                    "type": "pubkeyhash",
                    "value": 965767,
                    "n": 1,
                    "next_position": 0,
                }
            ],
            "memo": "",
            "metadata": null
        }
    ]
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/unconfirmed_txs/bc1qrg6paunl8vwcddejwqzeddfmckycytq2uqxx20'

Example Response
200 OK
{
    "code":0,
    "message":"OK",
    "data": [
        {
            "id": "fce47bbec9029369b511a1474f92c22f3c1687e8df763f1798ab9fdcf519b278",
            "fee": "2270",
            "date": 1616479878,
            "block": 0,
            "confirmation": 0,
            "status": "pending",
            "inputs": [
                {
                    "addresses": [
                        "1DTt8RuAbebwuSTpYPAwixShvT6oeck7We"
                    ],
                    "tx": "06208f276801896b42acb1567de9466ebc1ed33650120870d0b04462029d1197",
                    "script_sig": "483045022100b08f642ad75694212911503e51ae95b0e912e4cbb0f5d59ea6bcaecb0b425f520220139bdd50a9f4343faf96b84658a86c32958ab8414ef76ae70a0d38159dbe27a0012103e73051c6b5293f220d033758adfa238d3328e67b79ca5c382060471d8d3b7043",
                    "type": "pubkeyhash",
                    "value": 983021,
                    "vfp": 74,
                    "sequence": 4294967295
                }
            ],
            "outputs": [
                {
                    "addresses": [
                        "3DNtQzBExZgvo4w2iVuZNPsoQ5PXi4dfuy"
                    ],
                    "script": "a9148033c0de297577714c4883ba6f556ffe8b87c43d87",
                    "type": "scripthash",
                    "value": 14984,
                    "n": 0,
                    "next_position": 0,
                },
                {
                    "addresses": [
                        "1NQz4aMBujoua7t7yDcfcWXHFKNBxesxks"
                    ],
                    "script": "76a914eae3d75b47e6d1043daebe2d3b04bddb67fcb68f88ac",
                    "type": "pubkeyhash",
                    "value": 965767,
                    "n": 1,
                    "next_position": 0,
                }
            ],
            "memo": "",
            "metadata": null
        }
    ]
}

# GET 获取待确认交易列表

/{coin}/v1/unconfirmed_txs

通过公链简称,获得该地址待确认交易列表

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:

   "code":0,
    "message":"OK",
    "data": [
        {
            "id": "fce47bbec9029369b511a1474f92c22f3c1687e8df763f1798ab9fdcf519b278",           // 交易哈希
            "fee": "2270",                                                                      // 手续费
            "date": 1616479878,                                                                 // 日期
            "block": 0,
            "confirmation": 0,
            "status": "pending",                                                                // 交易状态
            "inputs": [                                                                         // 交易 inputs
                {
                    "addresses": [
                        "1DTt8RuAbebwuSTpYPAwixShvT6oeck7We"
                    ],
                    "tx": "06208f276801896b42acb1567de9466ebc1ed33650120870d0b04462029d1197",   // input 所属交易的哈希
                    "script_sig": "483045022100b08f642ad75694212911503e51ae95b0e912e4cbb0f5d59ea6bcaecb0b425f520220139bdd50a9f4343faf96b84658a86c32958ab8414ef76ae70a0d38159dbe27a0012103e73051c6b5293f220d033758adfa238d3328e67b79ca5c382060471d8d3b7043", // 签名
                    "type": "pubkeyhash",
                    "value": 983021,                                                            // 数额
                    "vfp": 74,
                    "sequence": 4294967295
                }
            ],
            "outputs": [                                                                        // 交易 outputs
                {
                    "addresses": [
                        "3DNtQzBExZgvo4w2iVuZNPsoQ5PXi4dfuy"
                    ],
                    "script": "a9148033c0de297577714c4883ba6f556ffe8b87c43d87",
                    "type": "scripthash",
                    "value": 14984,
                    "n": 0,
                    "next_position": 0,
                },
                {
                    "addresses": [
                        "1NQz4aMBujoua7t7yDcfcWXHFKNBxesxks"
                    ],
                    "script": "76a914eae3d75b47e6d1043daebe2d3b04bddb67fcb68f88ac",
                    "type": "pubkeyhash",
                    "value": 965767,
                    "n": 1,
                    "next_position": 0,
                }
            ],
            "memo": "",
            "metadata": null
        }
    ]
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/unconfirmed_txs/bc1qrg6paunl8vwcddejwqzeddfmckycytq2uqxx20'

Example Response
200 OK
{
    "code":0,
    "message":"OK",
    "data": [
        {
            "id": "fce47bbec9029369b511a1474f92c22f3c1687e8df763f1798ab9fdcf519b278",
            "fee": "2270",
            "date": 1616479878,
            "block": 0,
            "confirmation": 0,
            "status": "pending",
            "inputs": [
                {
                    "addresses": [
                        "1DTt8RuAbebwuSTpYPAwixShvT6oeck7We"
                    ],
                    "tx": "06208f276801896b42acb1567de9466ebc1ed33650120870d0b04462029d1197",
                    "script_sig": "483045022100b08f642ad75694212911503e51ae95b0e912e4cbb0f5d59ea6bcaecb0b425f520220139bdd50a9f4343faf96b84658a86c32958ab8414ef76ae70a0d38159dbe27a0012103e73051c6b5293f220d033758adfa238d3328e67b79ca5c382060471d8d3b7043",
                    "type": "pubkeyhash",
                    "value": 983021,
                    "vfp": 74,
                    "sequence": 4294967295
                }
            ],
            "outputs": [
                {
                    "addresses": [
                        "3DNtQzBExZgvo4w2iVuZNPsoQ5PXi4dfuy"
                    ],
                    "script": "a9148033c0de297577714c4883ba6f556ffe8b87c43d87",
                    "type": "scripthash",
                    "value": 14984,
                    "n": 0,
                    "next_position": 0,
                },
                {
                    "addresses": [
                        "1NQz4aMBujoua7t7yDcfcWXHFKNBxesxks"
                    ],
                    "script": "76a914eae3d75b47e6d1043daebe2d3b04bddb67fcb68f88ac",
                    "type": "pubkeyhash",
                    "value": 965767,
                    "n": 1,
                    "next_position": 0,
                }
            ],
            "memo": "",
            "metadata": null
        }
    ]
}

# GET 单笔交易的交易详情

/{coin}/v1/tx

通过公链简称和交易hash获取到交易的详情

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",  // 交易哈希
        "fee": "-313828",                                                          // 手续费
        "date": 1617109308,                                                        // 日期
        "block": 676997,                                                           // 块高
        "confirmation": 966,                                                       // 确认数
        "status": "completed",                                                     // 交易状态
        "inputs": [                                                                // 交易 inputs
            {
                "addresses": [                                                     // 地址列表
                    "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                ],
                "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710", // input 所属交易的哈希
                "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",                                                       // 签名
                "type": "pubkeyhash",
                "value": 347238,                                                    // 数额
                "vfp": 1,
                "sequence": 4294967295
            },
            {
                "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                "value": 0,
                "vfp": 0,
                "sequence": 4294967295
            }
        ],
        "outputs": [                                                                // 交易 outputs
            {
                "addresses": [
                    "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                ],
                "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                "type": "pubkeyhash",
                "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                "value": 307895,
                "n": 0,
                "next_position": 0
            },
            {
                "addresses": [
                    "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                ],
                "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                "type": "pubkeyhash",
                "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                "value": 353171,
                "n": 1,
                "next_position": 3
            }
        ],
        "memo": "",
        "metadata": null
    },
    "message": "OK"
}


Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/tx?tx_id=5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710'

Example Response
200 OK
{
    "code":0,
    "message":"OK",
    "data": {
        "id": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710",
        "fee": "17706",
        "date": 1616171114,
        "block": 675336,
        "confirmation": 554,
        "status": "completed",
        "inputs": [
            {
                "addresses": [
                    "178monFk9M49PyVi2PmP1Whce8VyvdRZ9T"
                ],
                "tx": "1e67b7c8368edc33c2db3d93716054259eb019fd0cacf4728235e52e8de326ef",
                "script_sig": "4830450221009faabcc6f33a24b42a4181ea73f5a20044a0d339ee5bd928d06eb7b8f1b1eca80220321a8823d91503af497656fbdf87dde5d4781b8ddf545135527aa373d2f3dff70121025ff937e5b23ba3102662990da6dff055514d19f59aba93aaa54aed5eb9674a21",
                "type": "pubkeyhash",
                "value": 379913,
                "vfp": 1,
                "sequence": 4294967295
            }
        ],
        "outputs": [
            {
                "addresses": [
                    "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2"
                ],
                "script": "76a914b10ba0d4d038c11c50e704ab145302f6c984afe688ac",
                "type": "pubkeyhash",
                "next_tx_id": "aef8039dbead733bf5f58c9ea37de771157dab24f76348cb4da675938c640506",
                "value": 14969,
                "n": 0,
                "next_position": 0,
            },
            {
                "addresses": [
                    "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                ],
                "script": "76a914200104085600bedcaad07ef371fdc1620f1c0a8088ac",
                "type": "pubkeyhash",
                "value": 347238,
                "n": 1,
                "next_position": 0,
            }
        ],
        "memo": "",
        "metadata": null
    }
}

# GET 单笔交易的交易详情

/{coin}/v1/tx

通过公链简称和交易hash获取到交易的详情

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",  // 交易哈希
        "fee": "-313828",                                                          // 手续费
        "date": 1617109308,                                                        // 日期
        "block": 676997,                                                           // 块高
        "confirmation": 966,                                                       // 确认数
        "status": "completed",                                                     // 交易状态
        "inputs": [                                                                // 交易 inputs
            {
                "addresses": [                                                     // 地址列表
                    "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                ],
                "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710", // input 所属交易的哈希
                "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",                                                       // 签名
                "type": "pubkeyhash",
                "value": 347238,                                                    // 数额
                "vfp": 1,
                "sequence": 4294967295
            },
            {
                "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                "value": 0,
                "vfp": 0,
                "sequence": 4294967295
            }
        ],
        "outputs": [                                                                // 交易 outputs
            {
                "addresses": [
                    "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                ],
                "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                "type": "pubkeyhash",
                "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                "value": 307895,
                "n": 0,
                "next_position": 0
            },
            {
                "addresses": [
                    "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                ],
                "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                "type": "pubkeyhash",
                "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                "value": 353171,
                "n": 1,
                "next_position": 3
            }
        ],
        "memo": "",
        "metadata": null
    },
    "message": "OK"
}


Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/tx?tx_id=5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710'

Example Response
200 OK
{
    "code":0,
    "message":"OK",
    "data": {
        "id": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710",
        "fee": "17706",
        "date": 1616171114,
        "block": 675336,
        "confirmation": 554,
        "status": "completed",
        "inputs": [
            {
                "addresses": [
                    "178monFk9M49PyVi2PmP1Whce8VyvdRZ9T"
                ],
                "tx": "1e67b7c8368edc33c2db3d93716054259eb019fd0cacf4728235e52e8de326ef",
                "script_sig": "4830450221009faabcc6f33a24b42a4181ea73f5a20044a0d339ee5bd928d06eb7b8f1b1eca80220321a8823d91503af497656fbdf87dde5d4781b8ddf545135527aa373d2f3dff70121025ff937e5b23ba3102662990da6dff055514d19f59aba93aaa54aed5eb9674a21",
                "type": "pubkeyhash",
                "value": 379913,
                "vfp": 1,
                "sequence": 4294967295
            }
        ],
        "outputs": [
            {
                "addresses": [
                    "1H98Xu8Te6Lgu2Pj1uA6N5azLbjBP9Ncz2"
                ],
                "script": "76a914b10ba0d4d038c11c50e704ab145302f6c984afe688ac",
                "type": "pubkeyhash",
                "next_tx_id": "aef8039dbead733bf5f58c9ea37de771157dab24f76348cb4da675938c640506",
                "value": 14969,
                "n": 0,
                "next_position": 0,
            },
            {
                "addresses": [
                    "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                ],
                "script": "76a914200104085600bedcaad07ef371fdc1620f1c0a8088ac",
                "type": "pubkeyhash",
                "value": 347238,
                "n": 1,
                "next_position": 0,
            }
        ],
        "memo": "",
        "metadata": null
    }
}

# GET 单笔交易的确认数

/{coin}/v1/tx/confirmation

通过公链简称和交易hash获取交易的确认数

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回内容格式如下:

{
    "code":0,
    "message":"OK",
    "data":{
        "confirmation": 554,                                                        // 确认数
        "platform": "BTC",                                                          // 币种
        "tx_id": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710" // 交易id
    }
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/tx/confirmation?tx_id=5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710
'
Example Response
200 OK
{
    "code":0,
    "message":"OK",
    "data":{
        "confirmation": 554,
        "platform": "BTC",
        "tx_id": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710"
    }
}

# GET 单笔交易的确认数

/{coin}/v1/tx/confirmation

通过公链简称和交易hash获取交易的确认数

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回内容格式如下:

{
    "code":0,
    "message":"OK",
    "data":{
        "confirmation": 554,                                                        // 确认数
        "platform": "BTC",                                                          // 币种
        "tx_id": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710" // 交易id
    }
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/tx/confirmation?tx_id=5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710
'
Example Response
200 OK
{
    "code":0,
    "message":"OK",
    "data":{
        "confirmation": 554,
        "platform": "BTC",
        "tx_id": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710"
    }
}

# GET 获取区块交易列表

/{coin}/v1/block/txs

通过公链简称和块高,获得该块高的交易列表

参数 类型 必须 备注
height int64 yes 区块高度
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",  // 交易哈希
                "fee": "-313828",                                                          // 手续费
                "date": 1617109308,                                                        // 日期
                "block": 676997,                                                           // 块高
                "confirmation": 966,                                                       // 确认数
                "status": "completed",                                                     // 交易状态
                "inputs": [                                                                // 交易 inputs
                    {
                        "addresses": [                                                     // 地址列表
                            "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                        ],
                        "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710", // input 所属交易的哈希
                        "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",                                                       // 签名
                        "type": "pubkeyhash",
                        "value": 347238,                                                    // 数额
                        "vfp": 1,
                        "sequence": 4294967295
                    },
                    {
                        "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                        "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                        "value": 0,
                        "vfp": 0,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [                                                                // 交易 outputs
                    {
                        "addresses": [
                            "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                        ],
                        "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                        "value": 307895,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "addresses": [
                            "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                        ],
                        "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                        "value": 353171,
                        "n": 1,
                        "next_position": 3
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "B1jgkPtsA1FQR21eYU",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'http://developers.viawallet.com/openapi/api/btc/v1/block/txs?height=675639' \
--header 'X-API-Key: BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "3193f588fb1bcede00e809562dbdb07be94779e1ac90ffe95c7f4eeaea94af07",
                "fee": "0",
                "date": 1616340678,
                "block": 675639,
                "is_coinbase": true,
                "confirmation": 2314,
                "status": "completed",
                "inputs": [
                    {
                        "witness": [
                            "0000000000000000000000000000000000000000000000000000000000000000"
                        ],
                        "coinbase": "03374f0a04c6665760425443506f6f6cfabe6d6d78bd61a6381485d1fd757c08ca151acf8605357e6cfa591776eccda28bbf7b21020000007296cd100300e37527641c0000000000",
                        "value": 0,
                        "vfp": 4294967295,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [
                    {
                        "addresses": [
                            "14PUSkxZsGShcNmUBmxcYm5DcFq89S8jEG"
                        ],
                        "script": "76a9142528700ca7564d29160a93e629243d4ca15777e788ac",
                        "type": "pubkeyhash",
                        "value": 650979097,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "script": "6a24aa21a9ed2e336a4a683fb65e51eee595ebfd9d29ecb4c2b4ea65bb2489be3565db7e77e7",
                        "type": "nulldata",
                        "value": 0,
                        "n": 1,
                        "next_position": 0
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取区块交易列表

/{coin}/v1/block/txs

通过公链简称和块高,获得该块高的交易列表

参数 类型 必须 备注
height int64 yes 区块高度
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "c7841cb796c64027391038673de23d2b242fd2108c1e7092b9207cf6ef46ecb8",  // 交易哈希
                "fee": "-313828",                                                          // 手续费
                "date": 1617109308,                                                        // 日期
                "block": 676997,                                                           // 块高
                "confirmation": 966,                                                       // 确认数
                "status": "completed",                                                     // 交易状态
                "inputs": [                                                                // 交易 inputs
                    {
                        "addresses": [                                                     // 地址列表
                            "13vDqiRpJ7h9oSri85e6wonvgtKYbVXiHp"
                        ],
                        "tx": "5d3c394304a52aeb7f0a055e3cbabce6462962db3009f2ca84da5247bc4bf710", // input 所属交易的哈希
                        "script_sig": "483045022100ae07c018a81ce86cd0324ff13cd5bbee4064180b818ec491d9aa6c63ccc84ae702202bb4040c6c94d6509a0cd56fe3625968dccbd3308d1cd2d0376f9f145f3f033b01210360c5c6cd2c7f93b68c834ca38ba27f9a2f6f4d74153bf0bc007cd17c8bda1cbf",                                                       // 签名
                        "type": "pubkeyhash",
                        "value": 347238,                                                    // 数额
                        "vfp": 1,
                        "sequence": 4294967295
                    },
                    {
                        "tx": "83e6deea63ea60d2265a0fc3b1e41fa2b5d78e16543c6efb19694721786c01e8",
                        "script_sig": "473044022078b9464543b0e028e897aab1212cf8c9fe3b1fdbef7d603d7511e97a4f4c05820220224035cbadbd31b565b61985c50e25fd3eff678fdc0b147155f2d07de6b5e8cc012102c625fbd4a74117a739ee5489ccd98e3e824f8406adaec3274bed4699cf53f675",
                        "value": 0,
                        "vfp": 0,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [                                                                // 交易 outputs
                    {
                        "addresses": [
                            "1AYnQmwWYuomJaJGNkUKkaGdi9Hdfjtkct"
                        ],
                        "script": "76a91468bbeee32eab032e8865d2ec07ff479a7ad8304288ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "8f4d66d927b55cc90c6a7641bc85bf80aed3bd694b6f1b04ac09671cd0389dda",
                        "value": 307895,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "addresses": [
                            "12JaDBoKxyz5UkzLj4hJqFkqJczY1FjZqs"
                        ],
                        "script": "76a9140e4aeb66a77a89e013d63e852232998031c8910e88ac",
                        "type": "pubkeyhash",
                        "next_tx_id": "9e7cff97dfdeb08c158bf8e7fb22288562bf21bec6e61f20fa035893f4b2fb10",
                        "value": 353171,
                        "n": 1,
                        "next_position": 3
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "B1jgkPtsA1FQR21eYU",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'http://developers.viawallet.com/openapi/api/btc/v1/block/txs?height=675639' \
--header 'X-API-Key: BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "3193f588fb1bcede00e809562dbdb07be94779e1ac90ffe95c7f4eeaea94af07",
                "fee": "0",
                "date": 1616340678,
                "block": 675639,
                "is_coinbase": true,
                "confirmation": 2314,
                "status": "completed",
                "inputs": [
                    {
                        "witness": [
                            "0000000000000000000000000000000000000000000000000000000000000000"
                        ],
                        "coinbase": "03374f0a04c6665760425443506f6f6cfabe6d6d78bd61a6381485d1fd757c08ca151acf8605357e6cfa591776eccda28bbf7b21020000007296cd100300e37527641c0000000000",
                        "value": 0,
                        "vfp": 4294967295,
                        "sequence": 4294967295
                    }
                ],
                "outputs": [
                    {
                        "addresses": [
                            "14PUSkxZsGShcNmUBmxcYm5DcFq89S8jEG"
                        ],
                        "script": "76a9142528700ca7564d29160a93e629243d4ca15777e788ac",
                        "type": "pubkeyhash",
                        "value": 650979097,
                        "n": 0,
                        "next_position": 0
                    },
                    {
                        "script": "6a24aa21a9ed2e336a4a683fb65e51eee595ebfd9d29ecb4c2b4ea65bb2489be3565db7e77e7",
                        "type": "nulldata",
                        "value": 0,
                        "n": 1,
                        "next_position": 0
                    }
                ],
                "memo": "",
                "metadata": null
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取未确认的交易

/{coin}/v1/unconfirmed_tx

待确认交易就是这笔交易还等待打包,还没有进到区块链里。通过交易ID和公链简称,获得该交易的详情。如果data返回的是null,则说明待确认队列里,没有这笔交易。

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:

{
    "code": 0,
    "message": "OK",
    "data": {
        "id": "816da806c69ec920e279c1d88aec48cd4c8da6be53634b9aab17ae64a3e0a090", // tx id
        "fee": "11658",                                                           // 手续费
        "date": 1616481573,                                                       // 时间戳
        "block": 0,
        "confirmation": 0,
        "status": "pending",                                                      // 交易状态
        "inputs": [
            {
                "addresses": [
                    "bc1q9akj4ekp0u4wrqlf9wmkcgna7y5wnn2x0uwhtz"
                ],
                "tx": "d4a758fbf0ce1dc9b1d7a9fb2cae232a8bffa6d830300b05be48047d1103af33",
                "type": "witness_v0_keyhash",
                "value": 2058732,
                "vfp": 0,
                "sequence": 4294967295
            }
        ],
        "outputs": [
            {
                "addresses": [
                    "35HFgtPENNGnR4UdyUUPRapVhUUQjQhFBD"
                ],
                "script": "a9142762029659834c03bb0470d82567a8ebde838e2687",
                "type": "scripthash",
                "value": 2047074,
                "n": 0,
                "next_position": 0,
            }
        ],
        "memo": "",
        "metadata": null
    }
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/unconfirmed_tx/816da806c69ec920e279c1d88aec48cd4c8da6be53634b9aab17ae64a3e0a090'
Example Response
200 OK
{
    "code": 0,
    "message": "OK",
    "data": {
        "id": "816da806c69ec920e279c1d88aec48cd4c8da6be53634b9aab17ae64a3e0a090",
        "fee": "11658",
        "date": 1616481573,
        "block": 0,
        "confirmation": 0,
        "status": "pending",
        "inputs": [
            {
                "addresses": [
                    "bc1q9akj4ekp0u4wrqlf9wmkcgna7y5wnn2x0uwhtz"
                ],
                "tx": "d4a758fbf0ce1dc9b1d7a9fb2cae232a8bffa6d830300b05be48047d1103af33",
                "type": "witness_v0_keyhash",
                "value": 2058732,
                "vfp": 0,
                "sequence": 4294967295
            }
        ],
        "outputs": [
            {
                "addresses": [
                    "35HFgtPENNGnR4UdyUUPRapVhUUQjQhFBD"
                ],
                "script": "a9142762029659834c03bb0470d82567a8ebde838e2687",
                "type": "scripthash",
                "value": 2047074,
                "n": 0,
                "next_position": 0,
            }
        ],
        "memo": "",
        "metadata": null
    }
}

# GET 获取未确认的交易

/{coin}/v1/unconfirmed_tx

待确认交易就是这笔交易还等待打包,还没有进到区块链里。通过交易ID和公链简称,获得该交易的详情。如果data返回的是null,则说明待确认队列里,没有这笔交易。

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:

{
    "code": 0,
    "message": "OK",
    "data": {
        "id": "816da806c69ec920e279c1d88aec48cd4c8da6be53634b9aab17ae64a3e0a090", // tx id
        "fee": "11658",                                                           // 手续费
        "date": 1616481573,                                                       // 时间戳
        "block": 0,
        "confirmation": 0,
        "status": "pending",                                                      // 交易状态
        "inputs": [
            {
                "addresses": [
                    "bc1q9akj4ekp0u4wrqlf9wmkcgna7y5wnn2x0uwhtz"
                ],
                "tx": "d4a758fbf0ce1dc9b1d7a9fb2cae232a8bffa6d830300b05be48047d1103af33",
                "type": "witness_v0_keyhash",
                "value": 2058732,
                "vfp": 0,
                "sequence": 4294967295
            }
        ],
        "outputs": [
            {
                "addresses": [
                    "35HFgtPENNGnR4UdyUUPRapVhUUQjQhFBD"
                ],
                "script": "a9142762029659834c03bb0470d82567a8ebde838e2687",
                "type": "scripthash",
                "value": 2047074,
                "n": 0,
                "next_position": 0,
            }
        ],
        "memo": "",
        "metadata": null
    }
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/unconfirmed_tx/816da806c69ec920e279c1d88aec48cd4c8da6be53634b9aab17ae64a3e0a090'
Example Response
200 OK
{
    "code": 0,
    "message": "OK",
    "data": {
        "id": "816da806c69ec920e279c1d88aec48cd4c8da6be53634b9aab17ae64a3e0a090",
        "fee": "11658",
        "date": 1616481573,
        "block": 0,
        "confirmation": 0,
        "status": "pending",
        "inputs": [
            {
                "addresses": [
                    "bc1q9akj4ekp0u4wrqlf9wmkcgna7y5wnn2x0uwhtz"
                ],
                "tx": "d4a758fbf0ce1dc9b1d7a9fb2cae232a8bffa6d830300b05be48047d1103af33",
                "type": "witness_v0_keyhash",
                "value": 2058732,
                "vfp": 0,
                "sequence": 4294967295
            }
        ],
        "outputs": [
            {
                "addresses": [
                    "35HFgtPENNGnR4UdyUUPRapVhUUQjQhFBD"
                ],
                "script": "a9142762029659834c03bb0470d82567a8ebde838e2687",
                "type": "scripthash",
                "value": 2047074,
                "n": 0,
                "next_position": 0,
            }
        ],
        "memo": "",
        "metadata": null
    }
}

# GET 获取代币富豪榜Top100列表

/{coin}/v1/toprich

通过公链简称,获得公链富豪榜TOP100钱包地址列表,包含钱包余额,列表以余额降序排序,支持的币种:BTC、BCH、BSV、LTC、DOGE、FCH

返回内容格式如下:

{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "address": "3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r", // 地址
            "balance": 138660.86073724,                      // 地址余额
            "percent":13.4,                                  // 地址余额占比
            "first_tx_time":1333003647,                      // 第一笔交易发生的时间
            "last_tx_time":1616981507,                       // 最近一笔交易发生的时间
            "tx_count":1352,                                 // 交易总数
            "tx_30day_count":13                              // 最近30天交易总数

        },
    ...
    ]
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/toprich'
Example Response
200 OK
{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "address": "3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r",
            "balance": 138660.86073724,
            "percent":13.4,
            "first_tx_time":1333003647,
            "last_tx_time":1616981507,
            "tx_count":1352,
            "tx_30day_count":13

        },
        {
            "addr": "16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe",
            "balance": 138660.86073724,
            "percent":13.4,
            "first_tx_time":1333003647,
            "last_tx_time":1616981507,
            "tx_count":1352,
            "tx_30day_count":13
        },
        {
            "addr": "16rCmCmbuWDhPjWTrpQGaU3EPdZF7MTdUk",
            "balance": 138660.86073724,
            "percent":13.4,
            "first_tx_time":1333003647,
            "last_tx_time":1616981507,
            "tx_count":1352,
            "tx_30day_count":13
        }
    ...
    ]
}

# GET 获取代币富豪榜Top100列表

/{coin}/v1/toprich

通过公链简称,获得公链富豪榜TOP100钱包地址列表,包含钱包余额,列表以余额降序排序,支持的币种:BTC、BCH、BSV、LTC、DOGE、FCH

返回内容格式如下:

{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "address": "3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r", // 地址
            "balance": 138660.86073724,                      // 地址余额
            "percent":13.4,                                  // 地址余额占比
            "first_tx_time":1333003647,                      // 第一笔交易发生的时间
            "last_tx_time":1616981507,                       // 最近一笔交易发生的时间
            "tx_count":1352,                                 // 交易总数
            "tx_30day_count":13                              // 最近30天交易总数

        },
    ...
    ]
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/btc/v1/toprich'
Example Response
200 OK
{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "address": "3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r",
            "balance": 138660.86073724,
            "percent":13.4,
            "first_tx_time":1333003647,
            "last_tx_time":1616981507,
            "tx_count":1352,
            "tx_30day_count":13

        },
        {
            "addr": "16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe",
            "balance": 138660.86073724,
            "percent":13.4,
            "first_tx_time":1333003647,
            "last_tx_time":1616981507,
            "tx_count":1352,
            "tx_30day_count":13
        },
        {
            "addr": "16rCmCmbuWDhPjWTrpQGaU3EPdZF7MTdUk",
            "balance": 138660.86073724,
            "percent":13.4,
            "first_tx_time":1333003647,
            "last_tx_time":1616981507,
            "tx_count":1352,
            "tx_30day_count":13
        }
    ...
    ]
}

# ETH及其类似币种

# GET 查询公链基本信息

/{coin}/v1/chain/info

通过公链简称,获得公链基本信息包括:区块高度、交易数量、原生代币流通量、网络大小等 应答内容格式如下:

{
    "symbol": "ETH",                                                            // 代币符号
    "name": "Ethereum",                                                         // 代币全称
    "decimals": 18,                                                             // 精度
    "block_time": 10000,                                                        // 区块时间
    "sample_address": "0xfc10cab6a50a1ab10c56983c80cc82afc6559cf1",             // 示例地址
    "height": 10216016,                                                         // 当前区块块高
    "hash": "0x1f9bb990d7a25a1c77652d6fcf6631ecc681bcd9d59722c1d0e21c7c68607e89",// 当前区块哈希
    "size": 70390928311,                                                        // 链的大小 可能不会返回当前字段
    "tota_txs": 29045598,                                                       // 交易总量 可能不会返回当前字段
    "circulation":16923962                                                      // 网络流通量 可能不会返回当前字段
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/chain/info'
Example Response
200 OK
{

  "code": 0,
  "message": "OK",
  "data": {
    "symbol": "ETH",
    "name": "Ethereum",
    "decimals": 18,
    "block_time": 10000,
    "sample_address": "0xfc10cab6a50a1ab10c56983c80cc82afc6559cf1",
    "height": 10216016,
    "hash": "0x1f9bb990d7a25a1c77652d6fcf6631ecc681bcd9d59722c1d0e21c7c68607e89",
    "size": 70390928311,
    "tota_txs": 29045598
  }
}

# ETH及其类似币种

# GET 查询公链基本信息

/{coin}/v1/chain/info

通过公链简称,获得公链基本信息包括:区块高度、交易数量、原生代币流通量、网络大小等 应答内容格式如下:

{
    "symbol": "ETH",                                                            // 代币符号
    "name": "Ethereum",                                                         // 代币全称
    "decimals": 18,                                                             // 精度
    "block_time": 10000,                                                        // 区块时间
    "sample_address": "0xfc10cab6a50a1ab10c56983c80cc82afc6559cf1",             // 示例地址
    "height": 10216016,                                                         // 当前区块块高
    "hash": "0x1f9bb990d7a25a1c77652d6fcf6631ecc681bcd9d59722c1d0e21c7c68607e89",// 当前区块哈希
    "size": 70390928311,                                                        // 链的大小 可能不会返回当前字段
    "tota_txs": 29045598,                                                       // 交易总量 可能不会返回当前字段
    "circulation":16923962                                                      // 网络流通量 可能不会返回当前字段
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/chain/info'
Example Response
200 OK
{

  "code": 0,
  "message": "OK",
  "data": {
    "symbol": "ETH",
    "name": "Ethereum",
    "decimals": 18,
    "block_time": 10000,
    "sample_address": "0xfc10cab6a50a1ab10c56983c80cc82afc6559cf1",
    "height": 10216016,
    "hash": "0x1f9bb990d7a25a1c77652d6fcf6631ecc681bcd9d59722c1d0e21c7c68607e89",
    "size": 70390928311,
    "tota_txs": 29045598
  }
}

# GET 获取区块信息

/{coin}/v1/block

根据块高或者hash获取区块信息

参数 类型 必须 备注
hashOrHeight string yes 区块哈希或者区块高度

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "date": 1620532384,                                                                 // 时间戳
        "height": 10200000,                                                                 // 区块高度
        "hash": "0x02c3b44b44364a08b29ecb1ad93615b5752b65780923cc47e3f607f3e3e8bc61",       // 区块哈希值
        "confirmations": 16016,                                                             // 确认数
        "txs": [                                                                            // 交易列表
            "0xb4817c6215ecd045a946d0438c8ed357bf2af4075dabd56b77ff2b93f40665c6",           // 交易id
            "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622"
        ],
        "size": 1030,                                                                       // 区块大小
        "nonce": "0x1e331705118e777e",                                                      // nonce值
        "parent_hash": "0xc12ed2c4d2219e7da137c6b0b79a7896615c2d85838ca50e4ef1036eba1c70cf",// 前一个区块的哈希值
        "state_root": "0x0699c41f5b84a6adad9770265c1f2e838a555e81738ac03c5e6ccea146604c14"  // 默克尔根
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/block?hashOrHeight=0x02c3b44b44364a08b29ecb1ad93615b5752b65780923cc47e3f607f3e3e8bc61'

Example Response
200 OK
{
    "code": 0,
    "data": {
        "date": 1620532384,
        "height": 10200000,
        "hash": "0x02c3b44b44364a08b29ecb1ad93615b5752b65780923cc47e3f607f3e3e8bc61",
        "confirmations": 16016,
        "txs": [
            "0xb4817c6215ecd045a946d0438c8ed357bf2af4075dabd56b77ff2b93f40665c6",
            "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622"
        ],
        "size": 1030,
        "nonce": "0x1e331705118e777e",
        "parent_hash": "0xc12ed2c4d2219e7da137c6b0b79a7896615c2d85838ca50e4ef1036eba1c70cf",
        "state_root": "0x0699c41f5b84a6adad9770265c1f2e838a555e81738ac03c5e6ccea146604c14"
    },
    "message": "OK"
}

# GET 获取区块信息

/{coin}/v1/block

根据块高或者hash获取区块信息

参数 类型 必须 备注
hashOrHeight string yes 区块哈希或者区块高度

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "date": 1620532384,                                                                 // 时间戳
        "height": 10200000,                                                                 // 区块高度
        "hash": "0x02c3b44b44364a08b29ecb1ad93615b5752b65780923cc47e3f607f3e3e8bc61",       // 区块哈希值
        "confirmations": 16016,                                                             // 确认数
        "txs": [                                                                            // 交易列表
            "0xb4817c6215ecd045a946d0438c8ed357bf2af4075dabd56b77ff2b93f40665c6",           // 交易id
            "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622"
        ],
        "size": 1030,                                                                       // 区块大小
        "nonce": "0x1e331705118e777e",                                                      // nonce值
        "parent_hash": "0xc12ed2c4d2219e7da137c6b0b79a7896615c2d85838ca50e4ef1036eba1c70cf",// 前一个区块的哈希值
        "state_root": "0x0699c41f5b84a6adad9770265c1f2e838a555e81738ac03c5e6ccea146604c14"  // 默克尔根
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/block?hashOrHeight=0x02c3b44b44364a08b29ecb1ad93615b5752b65780923cc47e3f607f3e3e8bc61'

Example Response
200 OK
{
    "code": 0,
    "data": {
        "date": 1620532384,
        "height": 10200000,
        "hash": "0x02c3b44b44364a08b29ecb1ad93615b5752b65780923cc47e3f607f3e3e8bc61",
        "confirmations": 16016,
        "txs": [
            "0xb4817c6215ecd045a946d0438c8ed357bf2af4075dabd56b77ff2b93f40665c6",
            "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622"
        ],
        "size": 1030,
        "nonce": "0x1e331705118e777e",
        "parent_hash": "0xc12ed2c4d2219e7da137c6b0b79a7896615c2d85838ca50e4ef1036eba1c70cf",
        "state_root": "0x0699c41f5b84a6adad9770265c1f2e838a555e81738ac03c5e6ccea146604c14"
    },
    "message": "OK"
}

# GET 获取地址的详细信息

/{coin}/v1/address/info

通过公链简称和地址,获得该地址信息,包括:余额,余额排名,交易次数,转出数量,收入数量,以及最近一笔交易详情

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "address": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",   // 地址
        "balance": 0,                                              // 地址余额
        "total_txs": 6,                                            // 总交易数量
        "total_tx_in": "5",                                        // 收到的金额
        "total_tx_out": "4.999979",                                // 转出的金额
        "latest_tx": {                                             // 最近一个交易
            "id": "0x769641a0893bf49e1cf8609592971b45e189dac5808d815d2dbed119f9f121ed",
            "type": "transfer",
            "gas_limit": 21000,
            "gas_price": "1000000000",
            "gas_used": 21000,
            "from": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",
            "to": "0x9402d510491f5dfde5e0b338831c80727c96222f",
            "fee": "21000000000000",
            "date": 1620721687,
            "block": 10212967,
            "confirmation": 0,
            "status": "completed",
            "metadata": []
        }
    },
    "message": "OK"
}
Example Request
curl --localtion --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/address/info?address=0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "address": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",                     
        "balance": 0,                                                                
        "total_txs": 6,                                                              
        "total_tx_in": "5",                                                          
        "total_tx_out": "4.999979",                                                  
        "latest_tx": {                                                                
            "id": "0x769641a0893bf49e1cf8609592971b45e189dac5808d815d2dbed119f9f121ed",
            "type": "transfer",
            "gas_limit": 21000,
            "gas_price": "1000000000",
            "gas_used": 21000,
            "from": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",
            "to": "0x9402d510491f5dfde5e0b338831c80727c96222f",
            "fee": "21000000000000",
            "date": 1620721687,
            "block": 10212967,
            "confirmation": 0,
            "status": "completed",
            "metadata": []
        }
    },
    "message": "OK"
}

# GET 获取地址的详细信息

/{coin}/v1/address/info

通过公链简称和地址,获得该地址信息,包括:余额,余额排名,交易次数,转出数量,收入数量,以及最近一笔交易详情

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "address": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",   // 地址
        "balance": 0,                                              // 地址余额
        "total_txs": 6,                                            // 总交易数量
        "total_tx_in": "5",                                        // 收到的金额
        "total_tx_out": "4.999979",                                // 转出的金额
        "latest_tx": {                                             // 最近一个交易
            "id": "0x769641a0893bf49e1cf8609592971b45e189dac5808d815d2dbed119f9f121ed",
            "type": "transfer",
            "gas_limit": 21000,
            "gas_price": "1000000000",
            "gas_used": 21000,
            "from": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",
            "to": "0x9402d510491f5dfde5e0b338831c80727c96222f",
            "fee": "21000000000000",
            "date": 1620721687,
            "block": 10212967,
            "confirmation": 0,
            "status": "completed",
            "metadata": []
        }
    },
    "message": "OK"
}
Example Request
curl --localtion --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/address/info?address=0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "address": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",                     
        "balance": 0,                                                                
        "total_txs": 6,                                                              
        "total_tx_in": "5",                                                          
        "total_tx_out": "4.999979",                                                  
        "latest_tx": {                                                                
            "id": "0x769641a0893bf49e1cf8609592971b45e189dac5808d815d2dbed119f9f121ed",
            "type": "transfer",
            "gas_limit": 21000,
            "gas_price": "1000000000",
            "gas_used": 21000,
            "from": "0x2f2f15b7f8be36f1dc812d333ed5f6acf19b535b",
            "to": "0x9402d510491f5dfde5e0b338831c80727c96222f",
            "fee": "21000000000000",
            "date": 1620721687,
            "block": 10212967,
            "confirmation": 0,
            "status": "completed",
            "metadata": []
        }
    },
    "message": "OK"
}

# GET 获取地址的交易列表

/{coin}/v1/address/txs

通过公链简称和地址,获得该地址的交易历史列表

参数 类型 必须 备注
address string yes 待查询的地址
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xb56eb930f96015f4d9bf6a1f63aac259abed6f447057e5b7f0d35d88a3af2163", // 交易id
                "gas_limit": 21000,                                                         // gas limit
                "gas_price": "117000000000",                                                // gas price
                "gas_used": 21000,                                                          // gas used
                "nonce": 173,                                                               // nonce值
                "from": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",                       // 转出地址
                "to": "0x58edb19ded9d46e0f76743722fce137b13daaedb",                         // 转入地址
                "fee": "2457000000000000",                                                  // 手续费
                "date": 1620551470,                                                         // 时间戳
                "block": 10201359,                                                          // 区块块高
                "confirmation": 14657,                                                      // 确认数
                "status": "completed",                                                      // 交易状态
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/txs?address=0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1'

Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xb56eb930f96015f4d9bf6a1f63aac259abed6f447057e5b7f0d35d88a3af2163",
                "gas_limit": 21000,
                "gas_price": "117000000000",
                "gas_used": 21000,
                "nonce": 173,
                "from": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",
                "to": "0x58edb19ded9d46e0f76743722fce137b13daaedb",
                "fee": "2457000000000000",
                "date": 1620551470,
                "block": 10201359,
                "confirmation": 14657,
                "status": "completed",
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取地址的交易列表

/{coin}/v1/address/txs

通过公链简称和地址,获得该地址的交易历史列表

参数 类型 必须 备注
address string yes 待查询的地址
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xb56eb930f96015f4d9bf6a1f63aac259abed6f447057e5b7f0d35d88a3af2163", // 交易id
                "gas_limit": 21000,                                                         // gas limit
                "gas_price": "117000000000",                                                // gas price
                "gas_used": 21000,                                                          // gas used
                "nonce": 173,                                                               // nonce值
                "from": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",                       // 转出地址
                "to": "0x58edb19ded9d46e0f76743722fce137b13daaedb",                         // 转入地址
                "fee": "2457000000000000",                                                  // 手续费
                "date": 1620551470,                                                         // 时间戳
                "block": 10201359,                                                          // 区块块高
                "confirmation": 14657,                                                      // 确认数
                "status": "completed",                                                      // 交易状态
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/txs?address=0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1'

Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xb56eb930f96015f4d9bf6a1f63aac259abed6f447057e5b7f0d35d88a3af2163",
                "gas_limit": 21000,
                "gas_price": "117000000000",
                "gas_used": 21000,
                "nonce": 173,
                "from": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",
                "to": "0x58edb19ded9d46e0f76743722fce137b13daaedb",
                "fee": "2457000000000000",
                "date": 1620551470,
                "block": 10201359,
                "confirmation": 14657,
                "status": "completed",
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取待确认交易列表

/{coin}/v1/unconfirmed_txs

支持的币种:ETH、ETC、BNB、HT

通过公链简称,获得该地址待确认交易列表

参数 类型 必须 备注
address string no 待查询的地址
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xd35fcba7210d6de56711810685a867e4fc183ec4212825671ff768a8465d8e8f", // 交易id
                "gas_limit": 90908,                                                         // gas limit
                "gas_price": "1000000000",                                                  // gas price
                "gas_used": 0,                                                              // gas used
                "nonce": 554,                                                               // nonce值
                "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",                       // 转出地址
                "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",                         // 转入地址
                "fee": "",                                                                  // 手续费
                "date": 0,                                                                  // 时间戳
                "block": 0,                                                                 // 区块块高
                "confirmation": 0,                                                          // 确认数
                "status": "pending",                                                        // 交易状态
                "metadata": []
            }
            ...
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/unconfirmed_txs?address=0x4fe2000fb08b8059e1898cec0426b6d89228622b'

Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xd35fcba7210d6de56711810685a867e4fc183ec4212825671ff768a8465d8e8f",
                "gas_limit": 90908,
                "gas_price": "1000000000",
                "gas_used": 0,
                "nonce": 554,
                "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",
                "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",
                "fee": "",
                "date": 0,
                "block": 0,
                "confirmation": 0,
                "status": "pending",
                "metadata": []
            },
            {
                "id": "0x8490f7517869a0dde863d84d181976be134f3fba23aae9e0c84a57d179fe111e",
                "gas_limit": 90908,
                "gas_price": "1000000000",
                "gas_used": 0,
                "nonce": 553,
                "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",
                "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",
                "fee": "",
                "date": 0,
                "block": 0,
                "confirmation": 0,
                "status": "pending",
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取待确认交易列表

/{coin}/v1/unconfirmed_txs

支持的币种:ETH、ETC、BNB、HT

通过公链简称,获得该地址待确认交易列表

参数 类型 必须 备注
address string no 待查询的地址
nextkey string no 查询游标

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xd35fcba7210d6de56711810685a867e4fc183ec4212825671ff768a8465d8e8f", // 交易id
                "gas_limit": 90908,                                                         // gas limit
                "gas_price": "1000000000",                                                  // gas price
                "gas_used": 0,                                                              // gas used
                "nonce": 554,                                                               // nonce值
                "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",                       // 转出地址
                "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",                         // 转入地址
                "fee": "",                                                                  // 手续费
                "date": 0,                                                                  // 时间戳
                "block": 0,                                                                 // 区块块高
                "confirmation": 0,                                                          // 确认数
                "status": "pending",                                                        // 交易状态
                "metadata": []
            }
            ...
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/unconfirmed_txs?address=0x4fe2000fb08b8059e1898cec0426b6d89228622b'

Example Response
200 OK
{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xd35fcba7210d6de56711810685a867e4fc183ec4212825671ff768a8465d8e8f",
                "gas_limit": 90908,
                "gas_price": "1000000000",
                "gas_used": 0,
                "nonce": 554,
                "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",
                "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",
                "fee": "",
                "date": 0,
                "block": 0,
                "confirmation": 0,
                "status": "pending",
                "metadata": []
            },
            {
                "id": "0x8490f7517869a0dde863d84d181976be134f3fba23aae9e0c84a57d179fe111e",
                "gas_limit": 90908,
                "gas_price": "1000000000",
                "gas_used": 0,
                "nonce": 553,
                "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",
                "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",
                "fee": "",
                "date": 0,
                "block": 0,
                "confirmation": 0,
                "status": "pending",
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 单笔交易的交易详情

/{coin}/v1/tx

通过公链简称和交易hash获取到交易的详情

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xb56eb930f96015f4d9bf6a1f63aac259abed6f447057e5b7f0d35d88a3af2163", // 交易id
                "gas_limit": 21000,                                                         // gas limit
                "gas_price": "117000000000",                                                // gas price
                "gas_used": 21000,                                                          // gas used
                "nonce": 173,                                                               // nonce值
                "from": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",                       // 转出地址
                "to": "0x58edb19ded9d46e0f76743722fce137b13daaedb",                         // 转入地址
                "fee": "2457000000000000",                                                  // 手续费
                "date": 1620551470,                                                         // 时间戳
                "block": 10201359,                                                          // 区块块高
                "confirmation": 14657,                                                      // 确认数
                "status": "completed",                                                      // 交易状态
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/tx?tx_id=0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622'

Example Response
200 OK

{
    "code": 0,
    "data": {
        "id": "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622",
        "gas_limit": 21000,
        "gas_price": "100000000000",
        "gas_used": 21000,
        "nonce": 2619,
        "from": "0xc5fade3198fe1f8bed3ec25b3d68bf9a8ddf934f",
        "to": "0xeb547a7354e6fe0da3bae56c1efe9a76ac5a7519",
        "fee": "2100000000000000",
        "date": 1620532384,
        "block": 10200000,
        "confirmation": 16016,
        "status": "completed",
        "metadata": []
    },
    "message": "OK"
}

# GET 单笔交易的交易详情

/{coin}/v1/tx

通过公链简称和交易hash获取到交易的详情

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0xb56eb930f96015f4d9bf6a1f63aac259abed6f447057e5b7f0d35d88a3af2163", // 交易id
                "gas_limit": 21000,                                                         // gas limit
                "gas_price": "117000000000",                                                // gas price
                "gas_used": 21000,                                                          // gas used
                "nonce": 173,                                                               // nonce值
                "from": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",                       // 转出地址
                "to": "0x58edb19ded9d46e0f76743722fce137b13daaedb",                         // 转入地址
                "fee": "2457000000000000",                                                  // 手续费
                "date": 1620551470,                                                         // 时间戳
                "block": 10201359,                                                          // 区块块高
                "confirmation": 14657,                                                      // 确认数
                "status": "completed",                                                      // 交易状态
                "metadata": []
            }
        ],
        "nextkey": "",
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/tx?tx_id=0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622'

Example Response
200 OK

{
    "code": 0,
    "data": {
        "id": "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622",
        "gas_limit": 21000,
        "gas_price": "100000000000",
        "gas_used": 21000,
        "nonce": 2619,
        "from": "0xc5fade3198fe1f8bed3ec25b3d68bf9a8ddf934f",
        "to": "0xeb547a7354e6fe0da3bae56c1efe9a76ac5a7519",
        "fee": "2100000000000000",
        "date": 1620532384,
        "block": 10200000,
        "confirmation": 16016,
        "status": "completed",
        "metadata": []
    },
    "message": "OK"
}

# GET 单笔交易的确认数

/{coin}/v1/tx/confirmation

通过公链简称和交易hash获取交易的确认数

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回内容格式如下:

{
    "code":0,
    "message":"OK",
    "data":{
        "confirmation": 16016,                                                        // 确认数
        "platform": "ETH",                                                            // 币种
        "tx_id": "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622" // 交易id
    }
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/tx/confirmation?tx_id=0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622
'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "confirmation": 16016,
        "platform": "ETH",
        "tx_id": "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622"
    },
    "message": "OK"
}

# GET 单笔交易的确认数

/{coin}/v1/tx/confirmation

通过公链简称和交易hash获取交易的确认数

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回内容格式如下:

{
    "code":0,
    "message":"OK",
    "data":{
        "confirmation": 16016,                                                        // 确认数
        "platform": "ETH",                                                            // 币种
        "tx_id": "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622" // 交易id
    }
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/tx/confirmation?tx_id=0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622
'
Example Response
200 OK
{
    "code": 0,
    "data": {
        "confirmation": 16016,
        "platform": "ETH",
        "tx_id": "0x8a23c23a7813843bb7bf16fc51e822832cb4168f99658d7c6ed21a13d1db1622"
    },
    "message": "OK"
}

# GET 获取区块交易列表

/{coin}/v1/block/txs

通过公链简称和块高,获得该块高的交易列表

参数 类型 必须 备注
height int64 yes 区块高度
nextkey string no 查询游标

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b", // 交易id
                "type": "token_transfer",                                           // 交易类型,token_transfer表示token转账交易、contract_call表示合约调用交易,transfer表示普通转账
                "gas_limit": 139979,                                                // gas limit
                "gas_price": "1000000000",                                          // gas price
                "gas_used": 102040,                                                 // gas used
                "nonce": 31,                                                        // tx nonce
                "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",               // from
                "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                 // to
                "fee": "102040000000000",                                           // fee
                "date": 1620730114,                                                 // 交易时间戳
                "block": 10213589,                                                  // 块高
                "confirmation": 2427,                                               // 确认数
                "status": "completed",                                              // 交易状态
                "token_transfers": [                                                // token交易信息
                    {
                        "index": 1,         
                        "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",   // token id(合约地址)
                        "type": "",
                        "value": "100000000000000000",                              // 数额
                        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                        "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"
                    },
                    {
                        "index": 2,
                        "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                        "type": "",
                        "value": "344876432180959503648615581383",
                        "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                        "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                    }
                ],
                "metadata": []
            }
           {
                "id": "0x553d77deaddcdc5e5f69867ad60fba9f63d874f3d15f0cafdfc6098b87550928",
                "type": "transfer",
                "gas_limit": 400000,
                "gas_price": "2000000000",
                "gas_used": 273385,
                "nonce": 2,
                "from": "0x15b31e86cd118040db66fb8b14d5be658a9b71a7",
                "to": "0xa10d0c6e04845a5e998d1936249a30563c553417",
                "fee": "546770000000000",
                "date": 1616569886,
                "value": "0",
                "block": 9900000,
                "confirmation": 509675,
                "status": "completed",
                "contract_call": [                                                  // 合约调用信息
                    {
                        "contract": "0x5ea9ea8e80230e514b5e023e8d956550a22d02c6",   // 合约地址
                        "input":        "0xd98380ea00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100cd54fa0c503bcd81e680e9f910531ee4dafbe0602ed0c9ae193af44213be0f16000000000000000000000000000000000000000000000000000000000000001c185f5e43b4bc10fa7a9db2f5e25bf1a966dba79148b120ef78d3828b32692d174bda81b9a01561505f612ef43245a336c2d88824aff6f66ac2d14917137d68d1000000000000000000000000000000000000000000000000000000000000000100100000000000000000000000000000ecdf4636493d43529141b53274a69803000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000"
                    }                                                               // input
                ],
                "metadata": []
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'http://developers.viawallet.com/openapi/api/eth/v1/block/txs?height=10213589' \
--header 'X-API-Key: BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b", 
                "type": "token_transfer",                                          
                "gas_limit": 139979,                                               
                "gas_price": "1000000000",                                         
                "gas_used": 102040,                                               
                "nonce": 31,                                                       
                "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",              
                "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                
                "fee": "102040000000000",                                          
                "date": 1620730114,                                                
                "block": 10213589,                                                 
                "confirmation": 2427,                                              
                "status": "completed",                                            
                "token_transfers": [                                               
                    {
                        "index": 1,         
                        "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",  
                        "type": "",
                        "value": "100000000000000000",                             
                        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                        "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"
                    },
                    {
                        "index": 2,
                        "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                        "type": "",
                        "value": "344876432180959503648615581383",
                        "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                        "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                    }
                ],
                "metadata": []
            }
           {
                "id": "0x553d77deaddcdc5e5f69867ad60fba9f63d874f3d15f0cafdfc6098b87550928",
                "type": "transfer",
                "gas_limit": 400000,
                "gas_price": "2000000000",
                "gas_used": 273385,
                "nonce": 2,
                "from": "0x15b31e86cd118040db66fb8b14d5be658a9b71a7",
                "to": "0xa10d0c6e04845a5e998d1936249a30563c553417",
                "fee": "546770000000000",
                "date": 1616569886,
                "value": "0",
                "block": 9900000,
                "confirmation": 509675,
                "status": "completed",
                "contract_call": [                                                  
                    {
                        "contract": "0x5ea9ea8e80230e514b5e023e8d956550a22d02c6",   
                        "input":        "0xd98380ea00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100cd54fa0c503bcd81e680e9f910531ee4dafbe0602ed0c9ae193af44213be0f16000000000000000000000000000000000000000000000000000000000000001c185f5e43b4bc10fa7a9db2f5e25bf1a966dba79148b120ef78d3828b32692d174bda81b9a01561505f612ef43245a336c2d88824aff6f66ac2d14917137d68d1000000000000000000000000000000000000000000000000000000000000000100100000000000000000000000000000ecdf4636493d43529141b53274a69803000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000"
                    }                                                              
                ],
                "metadata": []
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取区块交易列表

/{coin}/v1/block/txs

通过公链简称和块高,获得该块高的交易列表

参数 类型 必须 备注
height int64 yes 区块高度
nextkey string no 查询游标

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b", // 交易id
                "type": "token_transfer",                                           // 交易类型,token_transfer表示token转账交易、contract_call表示合约调用交易,transfer表示普通转账
                "gas_limit": 139979,                                                // gas limit
                "gas_price": "1000000000",                                          // gas price
                "gas_used": 102040,                                                 // gas used
                "nonce": 31,                                                        // tx nonce
                "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",               // from
                "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                 // to
                "fee": "102040000000000",                                           // fee
                "date": 1620730114,                                                 // 交易时间戳
                "block": 10213589,                                                  // 块高
                "confirmation": 2427,                                               // 确认数
                "status": "completed",                                              // 交易状态
                "token_transfers": [                                                // token交易信息
                    {
                        "index": 1,         
                        "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",   // token id(合约地址)
                        "type": "",
                        "value": "100000000000000000",                              // 数额
                        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                        "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"
                    },
                    {
                        "index": 2,
                        "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                        "type": "",
                        "value": "344876432180959503648615581383",
                        "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                        "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                    }
                ],
                "metadata": []
            }
           {
                "id": "0x553d77deaddcdc5e5f69867ad60fba9f63d874f3d15f0cafdfc6098b87550928",
                "type": "transfer",
                "gas_limit": 400000,
                "gas_price": "2000000000",
                "gas_used": 273385,
                "nonce": 2,
                "from": "0x15b31e86cd118040db66fb8b14d5be658a9b71a7",
                "to": "0xa10d0c6e04845a5e998d1936249a30563c553417",
                "fee": "546770000000000",
                "date": 1616569886,
                "value": "0",
                "block": 9900000,
                "confirmation": 509675,
                "status": "completed",
                "contract_call": [                                                  // 合约调用信息
                    {
                        "contract": "0x5ea9ea8e80230e514b5e023e8d956550a22d02c6",   // 合约地址
                        "input":        "0xd98380ea00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100cd54fa0c503bcd81e680e9f910531ee4dafbe0602ed0c9ae193af44213be0f16000000000000000000000000000000000000000000000000000000000000001c185f5e43b4bc10fa7a9db2f5e25bf1a966dba79148b120ef78d3828b32692d174bda81b9a01561505f612ef43245a336c2d88824aff6f66ac2d14917137d68d1000000000000000000000000000000000000000000000000000000000000000100100000000000000000000000000000ecdf4636493d43529141b53274a69803000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000"
                    }                                                               // input
                ],
                "metadata": []
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'http://developers.viawallet.com/openapi/api/eth/v1/block/txs?height=10213589' \
--header 'X-API-Key: BRfvZY97QaRa14Ci1F5vvP3KzwRxFFMw'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "items": [
            {
                "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b", 
                "type": "token_transfer",                                          
                "gas_limit": 139979,                                               
                "gas_price": "1000000000",                                         
                "gas_used": 102040,                                               
                "nonce": 31,                                                       
                "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",              
                "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                
                "fee": "102040000000000",                                          
                "date": 1620730114,                                                
                "block": 10213589,                                                 
                "confirmation": 2427,                                              
                "status": "completed",                                            
                "token_transfers": [                                               
                    {
                        "index": 1,         
                        "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",  
                        "type": "",
                        "value": "100000000000000000",                             
                        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                        "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"
                    },
                    {
                        "index": 2,
                        "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                        "type": "",
                        "value": "344876432180959503648615581383",
                        "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                        "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                    }
                ],
                "metadata": []
            }
           {
                "id": "0x553d77deaddcdc5e5f69867ad60fba9f63d874f3d15f0cafdfc6098b87550928",
                "type": "transfer",
                "gas_limit": 400000,
                "gas_price": "2000000000",
                "gas_used": 273385,
                "nonce": 2,
                "from": "0x15b31e86cd118040db66fb8b14d5be658a9b71a7",
                "to": "0xa10d0c6e04845a5e998d1936249a30563c553417",
                "fee": "546770000000000",
                "date": 1616569886,
                "value": "0",
                "block": 9900000,
                "confirmation": 509675,
                "status": "completed",
                "contract_call": [                                                  
                    {
                        "contract": "0x5ea9ea8e80230e514b5e023e8d956550a22d02c6",   
                        "input":        "0xd98380ea00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100cd54fa0c503bcd81e680e9f910531ee4dafbe0602ed0c9ae193af44213be0f16000000000000000000000000000000000000000000000000000000000000001c185f5e43b4bc10fa7a9db2f5e25bf1a966dba79148b120ef78d3828b32692d174bda81b9a01561505f612ef43245a336c2d88824aff6f66ac2d14917137d68d1000000000000000000000000000000000000000000000000000000000000000100100000000000000000000000000000ecdf4636493d43529141b53274a69803000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000"
                    }                                                              
                ],
                "metadata": []
            },
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取待确认的交易

/{coin}/v1/unconfirmed_tx

支持的币种:ETH、ETC、BNB、HT

待确认交易就是这笔交易还等待打包,还没有进到区块链里。通过交易ID和公链简称,获得该交易的详情。如果data返回的是null,则说明待确认队列里,没有这笔交易。

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "id": "0xd35fcba7210d6de56711810685a867e4fc183ec4212825671ff768a8465d8e8f", // 交易id
        "gas_limit": 90908,                                                         // gas limit
        "gas_price": "1000000000",                                                  // gas price
        "gas_used": 0,                                                              // gas used
        "nonce": 554,                                                               // nonce值
        "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",                       // 转出地址
        "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",                         // 转入地址
        "fee": "",                                                                  // 手续费
        "date": 0,                                                                  // 时间戳
        "block": 0,                                                                 // 区块块高
        "confirmation": 0,                                                          // 确认数
        "status": "pending",                                                        // 交易状态
        "metadata": []
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/unconfirmed_tx/0x57cde10fd9c4ea53e3a0df68860c18b02c7b45fda298f0d92ded4d5368feb87a'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "id": "0x57cde10fd9c4ea53e3a0df68860c18b02c7b45fda298f0d92ded4d5368feb87a",
        "gas_limit": 90908,
        "gas_price": "1000000000",
        "gas_used": 0,
        "nonce": 552,
        "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",
        "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",
        "fee": "",
        "date": 0,
        "block": 0,
        "confirmation": 0,
        "status": "pending",
        "metadata": []
    },
    "message": "OK"
}

# GET 获取待确认的交易

/{coin}/v1/unconfirmed_tx

支持的币种:ETH、ETC、BNB、HT

待确认交易就是这笔交易还等待打包,还没有进到区块链里。通过交易ID和公链简称,获得该交易的详情。如果data返回的是null,则说明待确认队列里,没有这笔交易。

参数 类型 必须 备注
tx_id string yes 待查询的交易哈希

返回的内容格式如下:

{
    "code": 0,
    "data": {
        "id": "0xd35fcba7210d6de56711810685a867e4fc183ec4212825671ff768a8465d8e8f", // 交易id
        "gas_limit": 90908,                                                         // gas limit
        "gas_price": "1000000000",                                                  // gas price
        "gas_used": 0,                                                              // gas used
        "nonce": 554,                                                               // nonce值
        "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",                       // 转出地址
        "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",                         // 转入地址
        "fee": "",                                                                  // 手续费
        "date": 0,                                                                  // 时间戳
        "block": 0,                                                                 // 区块块高
        "confirmation": 0,                                                          // 确认数
        "status": "pending",                                                        // 交易状态
        "metadata": []
    },
    "message": "OK"
}
Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/unconfirmed_tx/0x57cde10fd9c4ea53e3a0df68860c18b02c7b45fda298f0d92ded4d5368feb87a'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "id": "0x57cde10fd9c4ea53e3a0df68860c18b02c7b45fda298f0d92ded4d5368feb87a",
        "gas_limit": 90908,
        "gas_price": "1000000000",
        "gas_used": 0,
        "nonce": 552,
        "from": "0x4fe2000fb08b8059e1898cec0426b6d89228622b",
        "to": "0x0cc6cc19a03d005708e4b0985fdf4dee44639ee5",
        "fee": "",
        "date": 0,
        "block": 0,
        "confirmation": 0,
        "status": "pending",
        "metadata": []
    },
    "message": "OK"
}

# GET 获取token列表

/{coin}/v1/tokens

支持的币种:ETH、ETC、BNB、HT、TRX

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "items": [
            {
                "name": "Wandoge2",                                         // token 名称
                "symbol": "WANDOGE2",                                       // token 符号
                "decimals": 18,                                             // token 精度
                "token_id": "0xfbb94a3966da67e12170d6662d2fa99f07f0b4d5",   // token id(contract)
                "coin": "eth",                                              // 币种
                "holder_count": 2                                           // 持有人数
            },
            ...
        ],
        "nextkey": "M6zHaZxAXCe",
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/tokens'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "items": [
            {
                "name": "Wandoge2",                                         
                "symbol": "WANDOGE2",                                      
                "decimals": 18,                                           
                "token_id": "0xfbb94a3966da67e12170d6662d2fa99f07f0b4d5",  
                "coin": "eth",                                            
                "holder_count": 2                                         
            },
            {
                "name": "Tesla Stock TOKEN",
                "symbol": "TSLA",
                "decimals": 18,
                "token_id": "0xfb588e297332e3dfb1af06296c4765cee5c15494",
                "coin": "eth"
            },
            {
                "name": "TMCOW",
                "symbol": "COW",
                "decimals": 18,
                "token_id": "0xfb4af01c76960e34572a962d0d3d07dd2dee0f46",
                "coin": "eth"
            },
            {
                "name": "FaucetToken",
                "symbol": "FAU",
                "decimals": 18,
                "token_id": "0xfab46e002bbf0b4509813474841e0716e6730136",
                "coin": "eth"
            },
            {
                "name": "Wandoge2",
                "symbol": "WANDOGE2",
                "decimals": 18,
                "token_id": "0xf9fcd33c2fa6d0c228fb74d3138258d4d4c017a5",
                "coin": "eth"
            },
            {
                "name": "TEST CONTRACT",
                "symbol": "XRP",
                "decimals": 18,
                "token_id": "0xf9b3e3690083f0deb4855aece0e74a7f520b950e",
                "coin": "eth"
            },
            {
                "name": "PUN",
                "symbol": "PUN",
                "decimals": 18,
                "token_id": "0xf9527c6bd7153cc2f46ac816a24aec24dd5913d5",
                "coin": "eth"
            },
            {
                "name": "GridZone.io",
                "symbol": "ZONE",
                "decimals": 18,
                "token_id": "0xf884d04e282f859f694c691eb19a618646cdcf10",
                "coin": "eth"
            },
            {
                "name": "Wandoge",
                "symbol": "WANDOGE",
                "decimals": 18,
                "token_id": "0xf70b5285078ba3c116a05cb7bedb59acc3f852f2",
                "coin": "eth"
            }
        ],
        "nextkey": "M6zHaZxAXCe",
    },
    "message": "OK"
}

# GET 获取token列表

/{coin}/v1/tokens

支持的币种:ETH、ETC、BNB、HT、TRX

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "items": [
            {
                "name": "Wandoge2",                                         // token 名称
                "symbol": "WANDOGE2",                                       // token 符号
                "decimals": 18,                                             // token 精度
                "token_id": "0xfbb94a3966da67e12170d6662d2fa99f07f0b4d5",   // token id(contract)
                "coin": "eth",                                              // 币种
                "holder_count": 2                                           // 持有人数
            },
            ...
        ],
        "nextkey": "M6zHaZxAXCe",
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/tokens'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "items": [
            {
                "name": "Wandoge2",                                         
                "symbol": "WANDOGE2",                                      
                "decimals": 18,                                           
                "token_id": "0xfbb94a3966da67e12170d6662d2fa99f07f0b4d5",  
                "coin": "eth",                                            
                "holder_count": 2                                         
            },
            {
                "name": "Tesla Stock TOKEN",
                "symbol": "TSLA",
                "decimals": 18,
                "token_id": "0xfb588e297332e3dfb1af06296c4765cee5c15494",
                "coin": "eth"
            },
            {
                "name": "TMCOW",
                "symbol": "COW",
                "decimals": 18,
                "token_id": "0xfb4af01c76960e34572a962d0d3d07dd2dee0f46",
                "coin": "eth"
            },
            {
                "name": "FaucetToken",
                "symbol": "FAU",
                "decimals": 18,
                "token_id": "0xfab46e002bbf0b4509813474841e0716e6730136",
                "coin": "eth"
            },
            {
                "name": "Wandoge2",
                "symbol": "WANDOGE2",
                "decimals": 18,
                "token_id": "0xf9fcd33c2fa6d0c228fb74d3138258d4d4c017a5",
                "coin": "eth"
            },
            {
                "name": "TEST CONTRACT",
                "symbol": "XRP",
                "decimals": 18,
                "token_id": "0xf9b3e3690083f0deb4855aece0e74a7f520b950e",
                "coin": "eth"
            },
            {
                "name": "PUN",
                "symbol": "PUN",
                "decimals": 18,
                "token_id": "0xf9527c6bd7153cc2f46ac816a24aec24dd5913d5",
                "coin": "eth"
            },
            {
                "name": "GridZone.io",
                "symbol": "ZONE",
                "decimals": 18,
                "token_id": "0xf884d04e282f859f694c691eb19a618646cdcf10",
                "coin": "eth"
            },
            {
                "name": "Wandoge",
                "symbol": "WANDOGE",
                "decimals": 18,
                "token_id": "0xf70b5285078ba3c116a05cb7bedb59acc3f852f2",
                "coin": "eth"
            }
        ],
        "nextkey": "M6zHaZxAXCe",
    },
    "message": "OK"
}

# GET 获取token详细信息

/{coin}/v1/token

支持的币种:ETH、ETC、BNB、HT、TRX

参数 类型 必须 备注
token_id string yes 待查询的token id

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "name": "Qkika Token",                                    // token 名称
        "symbol": "Qkika",                                        // token 符号
        "decimals": 6,                                            // token 精度
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6", // token id(contrace address)
        "coin": "eth",                                            // 币种
        "holder_count": 2,                                        // token 持有人数
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/token?token_id=0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "name": "Qkika Token",
        "symbol": "Qkika",
        "decimals": 6,
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6",
        "coin": "eth",
        "holder_count": 2,
    },
    "message": "OK"
}

# GET 获取token详细信息

/{coin}/v1/token

支持的币种:ETH、ETC、BNB、HT、TRX

参数 类型 必须 备注
token_id string yes 待查询的token id

返回的内容格式如下:


{
    "code": 0,
    "data": {
        "name": "Qkika Token",                                    // token 名称
        "symbol": "Qkika",                                        // token 符号
        "decimals": 6,                                            // token 精度
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6", // token id(contrace address)
        "coin": "eth",                                            // 币种
        "holder_count": 2,                                        // token 持有人数
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/token?token_id=0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6'
Example Response
200 OK

{
    "code": 0,
    "data": {
        "name": "Qkika Token",
        "symbol": "Qkika",
        "decimals": 6,
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6",
        "coin": "eth",
        "holder_count": 2,
    },
    "message": "OK"
}

# GET 获取token交易列表

/{coin}/v1/token/txs

查询token的交易列表,可以通过传递address参数,获取某个地址的交易 支持的币种:ETH、ETC、BNB、HT、TRX

参数 类型 必须 备注
token_id string no 待查询的token id
address string no 待查询的地址

token id参数和address参数不能同时为空

返回的内容格式如下:



{
    "code": 0,
    "data": {
        "items": [
        {
            "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b",// 交易id
            "type": "token_transfer",                                                  // 交易类型,token_transfer表示token转账交易、contract_call表示合约调用交易,transfer表示普通转账
            "gas_limit": 139979,                                                       // gas limit                     
            "gas_price": "1000000000",                                                 // gas price
            "gas_used": 102040,                                                        // gas used
            "nonce": 31,                                                               // nonce值  
            "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",                      // 转出地址
            "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                        // 转入地址
            "fee": "102040000000000",                                                  // 手续费
            "date": 1620730114,                                                        // 时间戳
            "block": 10213589,                                                         // 区块块高
            "confirmation": 2427,                                                      // 确认数
            "status": "completed",                                                     // 交易状态
            "token_transfers": [                                                       // token转账内容           
                {
                    "index": 1,                                                        // 打包顺序
                    "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",          // token id(contract address)
                    "type": "",
                    "value": "100000000000000000",                                     // 数量
                    "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",              // token 转出地址
                    "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"                 // token 转入地址
                },
                {
                    "index": 2,
                    "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                    "type": "",
                    "value": "344876432180959503648615581383",
                    "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                    "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                }
            ],
            "metadata": []
        }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/token/txs?token_id=0xc778417e063141139fce010982780140aa0cd5ab'
Example Response
200 OK


{
    "code": 0,
    "data": {
        "items": [
        {
            "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b",
            "type": "token_transfer",                                          
            "gas_limit": 139979,                                               
            "gas_price": "1000000000",                                         
            "gas_used": 102040,                                               
            "nonce": 31,                                                       
            "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",             
            "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                
            "fee": "102040000000000",                                          
            "date": 1620730114,                                                
            "block": 10213589,                                                 
            "confirmation": 2427,                                              
            "status": "completed",                                             
            "token_transfers": [                                                
                {
                    "index": 1,         
                    "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",   
                    "type": "",
                    "value": "100000000000000000",                              
                    "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                    "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"
                },
                {
                    "index": 2,
                    "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                    "type": "",
                    "value": "344876432180959503648615581383",
                    "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                    "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                }
            ],
            "metadata": []
        }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取token交易列表

/{coin}/v1/token/txs

查询token的交易列表,可以通过传递address参数,获取某个地址的交易 支持的币种:ETH、ETC、BNB、HT、TRX

参数 类型 必须 备注
token_id string no 待查询的token id
address string no 待查询的地址

token id参数和address参数不能同时为空

返回的内容格式如下:



{
    "code": 0,
    "data": {
        "items": [
        {
            "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b",// 交易id
            "type": "token_transfer",                                                  // 交易类型,token_transfer表示token转账交易、contract_call表示合约调用交易,transfer表示普通转账
            "gas_limit": 139979,                                                       // gas limit                     
            "gas_price": "1000000000",                                                 // gas price
            "gas_used": 102040,                                                        // gas used
            "nonce": 31,                                                               // nonce值  
            "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",                      // 转出地址
            "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                        // 转入地址
            "fee": "102040000000000",                                                  // 手续费
            "date": 1620730114,                                                        // 时间戳
            "block": 10213589,                                                         // 区块块高
            "confirmation": 2427,                                                      // 确认数
            "status": "completed",                                                     // 交易状态
            "token_transfers": [                                                       // token转账内容           
                {
                    "index": 1,                                                        // 打包顺序
                    "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",          // token id(contract address)
                    "type": "",
                    "value": "100000000000000000",                                     // 数量
                    "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",              // token 转出地址
                    "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"                 // token 转入地址
                },
                {
                    "index": 2,
                    "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                    "type": "",
                    "value": "344876432180959503648615581383",
                    "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                    "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                }
            ],
            "metadata": []
        }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/token/txs?token_id=0xc778417e063141139fce010982780140aa0cd5ab'
Example Response
200 OK


{
    "code": 0,
    "data": {
        "items": [
        {
            "id": "0x3a5c680b49451775b67ad9b4846e553c5bd12fbd9e0d77dafd184b3a023e2b1b",
            "type": "token_transfer",                                          
            "gas_limit": 139979,                                               
            "gas_price": "1000000000",                                         
            "gas_used": 102040,                                               
            "nonce": 31,                                                       
            "from": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c",             
            "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",                
            "fee": "102040000000000",                                          
            "date": 1620730114,                                                
            "block": 10213589,                                                 
            "confirmation": 2427,                                              
            "status": "completed",                                             
            "token_transfers": [                                                
                {
                    "index": 1,         
                    "token_id": "0xc778417e063141139fce010982780140aa0cd5ab",   
                    "type": "",
                    "value": "100000000000000000",                              
                    "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                    "to": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f"
                },
                {
                    "index": 2,
                    "token_id": "0x902b2a515c43256158fde75f7de6f155e4a45c14",
                    "type": "",
                    "value": "344876432180959503648615581383",
                    "from": "0xd695dc9f79cf0b0f8c23e7f01aec354403747a3f",
                    "to": "0x3c98189b52fb2e1da681026d4f965ea4f2b7b13c"
                }
            ],
            "metadata": []
        }
        ],
        "nextkey": "",
    },
    "message": "OK"
}

# GET 获取某个地址的token统计信息

/{coin}/v1/token/info

支持的币种:ETH、ETC、BNB、HT、TRX

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:



{
    "code": 0,
    "data": [
        "address": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1", // 地址
        "coin": "eth",                                           // 币种
        "name": "Qkika Token",                                   // token 名称
        "symbol": "Qkika",                                       // token 符号
        "decimals": 6,                                           // token 精度
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6",// token id(合约地址)
        "balance": "1.238",                                      // 余额
        "total_txs": 6,                                          // 交易总数
    ],
    "message": "OK"
}



Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/token/info?address=0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1'
Example Response
200 OK


{
    "code": 0,
    "data": [
        "address": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",
        "coin": "eth",                                           
        "name": "Qkika Token",                                  
        "symbol": "Qkika",                                       
        "decimals": 6,                                          
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6",
        "balance": "1.238",                                     
        "total_txs": 6,                                       
    ],
    "message": "OK"
}

# GET 获取某个地址的token统计信息

/{coin}/v1/token/info

支持的币种:ETH、ETC、BNB、HT、TRX

参数 类型 必须 备注
address string yes 待查询的地址

返回的内容格式如下:



{
    "code": 0,
    "data": [
        "address": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1", // 地址
        "coin": "eth",                                           // 币种
        "name": "Qkika Token",                                   // token 名称
        "symbol": "Qkika",                                       // token 符号
        "decimals": 6,                                           // token 精度
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6",// token id(合约地址)
        "balance": "1.238",                                      // 余额
        "total_txs": 6,                                          // 交易总数
    ],
    "message": "OK"
}



Example Request
curl --location --request GET 'https://developers.viawallet.com/openapi/api/eth/v1/token/info?address=0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1'
Example Response
200 OK


{
    "code": 0,
    "data": [
        "address": "0xdb248d1ab299e2f453eb06d5ef5b1db531996cb1",
        "coin": "eth",                                           
        "name": "Qkika Token",                                  
        "symbol": "Qkika",                                       
        "decimals": 6,                                          
        "token_id": "0xf4beccb8440cfebbbd8a324623c1b2cce9b55ad6",
        "balance": "1.238",                                     
        "total_txs": 6,                                       
    ],
    "message": "OK"
}

# POST 初始化地址的交易信息

/{coin}/v1/address/init

ETH及其类似币种的接口默认返回6个月的历史交易数据,使用此接口可以得到关于某个地址的完整交易数据。

支持的币种:ETH、ETC、BNB、HT、TRX

支持的套餐:企业版

参数 类型 必须 备注
address string yes 待初始化的地址
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/eth/v1/init/address?address=0x7db6e6639df365366187c59b49749d1779fe24bc'
Example Response
200 OK

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

# POST 初始化地址的交易信息

/{coin}/v1/address/init

ETH及其类似币种的接口默认返回6个月的历史交易数据,使用此接口可以得到关于某个地址的完整交易数据。

支持的币种:ETH、ETC、BNB、HT、TRX

支持的套餐:企业版

参数 类型 必须 备注
address string yes 待初始化的地址
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/eth/v1/init/address?address=0x7db6e6639df365366187c59b49749d1779fe24bc'
Example Response
200 OK

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

# 广播交易

# POST 广播交易

/{coin}/v1/sendtx

广播签名好的交易

参数 类型 必须 备注
tx_raw string yes 签名好的原始交易

返回的内容格式如下:

{
    "code": 0,
    "message": "OK",
    "data": "53612a597bc416a5c0354b31023a3bb197468c8a81d1cad138629f56d50e1447" // 交易id
}
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/btc/v1/sendtx' \
--header 'Content-Type: application/json' \
--data-raw '{"tx_raw":"0100000001e5269c07fd5f609fe0cc479e365113f3054a8ebfc89ebd6d188defd3a2cc3c75010000006b483045022100c11aa61cebf9f4a337b07ef34b018a722a83a44f5f1db94d149cf7086f93aafa02200e2df5dfa6025a7292e5fc07a2508c98f4afe4bf59831f4c5fe1513728c5e80301210288521c776e00498c268215d12288b2b1ec87ba9b9bcee570df8b3da038d01f34ffffffff0222020000000000001976a9147e3f596889eb2c4666ea0823f05b0b7e0796192388ac79230000000000001976a9143a05fb822a4954af7d868d133963856fa3b5d7de88ac00000000"}'
Example Response
200 OK
{
    "code": 0,
    "message": "OK",
    "data": "53612a597bc416a5c0354b31023a3bb197468c8a81d1cad138629f56d50e1447"
}

# 广播交易

# POST 广播交易

/{coin}/v1/sendtx

广播签名好的交易

参数 类型 必须 备注
tx_raw string yes 签名好的原始交易

返回的内容格式如下:

{
    "code": 0,
    "message": "OK",
    "data": "53612a597bc416a5c0354b31023a3bb197468c8a81d1cad138629f56d50e1447" // 交易id
}
Example Request
curl --location --request POST 'https://developers.viawallet.com/openapi/api/btc/v1/sendtx' \
--header 'Content-Type: application/json' \
--data-raw '{"tx_raw":"0100000001e5269c07fd5f609fe0cc479e365113f3054a8ebfc89ebd6d188defd3a2cc3c75010000006b483045022100c11aa61cebf9f4a337b07ef34b018a722a83a44f5f1db94d149cf7086f93aafa02200e2df5dfa6025a7292e5fc07a2508c98f4afe4bf59831f4c5fe1513728c5e80301210288521c776e00498c268215d12288b2b1ec87ba9b9bcee570df8b3da038d01f34ffffffff0222020000000000001976a9147e3f596889eb2c4666ea0823f05b0b7e0796192388ac79230000000000001976a9143a05fb822a4954af7d868d133963856fa3b5d7de88ac00000000"}'
Example Response
200 OK
{
    "code": 0,
    "message": "OK",
    "data": "53612a597bc416a5c0354b31023a3bb197468c8a81d1cad138629f56d50e1447"
}

# 错误码

错误码 描述
404 路由不存在
1001 apikey 不能为空
1002 无效的 apikey
1003 请求过于频繁
1004 签名校验失败
1005 套餐到达上限或过期
1006 监控地址不存在
1007 不支持的币种
1008 监控地址已达上限
1009 地址无效
1010 监控地址已存在
1011 交易解析错误
1012 交易已在链上
1013 找不到inputs
1014 交易失败
上次更新: 6/16/2021, 8:37:20 PM