getTransaction - Stellar
Example code for the getTransaction JSON-RPC method. Complete guide on how to use getTransaction JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Description
Request examples
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getTransaction",
"params": {
"hash": "84b4d00835996d6dc7c56ac601aeb0560b0ee00fe4f9495417bd2e0efa474902"
},
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "getTransaction",
"params": {
"hash": "d8ec9b68780314ffdfdfc2194b1b35dd27d7303c3bceaef6447e31631a1419dc"
},
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"status": "SUCCESS",
"latestLedger": 2553978,
"latestLedgerCloseTime": "1700159337",
"oldestLedger": 2536698,
"oldestLedgerCloseTime": "1700072957",
"ledger": 2553920,
"createdAt": "1700159048",
"applicationOrder": 1,
"feeBump": false,
"envelopeXdr": "AAAAAgAAAAAg4dbAxs...",
"resultXdr": "AAAAAAAAAGT...",
"resultMetaXdr": "AAAAAwAAAA..."
}
}Response Parameters
Field
Type
Description
Use Case
Error Handling
Status Code
Error Message
Cause
Last updated
Was this helpful?