Estimation Native Segwit Transaction
API Documentation: Estimation Native Segwit
Overview
This API endpoint allows you to retrieve gas fee for a Bitcoin Native Segwit Transaction.
- HTTP Method: POST
- Endpoint: /api/v1/wallet/btc/send/native-segwit/estimate
Request Body Parameters
- walletId(required): this will be used to determine which key used to sign. The type is string.
- to(required): the destination Bitcoin address that will receive the coin.
- amount(required): in the satoshi format.
Example Request Body
{      
    "walletId": "...",    
    "to": "bc1qvfkdzjjjyjyasd7msrwhta5kvp9h8l4p40rl67",
    "amount": "3000000",    
}Request
Request Headers
- X-SIGNATURE: (required): Calculated signature, please refer to Authorization section.
- X-TIMESTAMP: (required): Request timestamp in RFC3339 format.
- X-APP-ID: (required): APP ID which was generated when register in Xellar TSS API Service Dashboard.
Example Request Syntax
curl -X POST -H "Content-Type: application/json" -H "x-app-id: $YOUR_APP_ID" -H "x-timestamp: $YOUR_TIMESTAMP" -H "x-signature: $YOUR_SIGNATURE" -d '{
    "walletId": "...",
    "to": "bc1qvfkdzjjjyjyasd7msrwhta5kvp9h8l4p40rl67",
    "amount": "3000000"
}' <BASE_URL>/api/v1/wallet/btc/send/native-segwit/estimateResponse
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.transactionSize(number): The length/size of unsigned transaction in bytes.
- data.feePerBytes(number): Suggested fee per bytes.
- data.estimateTotalFee(number): Estimation Total fee, multiplication of transactionSize and estimateTotalFee.
Example Response
{
    "status": 200,
    "message": "Transfer bitcoin native segwit estimation successfully",
    "data": {
        "transactionSize": 128,
        "feePerBytes": 4,
        "estimateTotalFee": 512
    }
}