Skip to main content

getTransaction

A builder function that returns the interaction to get a transaction by id.

Transaction id is a hash of the encoded transaction payload and can be calculated before submitting the transaction to the network. Transaction status represents the state of a transaction in the blockchain. Status can change until it is finalized.

The transaction id provided must be from the current spork.

Consider using 'fcl.tx(id).onceExecuted()' instead of calling this method directly for real-time transaction monitoring.

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.getTransaction(id)

Or import directly the specific function:


_10
import { getTransaction } from "@onflow/sdk"
_10
_10
getTransaction(id)

Usage


_10
import * as fcl from "@onflow/fcl";
_10
_10
const tx = await fcl.send([
_10
fcl.getTransaction("9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3")
_10
]).then(fcl.decode);

Parameters

id

  • Type: string

Returns

InteractionBuilderFn


_10
export type InteractionBuilderFn = (
_10
ix: Interaction
_10
) => Interaction | Promise<Interaction>


Rate this page