Account Abstraction
API Reference
Signing
Get Sign Message Hash

Get Sign Message Hash

Overview

This API endpoint allows you to generate a hash for a message that can be signed by a smart account. This is useful for verifying the integrity and authenticity of messages.

  • HTTP Method: POST
  • Endpoint: {{BASE_URL}}/api/v1/smart-account/signMessage/hash

Request Body Parameters

  • accountId (required): The unique identifier of the smart account.
  • message (required): The message to be hashed.

Example Request Body

{
  "accountId": "67b1f9310521667c3e94d625",
  "message": "Hello World"
}

Request Headers

  • X-CLIENT-ID: (required): Client ID which was generated when registering in Xellar Account Abstraction API Service Dashboard.
  • X-SIGNATURE: (required): Calculated signature, please refer to Authorization section.
  • X-TIMESTAMP: (required): Request timestamp in RFC3339 format.

Example Request Syntax

curl -X POST -H "Content-Type: application/json" \
-H "x-client-id: $YOUR_CLIENT_ID" \
-H "x-signature: $CALCULATED_SIGNATURE" \
-H "x-timestamp: $TIMESTAMP" \
-d '{
    "accountId": "67b1f9310521667c3e94d625",
    "message": "Hello World"
}' "{{BASE_URL}}/api/v1/smart-account/signMessage/hash"

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 message.

Example Response

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