Ask or search…
⌃K
Links

estimatesmartfee

How to use it

TypeScript/JavaScript
1
// yarn add @tatumio/tatum
2
​
3
import { TatumSDK, Litecoin, Network } from '@tatumio/tatum'
4
​
5
const tatum = await TatumSDK.init<Litecoin>({network: Network.LITECOIN})
6
​
7
const result = await tatum.rpc.estimateSmartFee(20)
8
​
9
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs

Overview

The estimatesmartfee method provides an estimated fee rate (in BTC/kB) for a transaction to be confirmed within a certain number of blocks. The estimation is based on recent transactions in the Litecoin network.
This method can be useful for users or applications trying to decide on an appropriate fee for their transactions, based on the desired confirmation speed.

Parameters

The estimatesmartfee method accepts the following parameters:
  • conf_target: An integer representing the number of blocks within which the transaction should be confirmed.
  • estimate_mode (optional): A string that determines the estimation mode. Possible values are "UNSET", "ECONOMICAL", and "CONSERVATIVE". Default is "CONSERVATIVE".

Return Object

The estimatesmartfee method returns an object containing the following fields:
  • feerate: A decimal number representing the estimated fee rate/kB.
  • blocks: An integer representing the number of blocks within which the transaction is expected to be confirmed.

JSON Examples

Request example:
1
{
2
"jsonrpc": "2.0",
3
"method": "estimatesmartfee",
4
"params": [20],
5
"id": 1
6
}
Response example:
1
{
2
"result": {
3
"feerate": 0.00017258,
4
"blocks": 20
5
},
6
"error": null,
7
"id": 1
8
}
\
© Tatum Technology, LLC