@tevm/voltaire / primitives/Authorization
primitives/Authorization
Classes
InvalidAddressError
Defined in: src/primitives/Authorization/errors.js:35 Authorization address cannot be zero addressThrows
Extends
Constructors
Constructor
new InvalidAddressError(Defined in: src/primitives/Authorization/errors.js:41address,options?):InvalidAddressError
Parameters
address
Uint8Array<ArrayBufferLike>
options?
cause?
Error
Returns
InvalidAddressError
Overrides
InvalidFormatError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidFormatError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidFormatError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidFormatError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidFormatError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidFormatError.expected
name
name: string
Defined in: src/primitives/Authorization/errors.js:49
Inherited from
InvalidFormatError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidFormatError.value
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidFormatError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidFormatError.toJSON
InvalidChainIdError
Defined in: src/primitives/Authorization/errors.js:12 Authorization chain ID must be non-zeroThrows
Extends
Constructors
Constructor
new InvalidChainIdError(Defined in: src/primitives/Authorization/errors.js:18chainId,options?):InvalidChainIdError
Parameters
chainId
bigint
options?
cause?
Error
Returns
InvalidChainIdError
Overrides
InvalidFormatError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidFormatError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidFormatError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidFormatError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidFormatError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidFormatError.expected
name
name: string
Defined in: src/primitives/Authorization/errors.js:26
Inherited from
InvalidFormatError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidFormatError.value
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidFormatError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidFormatError.toJSON
InvalidSignatureComponentError
Defined in: src/primitives/Authorization/errors.js:81 Authorization signature component cannot be zeroThrows
Extends
Constructors
Constructor
new InvalidSignatureComponentError(Defined in: src/primitives/Authorization/errors.js:88component,value,options?):InvalidSignatureComponentError
Parameters
component
string
‘r’ or ‘s’
value
bigint
options?
cause?
Error
Returns
InvalidSignatureComponentError
Overrides
InvalidSignatureError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidSignatureError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidSignatureError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidSignatureError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidSignatureError.docsPath
name
name: string
Defined in: src/primitives/Authorization/errors.js:95
Inherited from
InvalidSignatureError.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidSignatureError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidSignatureError.toJSON
InvalidSignatureRangeError
Defined in: src/primitives/Authorization/errors.js:104 Authorization signature r must be less than curve orderThrows
Extends
Constructors
Constructor
new InvalidSignatureRangeError(Defined in: src/primitives/Authorization/errors.js:111value,max,options?):InvalidSignatureRangeError
Parameters
value
bigint
max
bigint
options?
cause?
Error
Returns
InvalidSignatureRangeError
Overrides
InvalidRangeError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidRangeError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidRangeError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidRangeError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidRangeError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidRangeError.expected
name
name: string
Defined in: src/primitives/Authorization/errors.js:119
Inherited from
InvalidRangeError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidRangeError.value
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidRangeError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidRangeError.toJSON
InvalidYParityError
Defined in: src/primitives/Authorization/errors.js:58 Authorization yParity must be 0 or 1Throws
Extends
Constructors
Constructor
new InvalidYParityError(Defined in: src/primitives/Authorization/errors.js:64yParity,options?):InvalidYParityError
Parameters
yParity
number
options?
cause?
Error
Returns
InvalidYParityError
Overrides
InvalidRangeError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidRangeError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidRangeError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidRangeError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidRangeError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidRangeError.expected
name
name: string
Defined in: src/primitives/Authorization/errors.js:72
Inherited from
InvalidRangeError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidRangeError.value
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidRangeError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidRangeError.toJSON
MalleableSignatureError
Defined in: src/primitives/Authorization/errors.js:128 Authorization signature s too high (malleable signature)Throws
Extends
Constructors
Constructor
new MalleableSignatureError(Defined in: src/primitives/Authorization/errors.js:135s,max,options?):MalleableSignatureError
Parameters
s
bigint
max
bigint
options?
cause?
Error
Returns
MalleableSignatureError
Overrides
InvalidSignatureError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidSignatureError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidSignatureError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidSignatureError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidSignatureError.docsPath
name
name: string
Defined in: src/primitives/Authorization/errors.js:142
Inherited from
InvalidSignatureError.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidSignatureError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidSignatureError.toJSON
Interfaces
DelegationDesignation
Defined in: src/primitives/Authorization/types.js:20Properties
authority
authority: AddressType
Defined in: src/primitives/Authorization/types.js:21
Authority (signer) address
delegatedAddress
delegatedAddress: AddressType
Defined in: src/primitives/Authorization/types.js:22
Delegated code address
Unsigned
Defined in: src/primitives/Authorization/types.js:11Properties
address
address: AddressType
Defined in: src/primitives/Authorization/types.js:13
Address to delegate code execution to
chainId
chainId: bigint
Defined in: src/primitives/Authorization/types.js:12
Chain ID where authorization is valid
nonce
nonce: bigint
Defined in: src/primitives/Authorization/types.js:14
Nonce of the authorizing account
Type Aliases
AuthorizationType
AuthorizationType = object
Defined in: src/primitives/Authorization/AuthorizationType.ts:7
EIP-7702 Authorization branded type
Allows EOA to delegate code execution to another address
Properties
address
address: AddressType
Defined in: src/primitives/Authorization/AuthorizationType.ts:11
Address to delegate code execution to
chainId
chainId: bigint
Defined in: src/primitives/Authorization/AuthorizationType.ts:9
Chain ID where authorization is valid
nonce
nonce: bigint
Defined in: src/primitives/Authorization/AuthorizationType.ts:13
Nonce of the authorizing account
r
r: Uint8Array
Defined in: src/primitives/Authorization/AuthorizationType.ts:17
Signature r value (32 bytes)
s
s: Uint8Array
Defined in: src/primitives/Authorization/AuthorizationType.ts:19
Signature s value (32 bytes)
yParity
yParity: number
Defined in: src/primitives/Authorization/AuthorizationType.ts:15
Signature Y parity (0 or 1)
BrandedAuthorization
BrandedAuthorization = AuthorizationType
Defined in: src/primitives/Authorization/AuthorizationType.ts:25
Deprecated
Use AuthorizationType insteadVariables
Authorization
Defined in: src/primitives/Authorization/index.ts:163constAuthorization:object
Type Declaration
calculateGasCost()
calculateGasCost: (authList,emptyAccounts) =>bigint
Parameters
authList
AuthorizationType[]
emptyAccounts
number
Returns
bigint
equals()
equals: (a,b) =>boolean
Parameters
a
AddressType
b
AddressType
Returns
boolean
equalsAuth()
equalsAuth: (auth1,auth2) =>boolean
Parameters
auth1
AuthorizationType
auth2
AuthorizationType
Returns
boolean
format()
format: (auth) =>string
Parameters
auth
AuthorizationType | { address: AddressType; chainId: bigint; nonce: bigint; }
Returns
string
getGasCost()
getGasCost: (auth,isEmpty) =>bigint
Parameters
auth
AuthorizationType
isEmpty
boolean
Returns
bigint
hash
hash: HashFn
Hash()
Hash: (deps) =>HashFn
Parameters
deps
keccak256
(data) => Uint8Array
rlpEncode
(data) => Uint8Array
Returns
HashFn
isItem()
isItem: (value) =>boolean
Parameters
value
unknown
Returns
boolean
isUnsigned()
isUnsigned: (value) =>boolean
Parameters
value
unknown
Returns
boolean
MAGIC_BYTE
MAGIC_BYTE: number
EIP-7702 magic byte for signing hash
PER_AUTH_BASE_COST
PER_AUTH_BASE_COST: bigint
Base gas cost per authorization
PER_EMPTY_ACCOUNT_COST
PER_EMPTY_ACCOUNT_COST: bigint
Gas cost per empty account authorization
process()
process: (auth) =>object
Parameters
auth
AuthorizationType
Returns
object
authority
authority: AddressType
delegatedAddress
delegatedAddress: AddressType
processAll()
processAll: (authList) =>object[]
Parameters
authList
AuthorizationType[]
Returns
object[]
SECP256K1_HALF_N
SECP256K1_HALF_N: bigint
secp256k1 curve order N / 2 (for malleability check)
SECP256K1_N
SECP256K1_N: bigint
secp256k1 curve order N
sign
sign: SignFn
Sign()
Sign: (deps) =>SignFn
Parameters
deps
addressFromPublicKey
(x, y) => AddressType
keccak256
(data) => Uint8Array
recoverPublicKey
(signature, messageHash) => Uint8Array
rlpEncode
(data) => Uint8Array
sign
(messageHash, privateKey) => object
Returns
SignFn
validate()
validate: (auth) =>void
Parameters
auth
AuthorizationType
Returns
void
verify
verify: VerifyFn
Verify()
Verify: (deps) =>VerifyFn
Parameters
deps
addressFromPublicKey
(x, y) => AddressType
keccak256
(data) => Uint8Array
recoverPublicKey
(signature, messageHash) => Uint8Array
rlpEncode
(data) => Uint8Array
Returns
VerifyFn
calculateGasCost()
Defined in: src/primitives/Authorization/index.ts:97constcalculateGasCost: (authList,emptyAccounts) =>bigint=calculateGasCostImpl
Parameters
authList
AuthorizationType[]
emptyAccounts
number
Returns
bigint
equals()
Defined in: src/primitives/Authorization/index.ts:102constequals: (a,b) =>boolean=equalsImpl
Parameters
a
AddressType
b
AddressType
Returns
boolean
equalsAuth()
Defined in: src/primitives/Authorization/index.ts:104constequalsAuth: (auth1,auth2) =>boolean=equalsAuthImpl
Parameters
auth1
AuthorizationType
auth2
AuthorizationType
Returns
boolean
format()
Defined in: src/primitives/Authorization/index.ts:109constformat: (auth) =>string=formatImpl
Parameters
auth
AuthorizationType | { address: AddressType; chainId: bigint; nonce: bigint; }
Returns
string
getGasCost()
Defined in: src/primitives/Authorization/index.ts:115constgetGasCost: (auth,isEmpty) =>bigint=getGasCostImpl
Parameters
auth
AuthorizationType
isEmpty
boolean
Returns
bigint
hash
Defined in: src/primitives/Authorization/index.ts:135consthash:HashFn
Hash()
Defined in: src/primitives/Authorization/index.ts:43constHash: (deps) =>HashFn
Parameters
deps
keccak256
(data) => Uint8Array
rlpEncode
(data) => Uint8Array
Returns
HashFn
isItem()
Defined in: src/primitives/Authorization/index.ts:118constisItem: (value) =>boolean=isItemImpl
Parameters
value
unknown
Returns
boolean
isUnsigned()
Defined in: src/primitives/Authorization/index.ts:120constisUnsigned: (value) =>boolean=isUnsignedImpl
Parameters
value
unknown
Returns
boolean
MAGIC_BYTE
Defined in: src/primitives/Authorization/constants.js:8 EIP-7702 magic byte for signing hashconstMAGIC_BYTE:5=0x05
PER_AUTH_BASE_COST
Defined in: src/primitives/Authorization/constants.js:18 Base gas cost per authorizationconstPER_AUTH_BASE_COST:12500n=12500n
PER_EMPTY_ACCOUNT_COST
Defined in: src/primitives/Authorization/constants.js:13 Gas cost per empty account authorizationconstPER_EMPTY_ACCOUNT_COST:25000n=25000n
process()
Defined in: src/primitives/Authorization/index.ts:122constprocess: (auth) =>object=processImpl
Parameters
auth
AuthorizationType
Returns
object
authority
authority: AddressType
delegatedAddress
delegatedAddress: AddressType
processAll()
Defined in: src/primitives/Authorization/index.ts:127constprocessAll: (authList) =>object[] =processAllImpl
Parameters
authList
AuthorizationType[]
Returns
object[]
SECP256K1_HALF_N
Defined in: src/primitives/Authorization/constants.js:29 secp256k1 curve order N / 2 (for malleability check)constSECP256K1_HALF_N:bigint
SECP256K1_N
Defined in: src/primitives/Authorization/constants.js:23 secp256k1 curve order NconstSECP256K1_N:115792089237316195423570985008687907852837564279074904382605163141518161494337n=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n
sign
Defined in: src/primitives/Authorization/index.ts:148constsign:SignFn
Sign()
Defined in: src/primitives/Authorization/index.ts:49constSign: (deps) =>SignFn
Parameters
deps
addressFromPublicKey
(x, y) => AddressType
keccak256
(data) => Uint8Array
recoverPublicKey
(signature, messageHash) => Uint8Array
rlpEncode
(data) => Uint8Array
sign
(messageHash, privateKey) => object
Returns
SignFn
validate()
Defined in: src/primitives/Authorization/index.ts:132constvalidate: (auth) =>void=validateImpl
Parameters
auth
AuthorizationType
Returns
void
verify
Defined in: src/primitives/Authorization/index.ts:140constverify:VerifyFn
Verify()
Defined in: src/primitives/Authorization/index.ts:64constVerify: (deps) =>VerifyFn
Parameters
deps
addressFromPublicKey
(x, y) => AddressType
keccak256
(data) => Uint8Array
recoverPublicKey
(signature, messageHash) => Uint8Array
rlpEncode
(data) => Uint8Array
Returns
VerifyFn
Functions
authorityWasm()
authorityWasm(Defined in: src/primitives/Authorization/Authorization.wasm.ts:56 Recover authority (signer) from authorizationauth):AddressType
Parameters
auth
AuthorizationType
Authorization to recover from
Returns
AddressType
Recovered authority address
gasCostWasm()
gasCostWasm(Defined in: src/primitives/Authorization/Authorization.wasm.ts:73 Calculate gas cost for authorization listauthCount,emptyAccounts):bigint
Parameters
authCount
number
Number of authorizations
emptyAccounts
number
Number of empty accounts
Returns
bigint
Gas cost as bigint
signingHashWasm()
signingHashWasm(Defined in: src/primitives/Authorization/Authorization.wasm.ts:43 Calculate signing hash for authorizationchainId,address,nonce):HashType
Parameters
chainId
bigint
Chain ID
address
AddressType
Target address
nonce
bigint
Nonce
Returns
HashType
Signing hash
validateWasm()
validateWasm(Defined in: src/primitives/Authorization/Authorization.wasm.ts:25 Validate authorization structureauth):void
Parameters
auth
AuthorizationType
Authorization to validate
Returns
void

