Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
TransactionResponse

Icon LinkClass: TransactionResponse

@fuel-ts/account .TransactionResponse

Represents a response for a transaction.

Icon LinkConstructors

Icon Linkconstructor

new TransactionResponse(tx, provider, abis?): TransactionResponse

Constructor for TransactionResponse.

Icon LinkParameters

NameTypeDescription
txstring | TransactionRequest The transaction ID or TransactionRequest.
providerProvider The provider.
abis?JsonAbisFromAllCalls -

Icon LinkReturns

TransactionResponse

Icon LinkDefined in

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

Icon LinkProperties

Icon Linkabis

Optional abis: JsonAbisFromAllCalls

Icon LinkDefined in

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


Icon LinkgasUsed

gasUsed: BN

Gas used on the transaction

Icon LinkDefined in

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


Icon LinkgqlTransaction

Private Optional gqlTransaction: Object

The graphql Transaction with receipts object.

Icon LinkType declaration

NameType
idstring
rawPayloadstring
status?null | { block: { id: string } ; reason: string ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "FailureStatus" } | { reason: string ; type: "SqueezedOutStatus" } | { time: string ; type: "SubmittedStatus" } | { block: { id: string } ; programState?: null | { data: string ; returnType: GqlReturnType } ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "SuccessStatus" }

Icon LinkDefined in

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


Icon Linkid

id: string

Transaction ID

Icon LinkDefined in

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


Icon Linkprovider

provider: Provider

Current provider

Icon LinkDefined in

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


Icon Linkrequest

Private Optional request: TransactionRequest

Icon LinkDefined in

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


Icon Linkstatus

Private Optional status: { block: { id: string } ; reason: string ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; transaction: { inputs?: null | ({ txPointer: string ; type: "InputCoin" } | { txPointer: string ; type: "InputContract" } | { type: "InputMessage" })[] ; outputs: ({ amount: string ; assetId: string ; to: string ; type: "ChangeOutput" } | { amount: string ; assetId: string ; to: string ; type: "CoinOutput" } | { contract: string ; stateRoot: string ; type: "ContractCreated" } | { balanceRoot: string ; inputIndex: string ; stateRoot: string ; type: "ContractOutput" } | { amount: string ; assetId: string ; to: string ; type: "VariableOutput" })[] ; receiptsRoot?: null | string } ; type: "FailureStatus" } | { reason: string ; type: "SqueezedOutStatus" } | { time: string ; type: "SubmittedStatus" } | { block: { id: string } ; programState?: null | { data: string ; returnType: GqlReturnType } ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; transaction: { inputs?: null | ({ txPointer: string ; type: "InputCoin" } | { txPointer: string ; type: "InputContract" } | { type: "InputMessage" })[] ; outputs: ({ amount: string ; assetId: string ; to: string ; type: "ChangeOutput" } | { amount: string ; assetId: string ; to: string ; type: "CoinOutput" } | { contract: string ; stateRoot: string ; type: "ContractCreated" } | { balanceRoot: string ; inputIndex: string ; stateRoot: string ; type: "ContractOutput" } | { amount: string ; assetId: string ; to: string ; type: "VariableOutput" })[] ; receiptsRoot?: null | string } ; type: "SuccessStatus" }

Icon LinkDefined in

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

Icon LinkMethods

Icon LinkapplyMalleableSubscriptionFields

applyMalleableSubscriptionFields<TTransactionType>(transaction): void

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkParameters

NameType
transactionTransaction<TTransactionType>

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkassembleResult

assembleResult<TTransactionType>(contractsAbiMap?): Promise<TransactionResult<TTransactionType>>

Assembles the result of a transaction by retrieving the transaction summary, decoding logs (if available), and handling transaction failure.

This method can be used to obtain the result of a transaction that has just been submitted or one that has already been processed.

Throws

If the transaction status is a failure.

Icon LinkType parameters

NameTypeDescription
TTransactionTypevoidThe type of the transaction.

Icon LinkParameters

NameTypeDescription
contractsAbiMap?AbiMap The map of contract ABIs.

Icon LinkReturns

Promise<TransactionResult<TTransactionType>>

  • The assembled transaction result.

