AuthorizationBuilder class

A high-level builder responsible for constructing EIP-7702 authorization messages for an externally owned account (EOA).

An AuthorizationBuilder uses the shared context provided by Eip7702Base and utilities from Eip7702Common to:

This builder is typically used prior to creating a type 0x04 EIP-7702 transaction, where the resulting authorization tuple is included in the transaction’s authorizationList.

Example usage

final builder = AuthorizationBuilder(ctx);
final tuple = await builder.buildAndSignIfNeeded(signer, eoa);
Inheritance
Mixed-in types

Properties

ctx Eip7702Context
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildAndSign({required Signer signer, Executor? executor, BigInt? nonceOverride}) Future<AuthorizationTuple>
Builds an unsigned EIP-7702 authorization for the signer’s address and returns a fully signed AuthorizationTuple.
buildAndSignIfNeeded({required Signer signer, Executor? executor}) Future<AuthorizationTuple?>
Builds and signs a new authorization tuple only if the EOA is not already delegated to the configured implementation.
buildUnsigned({required EthereumAddress eoa, Executor? executor, HexString? delegateOverride, BigInt? nonceOverride}) Future<UnsignedAuthorization>
Constructs an UnsignedAuthorization record for the specified EOA, resolving the required chain ID, nonce, and delegate address.
getDelegatedImpl(EthereumAddress eoa) Future<Uint8List?>
Reads the on-chain bytecode of an externally owned account (EOA) and extracts the delegated implementation address if the account has been upgraded via EIP-7702.
inherited
getFeeData([TransactionSpeed speed = TransactionSpeed.normal]) Future<({BigInt maxFeePerGas, BigInt maxPriorityFeePerGas})>
Retrieves EIP-1559 fee parameters (maxFeePerGas and maxPriorityFeePerGas) from the network and returns a preset based on the requested TransactionSpeed.
inherited
getNonce(EthereumAddress address) Future<BigInt>
Returns the next available transaction nonce for the given Ethereum address.
inherited
isDelegatedTo(EthereumAddress eoa, EthereumAddress impl) Future<bool>
Checks whether the given externally owned account (EOA) is currently delegated to the specified implementation address.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveChainId() Future<BigInt>
Resolves and returns the active chain ID for the current context.
inherited
resolveNonce(EthereumAddress eoa, [Executor? executor, BigInt? nonceOverride]) Future<BigInt>
Resolves the next transaction nonce for the given externally owned account (EOA).
inherited
toString() String
A string representation of this object.
inherited

Operators

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