-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP API 接口 #1
Comments
交易数据 (transactions)GET /v1/transactions/{txid}按照 txid 获取交易的详细信息。 request"txid" : 即交易的哈希值 response{
"txid" : "af1234d...",
"version" : "1",
"inputs" : [
{
"value_source" : {
"txid" : "string",
"index" : "2"
},
"redeem_script" : "string",
"unlock_script" : "string",
"sequence" : "string",
}
],
"outputs" : [
{
"value" : "123",
"script_hash" : "string"
}
],
"evidences" : [
{
"evid" : "af1234d...",
"digest" : "hex_string",
"source" : "hex_string",
"valid_script" : "hex_string"
}
],
"lock_time" : "12345"
} |
凭证数据 (evidences)GET /v1/evidences/{evid}按照 evid 获取凭证的详细信息。 request"evid" : 即凭证的唯一 ID response{
"evid" : "af1234d...",
"digest" : "hex_string",
"source" : "hex_string",
"valid_script" : "hex_string"
} |
@Qearlyy 目前根据你的设计,重点关注以下几个接口即可:
|
钱包数据 (wallet)GET /v1/wallet/status获取钱包的基础信息。 requestresponse{
"tx_count" : 123,
"evid_count" : 123,
"balance" : "float64_in_string"
} GET /v1/wallet/addresses获取钱包内的所有地址和地址对应的余额。 requestresponse{
"addresses" : [
{
"address" : "address_in_string",
"balance" : "balance_in_float64"
}
]
} GET /v1/wallet/balance获取钱包内的总余额。 requestresponse{
"balance" : "float64_in_string"
} GET /v1/wallet/transactions获取钱包内地址相关的所有交易 ID。 requestresponse{
"transactions" : [
"txid_in_string",
"txid_in_string"
]
} GET /v1/wallet/evidences获取钱包内地址相关的所有存证 ID。 requestresponse{
"evidences" : [
"evid_in_string",
"evid_in_string"
]
} POST /v1/wallet/addresses在钱包中创建新的交易地址。 request{
"password" : "string"
} response{
"address" : "string",
"success" : true,
"error" : "string",
} POST /v1/wallet/transactions/creating创建交易。 request{
"to_address" : "address",
"value" : "float64_in_string",
"file" : "file_path",
"digest_mode" : "string"
} response{
"hex" : "hex_string",
"success" : true,
"error" : "string"
} POST /v1/wallet/transactions/sending签名并发送交易。 request{
"hex" : "hex_string",
"password" : "string"
} response{
"txid" : "txid_in_string",
"success" : true,
"error" : "string"
} |
客户端数据 (client)GET /v1/client/status获取客户端状态。 requestresponse{
"local_block_height" : "uint64_in_string",
"known_block_height" : "uint64_in_string",
"mining" : true,
"peer_listening" : true
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
区块数据 (blocks)
关于 path 中的
id
字段,表示块哈希时应拼接为"hash-1a4def82..."
,表示块高度时应拼接为"height-123"
。GET /v1/blocks/best
获取区块链的当前最新块。
request
null
response
GET /v1/blocks/{id}
按块哈希或块高度获取区块的主要信息。
request
response
GET /v1/blocks/{id}/header
按块哈希或块高度获取区块的区块头。
request
response
GET /v1/blocks/{id}/verbose/{verbose}
按块哈希或块高度获取区块的详细信息,详细等级由
verbose
确定。request
response
当 verbose == 0 时,返回值如下:
当 verbose == 1 时,返回值如下:
The text was updated successfully, but these errors were encountered: