Loading

get_transaction

Table function

Retrieves canonical transaction metadata via eth_getTransactionByHash with strict hash validation.

get_transaction(TRANSPORT, BYTES32)

Accepts BYTES32 hashes for type-safe queries without additional casting or padding.

Parameters

Name Type
transport TRANSPORT
tx_hash BYTES32

Result columns

Name Type
hash BYTES32
block_hash BYTES32
block_number BLOCK_NUMBER
transaction_index INTEGER
from ADDRESS
to ADDRESS
value UINT256
gas GAS
gas_price BIGINT
max_fee_per_gas BIGINT
max_priority_fee_per_gas BIGINT
input BLOB
nonce BIGINT
type INTEGER
v INTEGER
r BYTES32
s BYTES32
1
SELECT hash, "from", "to"
2
FROM get_transaction(
3
$transport, -- transport
4
'0x48c97bb3621228b39a6f701fe015b30cf74a5cfe6525d07bf79adca44d29bc17'::bytes32 -- tx_hash
5
);
Notebook ready in readonly mode.

get_transaction(TRANSPORT, VARCHAR)

Accepts 0x-prefixed VARCHAR hashes, enforcing 64 hex chars to match Ethereum RPC requirements.

Parameters

Name Type
transport TRANSPORT
tx_hash VARCHAR

Result columns

Name Type
hash BYTES32
block_hash BYTES32
block_number BLOCK_NUMBER
transaction_index INTEGER
from ADDRESS
to ADDRESS
value UINT256
gas GAS
gas_price BIGINT
max_fee_per_gas BIGINT
max_priority_fee_per_gas BIGINT
input BLOB
nonce BIGINT
type INTEGER
v INTEGER
r BYTES32
s BYTES32
1
SELECT hash, block_number
2
FROM get_transaction(
3
$transport, -- transport
4
'0x48c97bb3621228b39a6f701fe015b30cf74a5cfe6525d07bf79adca44d29bc17' -- tx_hash
5
);
Notebook ready in readonly mode.