blockchainRelayFee

Electrum for Bitcoin

Overview

The blockchain.relayfee method queries the minimum transaction fee required for a low-priority transaction to be accepted into the daemon's memory pool. This fee is crucial for users who need to minimize transaction costs while ensuring their transaction is processed.

Returns

The method returns the minimum relay fee required in whole coin units (e.g., BTC, not satoshis for Bitcoin) as a floating-point number.

FieldDescription
feeThe minimum relay fee in coin units.

Example Results

1e-5
0.0

Request Example

curl --location 'https://api.tatum.io/v3/blockchain/node/bitcoin-mainnet-electrs/' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {API_KEY}' \
--data '{
    "method": "blockchain.relayfee",
    "params": [],
    "id": 1,
    "jsonrpc": "2.0"
}'
// yarn add @tatumio/tatum

import { TatumSDK, BitcoinElectrs, Network } from '@tatumio/tatum'

const tatum = await TatumSDK.init<BitcoinElectrs>({ network: Network.BITCOIN_ELECTRS })

const relayFee = await tatum.rpc.getRelayFee()

console.log('Relay Fee:', relayFee)

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs when done