Wallet Operation
Sign Typed Data

Sign Typed Data

API Documentation: Sign Typed Data

Overview

This API endpoint allows users to sign some typed data message using their MPC wallet.

  • HTTP Method: POST
  • Endpoint: /api/v1/wallet/sign-typed-data

Request Body Parameters

  • secret (optional): Secret from the end-user device, created when creating/importing the wallet.
  • data(required): The raw data you get from dApps or WalletConnect.
  • network (required if chainId empty): The network used for transactions.
  • chainId (required if network empty): The chain ID of the network used for transactions.

Example Request Body

{
    "secret": YOUR_SECRET,
    "data": "raw_typed_data_message_here",
    "network": "ethereum",
    "chainId": "1"
}

Request

Request Headers

  • Authorization (required): JWT token which was generated when user login and do not have an MPC wallet.
  • x-client-secret (required): Client secret which was generated when register in Xellar MPC API Service Dashboard.

Example Request Syntax

curl -X POST -H "Content-Type: application/json" -H "x-client-secret: $YOUR_CLIENT_SECRET" -H "Authorization: Bearer $YOUR_ACCESS_TOKEN" -d '{
    "secret": "'$YOUR_SECRET'",
    "data": "raw_typed_data_message_here"
}' https://mpc.xellar.co/api/v1/wallet/sign-typed-data

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 providing additional information about the operation.
  • data (object): An object containing the signature of the message.

Example Response

{
    "status": 200,
    "message": "Sign Typed Data is successfully",
    "data": {
        "signature": "0x7e335fd65539e5c6c726be97f93e3e69019d899969d21023d2c6da51622a817d016c2e036a06b734d6de93f01a63e49460d783af8d2eb467d95a487e2028f9751c"
    }
}