CCC Docs
    Preparing search index...

    Hierarchy

    • Client<this> & {}
      • ClientWithFeeRate
    Index
    • Parameters

      • ...args: [Client]

      Returns ClientWithFeeRate

    "[localKeys]": string[] = ...
    feeRate?: bigint
    • Get the recommended transaction fee rate based on recent blocks. Returns the median fee rate, clamped between min and max fee rates.

      Parameters

      • OptionalblockRange: NumLike

        Number of recent blocks to analyze.

      • Optionaloptions: { maxFeeRate?: NumLike }

        Optional max fee rate cap.

      Returns Promise<bigint>

      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`);