@tevm/voltaire / primitives/DomainSeparator
primitives/DomainSeparator
Classes
InvalidDomainSeparatorLengthError
Defined in: src/primitives/DomainSeparator/errors.js:4 Error thrown when DomainSeparator length is invalidExtends
Error
Constructors
Constructor
new InvalidDomainSeparatorLengthError(Defined in: src/primitives/DomainSeparator/errors.js:9message,context):InvalidDomainSeparatorLengthError
Parameters
message
string
context
Record<string, unknown>
Returns
InvalidDomainSeparatorLengthError
Overrides
Error.constructor
Properties
context
context:Defined in: src/primitives/DomainSeparator/errors.js:12Record<string,unknown>
name
name: string
Defined in: src/primitives/DomainSeparator/errors.js:11
Inherited from
Error.name
Type Aliases
DomainSeparatorType
DomainSeparatorType =Defined in: src/primitives/DomainSeparator/DomainSeparatorType.ts:7 EIP-712 Domain Separator - keccak256 hash of domain separator Used in EIP-712 signature verification for domain separationUint8Array&object
Type Declaration
[brand]
readonly[brand]:"DomainSeparator"
length
readonlylength:32
Variables
SIZE
Defined in: src/primitives/DomainSeparator/DomainSeparatorType.ts:12constSIZE:32=32
Functions
_equals()
_equals(Defined in: src/primitives/DomainSeparator/equals.js:12 Check if two DomainSeparators are equala,b):boolean
Parameters
a
DomainSeparatorType
First DomainSeparator
b
DomainSeparatorType
Second DomainSeparator
Returns
boolean
True if equal
Example
_from()
_from(Defined in: src/primitives/DomainSeparator/from.js:17 Create DomainSeparator from string or bytesvalue):DomainSeparatorType
Parameters
value
Hex string with optional 0x prefix or Uint8Arraystring | Uint8Array<ArrayBufferLike>
Returns
DomainSeparatorType
DomainSeparator bytes
Throws
If input is invalid or wrong lengthExample
_fromBytes()
_fromBytes(Defined in: src/primitives/DomainSeparator/fromBytes.js:14 Create DomainSeparator from bytesbytes):DomainSeparatorType
Parameters
bytes
Uint8Array<ArrayBufferLike>
32-byte array
Returns
DomainSeparatorType
DomainSeparator
Throws
If bytes length is not 32Example
_fromHex()
_fromHex(Defined in: src/primitives/DomainSeparator/fromHex.js:15 Create DomainSeparator from hex stringhex):DomainSeparatorType
Parameters
hex
string
Hex string with optional 0x prefix (must be 66 chars with 0x or 64 without)
Returns
DomainSeparatorType
DomainSeparator
Throws
If hex string is invalid or wrong lengthExample
_toHex()
_toHex(Defined in: src/primitives/DomainSeparator/toHex.js:14 Convert DomainSeparator to hex string with 0x prefixseparator):string
Parameters
separator
DomainSeparatorType
DomainSeparator
Returns
string
Hex string with 0x prefix
Example
equals()
equals(Defined in: src/primitives/DomainSeparator/index.ts:42a,b):boolean
Parameters
a
DomainSeparatorType
b
DomainSeparatorType
Returns
boolean
from()
from(Defined in: src/primitives/DomainSeparator/index.ts:18value):DomainSeparatorType
Parameters
value
string | Uint8Array<ArrayBufferLike>
Returns
DomainSeparatorType
fromBytes()
fromBytes(Defined in: src/primitives/DomainSeparator/index.ts:24bytes):DomainSeparatorType
Parameters
bytes
Uint8Array
Returns
DomainSeparatorType
fromHex()
fromHex(Defined in: src/primitives/DomainSeparator/index.ts:30hex):DomainSeparatorType
Parameters
hex
string
Returns
DomainSeparatorType
toHex()
toHex(Defined in: src/primitives/DomainSeparator/index.ts:36separator):string
Parameters
separator
DomainSeparatorType
Returns
string
