Static
Readonly
Optional
Get the recommended transaction fee rate based on recent blocks. Returns the median fee rate, clamped between min and max fee rates.
Number of recent blocks to analyze.
Optional max fee rate cap.
The recommended fee rate in Shannons per KB.
import { ccc } from "@ckb-ccc/core";const clientOwner = ccc.ClientPublicTestnet.open();const client = clientOwner.value;// Call `await clientOwner.dispose()` when the client is no longer needed.const feeRate = await client.getFeeRate();console.log(`Current fee rate: ${feeRate} Shannons/KB`); Copy
import { ccc } from "@ckb-ccc/core";const clientOwner = ccc.ClientPublicTestnet.open();const client = clientOwner.value;// Call `await clientOwner.dispose()` when the client is no longer needed.const feeRate = await client.getFeeRate();console.log(`Current fee rate: ${feeRate} Shannons/KB`);
Get the recommended transaction fee rate based on recent blocks. Returns the median fee rate, clamped between min and max fee rates.