Account Abstraction
SDK
Signature
Get Sign Typed Data Hash

Get Sign Typed Data Hash

Overview

This SDK method allows you to generate a hash for typed data that can be signed by a smart account. This is useful for verifying the integrity and authenticity of structured data following the EIP-712 standard.

Method

xellar.accountAbstraction.signature.getSignTypedDataHash({
  accountId: string,
  typedData: {
    domain: {
      name: string,
      version: string,
      chainId: number,
      verifyingContract: string
    },
    types: {
      [key: string]: Array<{
        name: string,
        type: string
      }>
    },
    primaryType: string,
    message: Record<string, any>
  }
});

Parameters

  • accountId (required): The unique identifier of the smart account.
  • typedData (required): The structured data to be hashed, following the EIP-712 standard:
    • domain: The domain parameters for the typed data.
    • types: The type definitions for the data structure.
    • primaryType: The primary type of the data.
    • message: The actual data to be signed.

Response

The response will include a JSON object with the following properties:

  • status (number): The HTTP status code of the response (e.g., 200 for success).
  • message (string): A message indicating the result of the operation.
  • data (object): An object containing the hash of the typed data.

Example Response

{
  "status": 200,
  "message": "success get hash",
  "data": {
    "hash": "0x2da87bf63a0fd3a0855b7894369503b5ef73305257b18b96d4d3ecec88ccf13d"
  }
}