Class: ReceiptTx
Utility that analyses transaction receipt response and provides helpers to process it
Example
const responseTx = new ReceiptTx(receipt);
responseTx.match({
success: (txR: SuccessfulTransactionReceiptResponse) => { },
rejected: (txR: RejectedTransactionReceiptResponse) => { },
reverted: (txR: RevertedTransactionReceiptResponse) => { },
error: (err: Error) => { },
});
responseTx.match({
success: (txR: SuccessfulTransactionReceiptResponse) => { },
_: () => { },
}
Implements​
Constructors​
constructor​
• new ReceiptTx(receipt
): ReceiptTx
Parameters​
Name | Type |
---|---|
receipt | GetTxReceiptResponseWithoutHelper |
Returns​
Defined in​
src/utils/transactionReceipt.ts:39
Properties​
statusReceipt​
• Readonly
statusReceipt: keyof TransactionStatusReceiptSets
Implementation of​
TransactionReceiptUtilityInterface.statusReceipt
Defined in​
src/utils/transactionReceipt.ts:35
value​
• Readonly
value: TransactionReceiptValue
Implementation of​
TransactionReceiptUtilityInterface.value
Defined in​
src/utils/transactionReceipt.ts:37
Methods​
isSuccess​
â–¸ isSuccess(transactionReceipt
): transactionReceipt is SuccessfulTransactionReceiptResponse
Parameters​
Name | Type |
---|---|
transactionReceipt | GetTxReceiptResponseWithoutHelper |
Returns​
transactionReceipt is SuccessfulTransactionReceiptResponse
Defined in​
src/utils/transactionReceipt.ts:86
isReverted​
â–¸ isReverted(transactionReceipt
): transactionReceipt is RevertedTransactionReceiptResponse
Parameters​
Name | Type |
---|---|
transactionReceipt | GetTxReceiptResponseWithoutHelper |
Returns​
transactionReceipt is RevertedTransactionReceiptResponse
Defined in​
src/utils/transactionReceipt.ts:95
isRejected​
â–¸ isRejected(transactionReceipt
): transactionReceipt is RejectedTransactionReceiptResponse
Parameters​
Name | Type |
---|---|
transactionReceipt | GetTxReceiptResponseWithoutHelper |
Returns​
transactionReceipt is RejectedTransactionReceiptResponse
Defined in​
src/utils/transactionReceipt.ts:104
match​
â–¸ match(callbacks
): void
Parameters​
Name | Type |
---|---|
callbacks | TransactionReceiptCallbacks |
Returns​
void
Implementation of​
TransactionReceiptUtilityInterface.match
Defined in​
src/utils/transactionReceipt.ts:63
isSuccess​
â–¸ isSuccess(): this is SuccessfulTransactionReceiptResponse
Returns​
this is SuccessfulTransactionReceiptResponse
Implementation of​
TransactionReceiptUtilityInterface.isSuccess
Defined in​
src/utils/transactionReceipt.ts:70
isReverted​
â–¸ isReverted(): this is RevertedTransactionReceiptResponse
Returns​
this is RevertedTransactionReceiptResponse
Implementation of​
TransactionReceiptUtilityInterface.isReverted
Defined in​
src/utils/transactionReceipt.ts:74
isRejected​
â–¸ isRejected(): this is RejectedTransactionReceiptResponse
Returns​
this is RejectedTransactionReceiptResponse
Implementation of​
TransactionReceiptUtilityInterface.isRejected
Defined in​
src/utils/transactionReceipt.ts:78
isError​
â–¸ isError(): boolean
Returns​
boolean
Implementation of​
TransactionReceiptUtilityInterface.isError