FUNCTIONS
Computes the EIP-191 personal-sign message digest to sign.
This prefixes the message with MessagePrefix and the decimal length of message and computes the keccak256 digest.
If message is a string, it is converted to its UTF-8 bytes first. To compute the digest of a DataHexString, it must be converted to bytes.
hashMessage("Hello World")
// '0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2'
// Hashes the SIX (6) string characters, i.e.
// [ "0", "x", "4", "2", "4", "3" ]
hashMessage("0x4243")
// '0x6d91b221f765224b256762dcba32d62209cf78e9bebb0a1b758ca26c76db3af4'
// Hashes the TWO (2) bytes [ 0x42, 0x43 ]...
hashMessage(getBytes("0x4243"))
// '0x0d3abc18ec299cf9b42ba439ac6f7e3e6ec9f5c048943704e30fc2d9c7981438'
// ...which is equal to using data
hashMessage(new Uint8Array([ 0x42, 0x43 ]))
// '0x0d3abc18ec299cf9b42ba439ac6f7e3e6ec9f5c048943704e30fc2d9c7981438'
A simple hashing function which operates on UTF-8 strings to compute an 32-byte irentifier.
This simply computes the UTF-8 bytes and computes the keccak256.
id("hello world")
// '0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad'
Computes the Non-Standard Packed Mode representation of values respectively to their types.
addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
solidityPacked([ "address", "uint" ], [ addr, 45 ]);
// '0x8ba1f109551bd432803012645ac136ddd64dba72000000000000000000000000000000000000000000000000000000000000002d'
Computes the Non-Standard Packed Mode keccak256 hash of values respectively to their types.
addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]);
// '0x9465ddbc845149cfc7046bee85c30fd1b52b4f87d9c03ca8a0bd046868763030'
Computes the Non-Standard Packed Mode sha256 hash of values respectively to their types.
addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]);
// '0xb9d5d16842f6832018ea7bd1aa6aef22049eb966a5fb915470e22dfc3e2f828f'
<src>verifyTypedData(domain: TypedDataDomain, types: Record< string, Array< TypedDataField > >, value: Record< string, any >, signature: SignatureLike)⇒ string
PROPERTIES
PROPERTIES
CREATING INSTANCES
METHODS
<src>typedDataEncoder._visit(type: string, value: any, callback: (type: string, data: any) => any)⇒ any
<src>typedDataEncoder.visit(value: Record< string, any >, callback: (type: string, data: any) => any)⇒ any
STATIC METHODS
<src>TypedDataEncoder.encode(domain: TypedDataDomain, types: Record< string, Array< TypedDataField > >, value: Record< string, any >)⇒ string
<src>TypedDataEncoder.getPayload(domain: TypedDataDomain, types: Record< string, Array< TypedDataField > >, value: Record< string, any >)⇒ any
<src>TypedDataEncoder.hash(domain: TypedDataDomain, types: Record< string, Array< TypedDataField > >, value: Record< string, any >)⇒ string
<src>TypedDataEncoder.hashStruct(name: string, types: Record< string, Array< TypedDataField > >, value: Record< string, any >)⇒ string
<src>TypedDataEncoder.resolveNames(domain: TypedDataDomain, types: Record< string, Array< TypedDataField > >, value: Record< string, any >, resolveName: (name: string) => Promise< string >)⇒ Promise< { domain: TypedDataDomain , value: any } >
PROPERTIES