Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

queryTx

Fetch an indexed transaction by hash.

Signature

function queryTx(
  client: Client,
  parameters: { hash: Base64 },
): Promise<TxResponse | null>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const tx = await client.queryTx({ hash: "abc123base64..." })
if (tx) {
  console.log(tx.height, tx.tx_result.code)
}

Parameters

hashBase64. The transaction hash.

Returns

TxResponse | nullnull if the indexer has not seen the transaction. tx_result.code === 0 means success; non-zero means failure.

Notes

  • signAndBroadcastTx polls this internally up to 30 times at 500ms intervals.
  • The indexer may lag behind the chain by a block or two; expect null immediately after broadcasting.

See also