WalletClient class

Wallet client for signing and sending transactions.

Inheritance
Implemented types

Constructors

WalletClient({required RpcProvider provider, required ChainConfig chain, required Signer signer})

Properties

address String
The wallet address.
no setteroverride
ccipHandler ↔ CCIPReadHandler
CCIP-Read handler (EIP-3668).
getter/setter pairinherited
chain → ChainConfig
The chain configuration for this client.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
provider RpcProvider
The RPC provider.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signer Signer
The signer.
getter/setter pair
switchAccount Signer
Switches the signer.
no getter

Methods

call(CallRequest request, [String block = 'latest']) Future<Uint8List>
Executes a call without creating a transaction.
inherited
callDelegatedContract({required String contractAddress, required String functionSignature, required List args, BigInt? value, BigInt? gasLimit, BigInt? maxFeePerGas, BigInt? maxPriorityFeePerGas}) Future<String>
Calls a method on a delegated contract.
createAuthorization({required String contractAddress, required BigInt nonce}) Future<Authorization>
Creates and signs an EIP-7702 authorization for contract delegation.
createAuthorizationBatch({required List<String> contractAddresses, required BigInt startingNonce}) Future<List<Authorization>>
Creates and signs multiple EIP-7702 authorizations for batch delegation.
createRevocation({required BigInt nonce}) Future<Authorization>
Creates and signs a revocation authorization.
dispose() → void
Disposes of the client.
inherited
estimateEip7702Gas({required List<Authorization> authorizationList, String? to, BigInt? value, Uint8List? data}) Future<BigInt>
Estimates gas for an EIP-7702 transaction.
estimateGas(CallRequest request) Future<BigInt>
Estimates gas for a transaction.
inherited
getBalance(String address, [String block = 'latest']) Future<BigInt>
Gets the balance of an address.
inherited
getBlock(String blockHash) Future<Block?>
Gets a block by hash.
inherited
getBlockByNumber(String block) Future<Block?>
Gets a block by number.
inherited
getBlockNumber() Future<BigInt>
Gets the current block number.
inherited
getChainId() Future<int>
Gets the chain ID.
inherited
getCode(String address, [String block = 'latest']) Future<Uint8List>
Gets the code at an address.
inherited
getFeeData() Future<FeeData>
Gets fee data for EIP-1559 transactions.
inherited
getGasPrice() Future<BigInt>
Gets the current gas price.
inherited
getLogs(LogFilter filter) Future<List<Log>>
Gets logs matching a filter.
inherited
getTransaction(String txHash) Future<Transaction?>
Gets a transaction by hash.
inherited
getTransactionCount(String address, [String block = 'latest']) Future<BigInt>
Gets the transaction count (nonce) for an address.
inherited
getTransactionReceipt(String txHash) Future<TransactionReceipt?>
Gets a transaction receipt.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareTransaction(TransactionRequest request) Future<TransactionRequest>
Prepares a transaction by filling in missing fields.
revokeDelegation({required BigInt nonce, BigInt? gasLimit, BigInt? maxFeePerGas, BigInt? maxPriorityFeePerGas}) Future<String>
Revokes a previous delegation.
revokeMultipleDelegations({required List<BigInt> nonces, BigInt? gasLimit, BigInt? maxFeePerGas, BigInt? maxPriorityFeePerGas}) Future<String>
Revokes multiple delegations in a single transaction.
sendEip7702Transaction({required List<Authorization> authorizationList, String? to, BigInt? value, Uint8List? data, BigInt? gasLimit, BigInt? maxFeePerGas, BigInt? maxPriorityFeePerGas, BigInt? nonce}) Future<String>
Sends an EIP-7702 transaction with authorization list.
sendRawTransaction(String signedTx) Future<String>
Sends a raw signed transaction.
sendTransaction(Uint8List tx) Future<String>
Sends a transaction to the network. Standardized to Uint8List for raw transaction submission.
override
sendTransactionRequest(TransactionRequest request) Future<String>
High-level method to send a transaction request.
signAuthorization(Authorization authorization) Future<Uint8List>
Signs an EIP-7702 authorization.
signMessage(String message) Future<Uint8List>
Signs a message.
override
signTransaction(Uint8List tx) Future<Uint8List>
Signs a raw transaction.
override
signTransactionRequest(TransactionRequest transaction) Future<Uint8List>
Signs a transaction without sending.
signTypedData(EIP712TypedData typedData) Future<Uint8List>
Signs typed data (EIP-712).
toString() String
A string representation of this object.
inherited
transfer(String to, BigInt amount) Future<String>
Transfers native currency.

Operators

operator ==(Object other) bool
The equality operator.
inherited