Icon LinkDefined in

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


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.idstring-
transactionWithReceipts.rawPayloadstring-
transactionWithReceipts.status?null | { block: { id: string } ; reason: string ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "FailureStatus" } | { reason: string ; type: "SqueezedOutStatus" } | { time: string ; type: "SubmittedStatus" } | { block: { id: string } ; programState?: null | { data: string ; returnType: GqlReturnType } ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "SuccessStatus" }-

Icon LinkReturns

Transaction<TTransactionType>

The decoded transaction.

Icon LinkDefined in

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


Icon Linkfetch

fetch(): Promise<{ id: string ; rawPayload: string ; status?: null | { block: { id: string } ; reason: string ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "FailureStatus" } | { reason: string ; type: "SqueezedOutStatus" } | { time: string ; type: "SubmittedStatus" } | { block: { id: string } ; programState?: null | { data: string ; returnType: GqlReturnType } ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "SuccessStatus" } }>

Fetch the transaction with receipts from the provider.

Icon LinkReturns

Promise<{ id: string ; rawPayload: string ; status?: null | { block: { id: string } ; reason: string ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "FailureStatus" } | { reason: string ; type: "SqueezedOutStatus" } | { time: string ; type: "SubmittedStatus" } | { block: { id: string } ; programState?: null | { data: string ; returnType: GqlReturnType } ; receipts: { amount?: null | string ; assetId?: null | string ; contractId?: null | string ; data?: null | string ; digest?: null | string ; gas?: null | string ; gasUsed?: null | string ; id?: 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 | string ; toAddress?: null | string ; val?: null | string }[] ; time: string ; totalFee: string ; totalGas: string ; type: "SuccessStatus" } }>

Transaction with receipts query result.

Icon LinkDefined in

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


Icon LinkgetReceipts

getReceipts(): TransactionResultReceipt[]

Icon LinkReturns

TransactionResultReceipt[]

Icon LinkDefined in

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


Icon LinkgetTransaction

getTransaction<TTransactionType>(): Promise<{ bytes: Uint8Array ; tx: Transaction<TTransactionType> }>

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkReturns

Promise<{ bytes: Uint8Array ; tx: Transaction<TTransactionType> }>

Icon LinkDefined in

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


Icon LinkgetTransactionSummary

getTransactionSummary<TTransactionType>(contractsAbiMap?): Promise<TransactionSummary <TTransactionType>>

Retrieves the TransactionSummary. If the gqlTransaction is not set, it will fetch it from the provider

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkParameters

NameTypeDescription
contractsAbiMap?AbiMap The contracts ABI map.

Icon LinkReturns

Promise<TransactionSummary <TTransactionType>>

Icon LinkDefined in

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


Icon LinkunsetResourceCache

unsetResourceCache(): void

Icon LinkReturns

void

Icon LinkDefined in

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


Icon Linkwait

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

Waits for transaction to complete and returns the result.

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkParameters

NameTypeDescription
contractsAbiMap?AbiMap The contracts ABI map.

Icon LinkReturns

Promise<TransactionResult<TTransactionType>>

Icon LinkDefined in

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


Icon LinkwaitForResult

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

Waits for transaction to complete and returns the result.

Icon LinkType parameters

NameType
TTransactionTypevoid

Icon LinkParameters

NameType
contractsAbiMap?AbiMap

Icon LinkReturns

Promise<TransactionResult<TTransactionType>>

The completed transaction result

Icon LinkDefined in

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


Icon LinkwaitForStatusChange

waitForStatusChange(): Promise<void>

Icon LinkReturns

Promise<void>

Icon LinkDefined in

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


Icon Linkcreate

create(id, provider, abis?): Promise<TransactionResponse >

Async constructor for TransactionResponse. This method can be used to create an instance of TransactionResponse and wait for the transaction to be fetched from the chain, ensuring that the gqlTransaction property is set.

Icon LinkParameters

NameTypeDescription
idstringThe transaction ID.
providerProvider The provider.
abis?JsonAbisFromAllCalls -

Icon LinkReturns

Promise<TransactionResponse >

Icon LinkDefined in

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