isValidTransaction
Checks if a Safe transaction can be executed successfully with no errors.
Usage
_30import {_30 MetaTransactionData,_30 OperationType,_30 TransactionOptions_30} from '@safe-global/types-kit'_30import { protocolKit } from './setup.ts'_30_30const transactions: MetaTransactionData[] = [{_30 to: '0x...',_30 value: '123',_30 data: '0x',_30 operation: OperationType.Call // Optional_30}]_30const safeTransaction = await protocolKit.createTransaction({_30 transactions_30})_30_30const options: TransactionOptions = {_30 from: '0x...', // Optional_30 gasLimit: '123', // Optional_30 gasPrice: '123', // Optional_30 maxFeePerGas: '123', // Optional_30 maxPriorityFeePerGas: '123', // Optional_30 nonce: 123 // Optional_30}_30_30const isValidTx = await protocolKit.isValidTransaction(_30 safeTransaction,_30 options // Optional_30)
Parameters
safeTransaction
The Safe transaction.
_10const isValidTx = await protocolKit.isValidTransaction(_10 safeTransaction_10)
options.from
(Optional)
- Type:
string
The address of the transaction sender.
_10const isValidTx = await protocolKit.isValidTransaction(_10 safeTransaction,_10 options: {_10 from: '0x...'_10 }_10)
options.gasLimit
(Optional)
- Type:
number | string | bigint
The maximum amount of gas the transaction can use.
_10const isValidTx = await protocolKit.isValidTransaction(_10 safeTransaction,_10 options: {_10 gasLimit: '123'_10 }_10)
options.gasPrice
(Optional)
- Type:
number | string
The price in wei that the sender is willing to pay for each unit of gas.
_10const isValidTx = await protocolKit.isValidTransaction(_10 safeTransaction,_10 options: {_10 gasPrice: '123'_10 }_10)
options.maxFeePerGas
(Optional)
- Type:
number | string
The maximum fee per gas the sender is willing to pay.
_10const isValidTx = await protocolKit.isValidTransaction(_10 safeTransaction,_10 options: {_10 maxFeePerGas: '123'_10 }_10)
options.maxPriorityFeePerGas
(Optional)
- Type:
number | string
The maximum priority fee per gas the sender is willing to pay.
_10const isValidTx = await protocolKit.isValidTransaction(_10 safeTransaction,_10 options: {_10 maxPriorityFeePerGas: '123'_10 }_10)
options.nonce
(Optional)
- Type:
number
The nonce of the transaction.
_10const isValidTx = await protocolKit.isValidTransaction(_10 safeTransaction,_10 options: {_10 nonce: 123_10 }_10)
Returns
Promise<boolean>
The boolean value that indicates if the transaction is valid.