Skip to content
SwapKit is a powerful suite of tools for building blockchain applications.

BaseEVMToolbox

BaseEVMToolbox<P, S>(__namedParameters): object

Defined in: packages/toolboxes/src/evm/toolbox/baseEVMToolbox.ts:52

P extends BrowserProvider | Provider

S extends undefined | ChainSigner<EVMTransferParams, string> & Signer | JsonRpcSigner | HDNodeWallet

EVMChain = Chain.Ethereum

boolean = true

P

S

object

approve: (__namedParameters) => Promise<string>

ApproveParams

Promise<string>

approvedAmount: (__namedParameters) => Promise<bigint>

IsApprovedParams

Promise<bigint>

broadcastTransaction: (signedTx) => Promise<TransactionResponse> | (signedTx) => Promise<TransactionResponse> = provider.broadcastTransaction

(signedTx) => Promise<TransactionResponse>

Broadcasts the %%signedTx%% to the network, adding it to the memory pool of any node for which the transaction meets the rebroadcast requirements.

string

Promise<TransactionResponse>

(signedTx) => Promise<TransactionResponse>

Broadcasts the %%signedTx%% to the network, adding it to the memory pool of any node for which the transaction meets the rebroadcast requirements.

string

Promise<TransactionResponse>

call: <T>(__namedParameters) => Promise<T>

T

CallParams

Promise<T>

createApprovalTx: (__namedParameters) => Promise<ContractTransaction>

ApproveParams

Promise<ContractTransaction>

createContract: (address, abi) => Contract

string

readonly (JsonFragment | Fragment)[]

Contract

createContractTxObject: (__namedParameters) => Promise<ContractTransaction>

CallParams

Promise<ContractTransaction>

createTransaction: (__namedParameters) => Promise<ContractTransaction>

EVMCreateTransactionParams

Promise<ContractTransaction>

createTransferTx: (__namedParameters) => Promise<ContractTransaction>

EVMCreateTransactionParams

Promise<ContractTransaction>

EIP1193SendTransaction: (__namedParameters) => Promise<string>

EVMTxParams | ContractTransaction

Promise<string>

estimateCall: (__namedParameters) => Promise<bigint>

EstimateCallParams

Promise<bigint>

estimateGasLimit: (__namedParameters) => Promise<bigint>

GenericTransferParams & object & object

Promise<bigint>

estimateGasPrices: () => Promise<{ average: { gasPrice?: bigint; l1GasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }; fast: { gasPrice?: bigint; l1GasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }; fastest: { gasPrice?: bigint; l1GasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }; }>

Promise<{ average: { gasPrice?: bigint; l1GasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }; fast: { gasPrice?: bigint; l1GasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }; fastest: { gasPrice?: bigint; l1GasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; }; }>

getAddress: () => undefined | Promise<string>

undefined | Promise<string>

isApproved: (__namedParameters) => Promise<boolean>

IsApprovedParams

Promise<boolean>

sendTransaction: (__namedParameters) => Promise<string>

EVMTxParams & object

Promise<string>

signMessage: undefined | (message) => Promise<string> | (message) => Promise<string> | (_message) => Promise<string> = signer.signMessage

undefined

(message) => Promise<string>

Signs an [[link-eip-191]] prefixed personal message.

If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is not interpretted as a [[BytesLike]]; so the string "0x1234" is signed as six characters, not two bytes.

To sign that example as two bytes, the Uint8Array should be used (i.e. new Uint8Array([ 0x12, 0x34 ])).

string | Uint8Array<ArrayBufferLike>

Promise<string>

(message) => Promise<string>

string | Uint8Array<ArrayBufferLike>

Promise<string>

(_message) => Promise<string>

string | Uint8Array<ArrayBufferLike>

Promise<string>

transfer: (__namedParameters) => Promise<string>

EVMTransferParams

Promise<string>

validateAddress: (address) => boolean

string

boolean