Embedded Wallets
How to
Wallet Operation
Sign Message

Sign Message

API Documentation: Sign Message

Overview

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

  • HTTP Method: POST
  • Endpoint: /api/<VERSION>/wallet/sign-message

Request Body Parameters

  • message (required): Some message user want to sign.
  • network (required if chainId empty): The network used for transactions. You can see Networks Reference to get the network code.
  • chainId (required if network empty): The chain ID of the network used for transactions.

Example Request Body

{
    "message": "Sign this message",
    "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 Embedded Wallet 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 '{
    "message": "Sign this message"
}' <BASE_URL>/api/<VERSION>/wallet/sign-message

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 Message is successfully",
    "data": {
        "signature": "0x6b589c68bdcd3024232d60d10ec12a6ed1c5efd14855d3ea49a43b7f79c01649514a73d2d1a25151642f1a207ffcd3ba0b22f7241970f0fc8612b1d7718ca4ed1b"
    }
}