The client to use. AvalancheCoreClient
The transaction ID and encoding format. GetTxParameters
The transaction data. GetTxReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTx } from '@avalanche-sdk/client/methods/xchain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const tx = await getTx(client, {
txID: "2QouvMUbQ6tchBHSJdZ7MoFhsQhHt5KqZQqHdZ7MoFhsQhHt5KqZQ",
encoding: "hex"
})
Get a transaction by its ID.