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