Icon LinkClass: TransactionResponse

@fuel-ts/providers.TransactionResponse

Represents a response for a transaction.

Icon LinkConstructors

Icon Linkconstructor

new TransactionResponse(id, provider)

Constructor for TransactionResponse.

Icon LinkParameters

NameTypeDescription
idstringThe transaction ID.
providerProviderThe provider.

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:101 Icon Link

Icon LinkProperties

Icon Linkattempts

attempts: number = 0

Number off attempts to get the committed tx

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:93 Icon Link


Icon LinkgasUsed

gasUsed: BN

Gas used on the transaction

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:91 Icon Link


Icon Linkid

id: string

Transaction ID

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:87 Icon Link


Icon Linkprovider

provider: Provider

Current provider

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:89 Icon Link

Icon LinkMethods

Icon LinkdecodeTransaction

decodeTransaction<TTransactionType>(transactionWithReceipts): Transaction<TTransactionType>

Decode the raw payload of the transaction.

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkParameters

NameTypeDescription
transactionWithReceiptsObjectThe transaction with receipts object.
transactionWithReceipts.__typename"Transaction"-
transactionWithReceipts.gasPrice?null | string-
transactionWithReceipts.idstring-
transactionWithReceipts.rawPayloadstring-
transactionWithReceipts.receipts?null | { __typename: "Receipt" ; amount?: null | string ; assetId?: null | string ; contract?: null | { __typename: "Contract" ; bytecode: string ; id: string } ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; is?: null | string ; len?: null | string ; nonce?: null | string ; param1?: null | string ; param2?: null | string ; pc?: null | string ; ptr?: null | string ; ra?: null | string ; rb?: null | string ; rc?: null | string ; rd?: null | string ; reason?: null | string ; receiptType: GqlReceiptType ; recipient?: null | string ; result?: null | string ; sender?: null | string ; subId?: null | string ; to?: null | { __typename: "Contract" ; bytecode: string ; id: string } ; toAddress?: null | string ; val?: null | string }[]-
transactionWithReceipts.status?null | { __typename: "FailureStatus" ; block: { __typename: "Block" ; id: string } ; reason: string ; time: any ; type: "FailureStatus" } | { __typename: "SqueezedOutStatus" ; type: "SqueezedOutStatus" } | { __typename: "SubmittedStatus" ; time: any ; type: "SubmittedStatus" } | { __typename: "SuccessStatus" ; block: { __typename: "Block" ; id: string } ; programState?: null | { __typename: "ProgramState" ; data: string ; returnType: GqlReturnType } ; time: any ; type: "SuccessStatus" }-

Icon LinkReturns

Transaction<TTransactionType>

The decoded transaction.

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:125 Icon Link


Icon Linkfetch

fetch(): Promise<GqlGetTransactionWithReceiptsQuery>

Fetch the transaction with receipts from the provider.

Icon LinkReturns

Promise<GqlGetTransactionWithReceiptsQuery>

Transaction with receipts query result.

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:111 Icon Link


Icon Linkwait

wait<TTransactionType>(): Promise<TransactionResult<TTransactionType>>

Waits for transaction to complete and returns the result.

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkReturns

Promise<TransactionResult<TTransactionType>>

The completed transaction.

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:194 Icon Link


Icon LinkwaitForResult

waitForResult<TTransactionType>(): Promise<TransactionResult<TTransactionType>>

Waits for transaction to complete and returns the result.

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkReturns

Promise<TransactionResult<TTransactionType>>

The completed transaction result

Icon LinkDefined in

packages/providers/src/transaction-response/transaction-response.ts:139 Icon Link