⚡ We welcome businesses to test our enterprise-grade service

btg
Bitcoin Gold (BTG)

Method: POST getrawtransaction

dropdown

方法 RPC getrawtransaction 例如 Bitcoin Gold (BTG)

POST getrawtransaction

返回原始交易数据。

默认情况下,此功能仅适用于MEMPOOL交易。 当使用Blockhash参数调用时,如果有指定的块可用,并且在该块中找到了交易,则GetRawTransaction将返回交易。 如果无块状参数调用,则getRawtransaction如果在MEMPOOL中或启用了-txindex,并且交易在区块链中的块中,则将返回该事务。

Parameters

txid - 字符串,需要

交易ID

verbose - 布尔值,可选,默认值= false

如果false,请返回字符串,否则返回JSON对象

blockhash - 字符串,可选

寻找交易的块

Request

curl --location --request POST 'https://btg.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0",
"method": "getrawtransaction",
"params": ["5c970c064d317658a8777ee56f192fe17d5b3afbe242d820b205c2291210f269", null, null],
"id": "getblock.io"}'


Response

{
    "error": null,
    "id": "getblock.io",
    "result": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff320336b80a005a2d4e4f4d50212068747470733a2f2f6769746875622e636f6d2f6a6f7368756179616275742f7a2d6e6f6d70ffffffff0240be4025000000001976a9140cb60a52559620e5de9a297612d49f55f7fd14ea88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000"
}