Wallet Operation
Sign Transaction

Sign Transaction

API Documentation: Sign Transaction

Overview

This API endpoint allows users to sign raw transaction using their MPC wallet.

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

Request Body Parameters

  • secret (optional): Secret from the end-user device, created when creating/importing the wallet.
  • transaction(required): Raw transaction data user want to sign.
  • 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,
    "network": "ethereum",
    "chainId": "1",
    "transaction": {
        "from": "0x5B3A69CD0984c8621c75c54aa4dCA89e382523A9",
        "to": "0x5B3A69CD0984c8621c75c54aa4dCA89e382523A9",
        "data": "0x",
        "nonce": "0x00",
        "gasPrice": "0x1cb3fa334b",
        "gasLimit": "0x5208",
        "value": "0x00"
    }
}

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'",
	"transaction": {
		"from":"0x5B3A69CD0984c8621c75c54aa4dCA89e382523A9",
		"to":"0x5B3A69CD0984c8621c75c54aa4dCA89e382523A9",
		"data":"0x",
		"nonce":"0x00",
		"gasPrice":"0x1cb3fa334b",
		"gasLimit":"0x5208",
		"value":"0x00"
	}
}' https://mpc.xellar.co/api/v1/wallet/sign-transaction

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

Example Response

{
    "status": 200,
    "message": "Sign Transaction is successfully",
    "data": {
        "signedTransaction": "0xf87184307830308c30783163623366613333346280945b3a69cd0984c8621c75c54aa4dca89e382523a98430783030801ca0bc01b69137a06e64c6f9a02e04b650d4a46cd98d04ae3fee0c1e3fe8d8186d58a02477caf3a20b4a44a16dc3c2c9b7a8edf78db712af0920d769a23d164c242c0f"
    }
}