@fuel-ts/account v0.97.0 • Docs
Represents a response for a transaction.
new TransactionResponse(
tx
,provider
,abis
?,submitTxSubscription
?):TransactionResponse
Constructor for TransactionResponse
.
• tx: string
| TransactionRequest
The transaction ID or TransactionRequest.
• provider: Provider
The provider.
• abis?: JsonAbisFromAllCalls
• submitTxSubscription?: AsyncIterable
<GqlSubmitAndAwaitStatusSubscription
, any
, any
>
packages/account/src/providers/transaction-response/transaction-response.ts:145
optional
abis:JsonAbisFromAllCalls
packages/account/src/providers/transaction-response/transaction-response.ts:137
gasUsed:
BN
Gas used on the transaction
packages/account/src/providers/transaction-response/transaction-response.ts:132
id:
string
Transaction ID
packages/account/src/providers/transaction-response/transaction-response.ts:128
provider:
Provider
Current provider
packages/account/src/providers/transaction-response/transaction-response.ts:130
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.
• TTransactionType = void
The type of the transaction.
• contractsAbiMap?: AbiMap
The map of contract ABIs.
Promise
<TransactionResult
<TTransactionType
>>
If the transaction status is a failure.
packages/account/src/providers/transaction-response/transaction-response.ts:362
decodeTransaction<
TTransactionType
>(transactionWithReceipts
):Transaction
<TTransactionType
>
Decode the raw payload of the transaction.
• TTransactionType = void
• transactionWithReceipts: GqlTransaction
The transaction with receipts object.
Transaction
<TTransactionType
>
The decoded transaction.
packages/account/src/providers/transaction-response/transaction-response.ts:278
fetch():
Promise
<GqlTransaction
>
Fetch the transaction with receipts from the provider.
Promise
<GqlTransaction
>
Transaction with receipts query result.
packages/account/src/providers/transaction-response/transaction-response.ts:247
getTransactionSummary<
TTransactionType
>(contractsAbiMap
?):Promise
<TransactionSummary
<TTransactionType
>>
Retrieves the TransactionSummary. If the gqlTransaction
is not set, it will
fetch it from the provider
• TTransactionType = void
• contractsAbiMap?: AbiMap
The contracts ABI map.
Promise
<TransactionSummary
<TTransactionType
>>
packages/account/src/providers/transaction-response/transaction-response.ts:292
wait<
TTransactionType
>(contractsAbiMap
?):Promise
<TransactionResult
<TTransactionType
>>
Waits for transaction to complete and returns the result.
• TTransactionType = void
• contractsAbiMap?: AbiMap
The contracts ABI map.
Promise
<TransactionResult
<TTransactionType
>>
packages/account/src/providers/transaction-response/transaction-response.ts:416
waitForResult<
TTransactionType
>(contractsAbiMap
?):Promise
<TransactionResult
<TTransactionType
>>
Waits for transaction to complete and returns the result.
• TTransactionType = void
• contractsAbiMap?: AbiMap
Promise
<TransactionResult
<TTransactionType
>>
The completed transaction result
packages/account/src/providers/transaction-response/transaction-response.ts:404
static
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.
• id: string
The transaction ID.
• provider: Provider
The provider.
• abis?: JsonAbisFromAllCalls
Promise
<TransactionResponse
>
packages/account/src/providers/transaction-response/transaction-response.ts:166