BitTap Documentation
  • About BitTap
  • Wallet Product
    • Custodial vs. Non-Custodial
    • Off-Chain Proof
    • Get Started
    • Privacy Policy
  • DEX PRODUCT
    • Overview
  • Developer Guides
    • Overview
    • API Reference
      • CreateWallet
      • NewAddr
      • DecodeAddr
      • QueryAddrs
      • ImportAsset
      • QueryAssetStat
      • ListAssetHistory
      • Estimate-tx-fee
      • GetAssetBalance
      • GetBtcBalance
      • 💎SendAsset
        • TransferAsset
        • AnchorVirtualPsbt
        • PublishTransfer
      • 💎SendBtc
        • TransferBtc
        • PublishTransferBtc
    • JS SDK
Powered by GitBook
On this page
  1. Developer Guides
  2. API Reference

Estimate-tx-fee

Estimate the transaction fee for current layer 1 or layer 2 asset transfer.

POST /api/estimate-tx-fee

Headers

Name
Value

Content-Type

application/json

Authorization

token

Request Body

Name
Type
Required
Description

wallet_id

string

true

The end user's wallet id

amount

int

false

the amount of satoshi to send in case of type 1

type

int

true

1 layer 1 btc transfer; 2 layer 2 taproot asset transfer

fee_rate

int

true

satoshi cost per byte

Response Body

Name
Type
Description

tx_fee

int

estimated tx_fee for this transaction

Request Demo

{
  "wallet_id": "10e21d53-82d3-43d6-99bc-03ea6945d902",
  "type": 1,
  "amount": 20000,
  "fee_rate": 21
}

Response Demo

{
    "code": 0,
    "data": {
        "tx_fee": 1512
    },
    "message": "",
    "traceid": "e8857f31-91ee-47ea-975c-d05f6328d9fb"
}
{
  "error": "Invalid request"
}
PreviousListAssetHistoryNextGetAssetBalance

Last updated 6 months ago