MPC-TSS
Operations
EVM
Estimation
Raw Transaction

Estimate Raw Unsigned Transaction

API Documentation: Estimate Raw Unsigned Transaction

Overview

This API endpoint allows you to retrieve estimate gas used, suggest gas price and suggest gas fee for an Ethereum raw unsigned transaction.

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

Request Body Parameters

  • walletId (required): this will be used to determine which key used to sign. The type is string.
  • rawUnsignedTransaction (required): Unsigned transaction in hex format (can be with prefix 0x or without prefix 0x).

Example Request Body

{      
    "walletId" : "...",        
    "rawUnsignedTransaction": "0x02f082426801843b9aca00848321560082522894f08f55777ca21aee3aeb451ffcdb4db322a73c6c8207d0822222c0808080"
}

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" : "...",        
    "rawUnsignedTransaction": "0x02f082426801843b9aca00848321560082522894f08f55777ca21aee3aeb451ffcdb4db322a73c6c8207d0822222c0808080"
}' <BASE_URL>/api/v1/wallet/eth/send/raw/estimate

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.gasEstimation (number): The gas estimation needed to execute a specific transaction based on the current pending state of the backend blockchain.
  • data.suggestGasPrice (number): The the currently suggested gas price to allow a timely execution of a transaction.
  • data.gasFeeEstimation (number): The multiplication of gasFeeEstimation and suggestGasPrice.

Example Response

{
    "status": 200,
    "message": "Transfer Raw Transaction Estimation Successfully",
    "data": {
        "gasEstimation": 21000,
        "suggestGasPrice": 3564020892,
        "gasFeeEstimation": 74844438732000
    }
}