For the complete documentation index, see llms.txt. This page is also available as Markdown.

tx- XRPL

Example code for the tx JSON RPC method. Complete guide to using tx JSON-RPC in the GetBlock Web3 documentation.

The tx method retrieves information on a single transaction, by its identifying hash.

Parameters

Parameter
Type
Required
Description

transaction

string

Yes

64-character transaction hash

binary

boolean

No

Return binary format

min_ledger

number

No

Minimum ledger to search

max_ledger

number

No

Maximum ledger to search

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS_TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "tx",
    "params": [{
        "transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9"
    }],
    "id": "getblock.io"
}'
const axios = require('axios');

const url = 'https://go.getblock.io/<ACCESS_TOKEN>/';
const headers = {
    'Content-Type': 'application/json'
};

const payload = {
    jsonrpc: '2.0',
    method: 'tx',
    params: [{
        transaction: 'C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9'
    }],
    id: 'getblock.io'
};

axios.post(url, payload, { headers })
    .then(response => console.log(response.data))
    .catch(error => console.error(error));

Response Example

Response Parameters

Parameter
Type
Description

TransactionType

string

Type of transaction

TransactionResult

string

Outcome

Field
Type
Description

hash

string

Transaction hash

ledger_index

integer

Ledger containing tx

meta

object

Transaction metadata

validated

boolean

Whether validated

Use Cases

  • Look up transaction

  • Verify payment status

  • Check transaction details

Error Handling

Error Code
Description

txnNotFound

Transaction not found

invalidParams

Invalid parameters

SDK Integration

Last updated

Was this helpful?