MPC-TSS
Operations
EVM
Send
Transaction

Sign Transaction

API Documentation: Sign Transaction

Overview

This API endpoint allows you to Sign and Broadcast an Ethereum transaction.

  • HTTP Method: POST
  • Endpoint: /api/v1/wallet/eth/send/transaction

Request Body Parameters

  • walletId (required): this will be used to determine which key used to sign. The type is string.
  • to (required): The recipient’s Ethereum address, specified in standard Ethereum address format.
  • data (required): The data associated with the transaction. If no specific data is provided, use 0x to indicate an empty transaction.
  • nonce (required): The sender’s nonce, which is a number representing the number of transactions sent from the sender’s address. This should be an integer.
  • gasFeeCap (required): The maximum gas fee (in gwei) the sender is willing to pay for the transaction, represented as a number (maxFeePerGas).
  • gasTipCap (required): The maximum tip fee (in gwei) the sender is willing to provide as a priority fee to miners, represented as a number (maxPriorityFeePerGas).
  • gas (required): The amount of gas (in units) required for the transaction to be processed. This should be specified as a number.
  • value (required): The amount of Ether (in wei) to be transferred in the transaction. The value should be represented as an integer in wei (the smallest unit of Ether).
  • pin : The PIN is necessary if the wallet has a PIN enabled. The PIN need to be in hashed format (SHA-256).

Example Request Body

{      
    "walletId" : "...",        
    "to": "0x69DDcdE165b784c059cC3E9DFA1cdc374cd6F3C3",
    "data": "0x",
    "nonce": 1,
    "gasFeeCap": 20000000000,  // 20 gwei
    "gasTipCap": 10000000000,  // 10 gwei
    "gas": 21000,
    "value": 1000000000000000000,  // 1 Ether (in wei)
    "pin": "64f46a7526a186d2346552453ae478ca51244674f5b21ba150bd483b39f7c812"
}

Request

Request Headers

  • X-CLIENT-ID: (required): Client ID which was generated when register in Xellar TSS 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-client-secret: $YOUR_CLIENT_SECRET" -d '{
    "walletId" : "...",        
     "to": "0x69DDcdE165b784c059cC3E9DFA1cdc374cd6F3C3",
    "data": "0x",
    "nonce": 1,
    "gasFeeCap": 20000000000,
    "gasTipCap": 10000000000,
    "gas": 21000,
    "value": 1000000000000000000
}' <BASE_URL>/api/v1/wallet/eth/send/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 request information.
  • data.requestId (string): The unique identifier for the request.

Example Response

{
    "status": 200,
    "message": "Sign transaction is in progress",
    "data": {
        "requestId": "9c276eb2-e0e1-4789-bd54-42d5e920379f"        
    }
}