@kagamidigital/salt-sdk-mirror
    Preparing search index...

    Type Alias SaltTypedData

    EIP-712 typed structured data, in the same shape a wallet receives from an eth_signTypedData_v4 request. Pass it to Salt.signTypedData to have a Salt account sign it.

    primaryType must name one of the structs declared in types, and message must be an instance of that struct. Declaring EIP712Domain in types is optional — it is inferred from the fields present on domain when omitted.

    const typedData: SaltTypedData = {
    domain: {
    name: 'Salt Example',
    version: '1',
    chainId: 421614,
    verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
    },
    types: {
    Mail: [
    { name: 'from', type: 'address' },
    { name: 'to', type: 'address' },
    { name: 'contents', type: 'string' },
    ],
    },
    primaryType: 'Mail',
    message: {
    from: '0x1111111111111111111111111111111111111111',
    to: '0x2222222222222222222222222222222222222222',
    contents: 'Hello',
    },
    };
    type SaltTypedData = {
        domain: TypedDataDomain;
        message: Record<string, unknown>;
        primaryType: string;
        types: TypedData;
    }
    Index

    Properties

    domain: TypedDataDomain

    The EIP-712 domain separator fields (name, version, chainId, verifyingContract, salt). Every field is optional; the domain separator is built from exactly those present.

    message: Record<string, unknown>

    The struct instance to sign, keyed by the field names of primaryType.

    primaryType: string

    The name of the struct in types that message instantiates.

    types: TypedData

    The struct definitions referenced by primaryType, each an ordered list of { name, type } fields.