Skip to main content
Version: 10.8.0

Function: encodeData()

encodeData<T>(types, type, data, revision?): [string[], string[]]

Defined in: src/utils/typedData.ts:481

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​

T​

T extends TypedData

Parameters​

types​

T["types"]

The types object containing all defined types.

type​

string

The name of the type to encode.

data​

T["message"]

The data to encode.

revision?​

TypedDataRevision = Revision.LEGACY

The revision of the TypedData.

Returns​

[string[], string[]]

The ABI compatible types and corresponding values.