ContractHandler
ContractHandler: <
TAbi
,TFunctionName
>(action
) =>Promise
<ContractResult
<TAbi
,TFunctionName
>>
Handler for executing contract interactions with the TEVM.
This handler is adapted from viem and is designed to closely match the viem contractRead
/contractWrite
API.
It encodes the ABI, function name, and arguments to perform the contract call.
Type Parameters
• TAbi extends Abi
| readonly unknown
[] = Abi
The ABI type.
• TFunctionName extends ContractFunctionName
<TAbi
> = ContractFunctionName
<TAbi
>
The function name type from the ABI.
Parameters
• action: ContractParams
<TAbi
, TFunctionName
>
The parameters for the contract call, including ABI, function name, and arguments.
Returns
Promise
<ContractResult
<TAbi
, TFunctionName
>>
The result of the contract call, including execution details and any returned data.
Throws
If throwOnFail
is true, returns TevmCallError
as value.