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

    Class AdvancedFeeCalculator

    Advanced fee calculator with stamp-specific optimizations

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Calculate CPFP (Child Pays For Parent) fee

      Parameters

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

      Returns Promise<number>

    • Calculate optimal dust threshold based on network conditions using normalized satsPerVB Dynamically adjusts to current fee environment

      Parameters

      • network: "mainnet" | "testnet"
      • OptionalfeeRate: number

      Returns number

    • Calculate RBF fee bump with stamp-specific considerations using normalized satsPerVB Optimizes fee bumps for stamp transactions

      Parameters

      • originalFee: number
      • targetConfirmation: number
      • OptionalfeeRates: { high: number; low: number; medium: number; urgent?: number }

      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>

    • 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 }>

    • 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 },
      >