Estimate transaction fee

POST {{baseUrl}}/protocols/btc/transactions/estimate

Returns estimated Bitcoin transaction fees for POST /protocols/btc/transactions.

The fee estimation is based on the current Bitcoin network utilization and can fluctuate in a random fashion.

Accepts identical configuration options as in POST /protocols/btc/transactions.

Supports additionally an optional sweep body parameter to estimate sending all unspent outputs (including dust) to a desired recipient or self via POST /protocols/btc/transactions.

POST https://api.tangany.com/custody/protocols/btc/transactions/estimate
{
  "from": {
    wallet: "my-wallet"
  },
  "to": "tb1q0vewgvw2tpk5s8yh4e546h4ujac45z9a95hfts",
  "sweep": true,
}

Multiple sweep operations may be required to completely sweep wallets with more than 100 utxo. Refer to POST /protocols/btc/transactions for more information about the utxo limit.

This call does not send an actual transaction to the Bitcoin network

Request Body

{"txSpeed"=>"fast", "from"=>{"wallet"=>"{{wallet}}"}, "to"=>{"wallet"=>"my-other-wallet"}, "amount"=>"0.0023"}

HEADERS

KeyDatatypeRequiredDescription
tangany-versionnumber(Required) Default header that directs the request towards desired Tangany Custody Api version (e.g 2 directs to Tangany Custody APi v2).

Supports only major versions. | | tangany-network | string | | (Optional header) Defines the network to operate in - in the Bitcoin context.

Accepts supported network enums. Defaults to mainnet when omitted from the call.

Supported networks: mainnet, testnet3.

Example: testnet3 | | tangany-tx-confirmations | number | | (Optional header) Defines a secure amount of block confirmations required to consider a bitcoin transaction as valid.

Accepts positive integers. Defaults to 1.

Bitcoin transactions are usually considered final after 6 network confirmations. | | tangany-utxo-confirmations | number | | (Optional header) Defines a secure amount of block confirmations required for Bitcoin balance outputs ("UTXO", "coins") to consider the input as valid and consequently to be included in the total wallet balance calculation or a new transaction.

Accepts positive integers. Defaults to 1.

The inclusion of unconfirmed outputs via 0 bears the risk of the posthumous invalidation of own wallet transactions by the parent utxo sending party. They can e.g. be used for retrieving total BTC wallet balances including the pending UTXO.

Example: 12 | | Content-Type | string | | | | Accept | string | | |

RESPONSES

status: OK

{"fee":"0.00001356","feeRate":10,"inputs":1,"inputsValue":"0.00161"}