Authorization class
EIP-7702 authorization for EOA code delegation.
Constructors
- Authorization({required int chainId, required String address, required BigInt nonce, int? yParity, BigInt? r, BigInt? s})
-
Authorization.fromJson(Map<
String, dynamic> json) -
Creates an authorization from JSON.
factory
- Authorization.fromRlpList(List rlpList)
-
Creates an authorization from RLP list.
factory
- Authorization.revocation({required int chainId, required BigInt nonce})
-
Creates a revocation authorization.
factory
- Authorization.unsigned({required int chainId, required String address, required BigInt nonce})
-
Creates an unsigned authorization.
factory
Properties
- address → String
-
The contract address to delegate to.
final
- chainId → int
-
The chain ID.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isRevocation → bool
-
Whether this authorization is a revocation (address is zero).
no setter
- isSigned → bool
-
Whether this authorization is signed.
no setter
- nonce → BigInt
-
The nonce.
final
- r → BigInt
-
The signature r value.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- s → BigInt
-
The signature s value.
final
- yParity → int
-
The signature y-parity (0 or 1).
final
Methods
-
getMessageHash(
) → Uint8List - Gets the message hash for signing this authorization.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sign(
Uint8List privateKey) → Authorization - Signs this authorization with the given private key.
-
toJson(
) → Map< String, dynamic> - Converts this authorization to JSON.
-
toRlpList(
) → List - Encodes this authorization for RLP encoding in transactions.
-
toString(
) → String -
A string representation of this object.
inherited
-
verifySignature(
String expectedSigner) → bool - Verifies the signature of this authorization.
-
withSignature(
{required int yParity, required BigInt r, required BigInt s}) → Authorization - Creates a signed authorization.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited