Namespace: typedData
References​
StarkNetMerkleType​
Re-exports StarkNetMerkleType
StarkNetType​
Re-exports StarkNetType
StarkNetDomain​
Re-exports StarkNetDomain
TypedData​
Re-exports TypedData
Functions​
prepareSelector​
â–¸ prepareSelector(selector
): string
Parameters​
Name | Type |
---|---|
selector | string |
Returns​
string
Defined in​
isMerkleTreeType​
â–¸ isMerkleTreeType(type
): type is StarkNetMerkleType
Parameters​
Name | Type |
---|---|
type | StarkNetType |
Returns​
type is StarkNetMerkleType
Defined in​
getDependencies​
â–¸ getDependencies(types
, type
, dependencies?
): string
[]
Get the dependencies of a struct type. If a struct has the same dependency multiple times, it's only included once in the resulting array.
Parameters​
Name | Type | Default value |
---|---|---|
types | Record <string , StarkNetType []> | undefined |
type | string | undefined |
dependencies? | string [] | [] |
Returns​
string
[]
Defined in​
encodeType​
â–¸ encodeType(types
, type
): string
Encode a type to a string. All dependent types are alphabetically sorted.
Parameters​
Name | Type |
---|---|
types | Record <string , StarkNetType []> |
type | string |
Returns​
string
Defined in​
getTypeHash​
â–¸ getTypeHash(types
, type
): string
Get a type string as hash.
Parameters​
Name | Type |
---|---|
types | Record <string , StarkNetType []> |
type | string |
Returns​
string
Defined in​
encodeValue​
â–¸ encodeValue(types
, type
, data
, ctx?
): [string
, string
]
Encodes a single value to an ABI serialisable string, number or Buffer. Returns the data as tuple, which consists of an array of ABI compatible types, and an array of corresponding values.
Parameters​
Name | Type |
---|---|
types | Record <string , StarkNetType []> |
type | string |
data | unknown |
ctx | Context |
Returns​
[string
, string
]
Defined in​
encodeData​
â–¸ encodeData<T
>(types
, type
, data
): string
[][]
Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values. All dependent types are automatically encoded.
Type parameters​
Name | Type |
---|---|
T | extends TypedData |
Parameters​
Name | Type |
---|---|
types | T ["types" ] |
type | string |
data | T ["message" ] |
Returns​
string
[][]
Defined in​
getStructHash​
â–¸ getStructHash<T
>(types
, type
, data
): string
Get encoded data as a hash. The data should be a key -> value object with all the required values. All dependent types are automatically encoded.
Type parameters​
Name | Type |
---|---|
T | extends TypedData |
Parameters​
Name | Type |
---|---|
types | T ["types" ] |
type | string |
data | T ["message" ] |
Returns​
string
Defined in​
getMessageHash​
â–¸ getMessageHash(typedData
, account
): string
Get the EIP-191 encoded message to sign, from the typedData object.
Parameters​
Name | Type |
---|---|
typedData | TypedData |
account | BigNumberish |
Returns​
string