writeContract method that can be used to call functions on a smart contract using the connected Abstract Global Wallet.
Usage
Parameters
Address
required
The address of the contract to write to.
Abi
required
The ABI of the contract to write to.
string
required
The name of the function to call on the contract.
unknown[]
The arguments to pass to the function.
Account
The account to use for the transaction. By default, this is set to the
Abstract Global Wallet’s account.
Chain
The chain to use for the transaction. By default, this is set to the chain
specified in the AbstractClient.
bigint
The amount of native token to send with the transaction (in wei).
Hex
Data to append to the end of the calldata. Useful for adding a “domain”
tag.
bigint
The amount of gas to pay per byte of data on Ethereum.
Account | Address
Address of the
paymaster smart
contract that will pay the gas fees of the transaction.
Hex
Input data to the paymaster. Required if
paymaster is provided.Returns
Returns aPromise<Hex> containing the transaction hash of the contract write operation.