Avalanche SDK Client
    Preparing search index...

    Function getTx

    • Type Parameters

      • chain extends undefined | Chain

      Parameters

      • client: { extend: <const client extends { [key: string]: unknown }>(fn: (client: { extend: ... }) => client) => { [K in (...) | (...) | (...)]: (...)[(...)] } }

        The client to use. AvalancheCoreClient

      • params: GetTxParameters

        The transaction ID and encoding format. GetTxParameters

      Returns Promise<XChainTransactionType>

      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"
      })