@btc-stamps/tx-builder - v0.1.7
    Preparing search index...

    Class FeeEstimator

    Hierarchy (View Summary)

    Implements

    • IFeeEstimator
    Index

    Constructors

    • Parameters

      • Optionaloptions: FeeEstimatorOptions
      • Optionalsrc20Options: SRC20Options

      Returns FeeEstimator

    Methods

    • Calculate CPFP (Child Pays For Parent) fee

      Parameters

      • parentTxid: string
      • parentFee: number
      • childSize: number
      • targetFeeRate: number

      Returns Promise<number>

    • Calculate RBF (Replace By Fee) fee

      Parameters

      • originalFee: number
      • minRelayFee: number = 1

      Returns number

    • Calculate accurate transaction size with witness data

      Parameters

      • inputs: { type: InputType; witnessScript?: Buffer<ArrayBufferLike> }[]
      • outputs: { size?: number; type: OutputType }[]

      Returns SizeCalculation

    • Estimate fee for transaction with enhanced calculation

      Parameters

      • size: number
      • priority: "low" | "medium" | "high" | "urgent"

      Returns Promise<FeeEstimate>

    • Get dynamic dust thresholds based on fee rates

      Parameters

      • OptionalfeeRate: number

      Returns DustThresholds

    • Get current fee rates with historical context

      Returns Promise<FeeRate>

    • Calculate input type specific sizes

      Parameters

      • type: InputType
      • OptionalwitnessScript: Buffer<ArrayBufferLike>

      Returns SizeCalculation

    • Get normalized fee rates for all priority levels

      Returns Promise<
          {
              high: NormalizedFeeRate;
              low: NormalizedFeeRate;
              medium: NormalizedFeeRate;
              urgent: NormalizedFeeRate;
          },
      >

    • Get fee estimation for specific transaction parameters

      Parameters

      • params: {
            inputs: { type: InputType; witnessScript?: Buffer<ArrayBufferLike> }[];
            outputs: { size?: number; type: OutputType }[];
            priority?: "low" | "medium" | "high" | "urgent";
        }

      Returns Promise<FeeEstimate & { sizeBreakdown: SizeCalculation }>

    • Calculate output type specific sizes

      Parameters

      • type: OutputType
      • OptionalscriptSize: number

      Returns number

    • Get current provider configuration

      Returns {
          electrumXConnected: boolean;
          fallbackFeeRate: number;
          provider: string;
          useMockProvider: boolean;
      }

    • Validate if output value is above dust threshold

      Parameters

      • value: number
      • outputType: OutputType
      • OptionalfeeRate: number

      Returns boolean

    • Set custom fee provider

      Parameters

      • provider: NonNullable<undefined | "mempool" | "blockstream" | "electrum" | "custom">

      Returns void

    • Test connection to current fee provider

      Returns Promise<
          { error?: string; latency?: number; provider: string; success: boolean },
      >