Package 

Interface FeeRateInterface


  • 
    public interface FeeRateInterface
    
                        

    Represents fee rate.

    This is an integer type representing fee rate in sat/kwu. It provides protection against mixing up the types as well as basic formatting features.

    • Method Summary

      Modifier and Type Method Description
      abstract Amount feeVb(ULong vb) Calculates fee in satoshis by multiplying this fee rate by weight, in virtual bytes, returning None if overflow occurred.
      abstract Amount feeWu(ULong wu) Calculates fee by multiplying this fee rate by weight, in weight units, returning None if overflow occurred.
      abstract ULong toSatPerKwu() Returns raw fee rate.
      abstract ULong toSatPerVbCeil() Converts to sat/vB rounding up.
      abstract ULong toSatPerVbFloor() Converts to sat/vB rounding down.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • feeVb

         abstract Amount feeVb(ULong vb)

        Calculates fee in satoshis by multiplying this fee rate by weight, in virtual bytes, returning None if overflow occurred.

        This is equivalent to converting vb to weight using Weight::from_vb and then calling Self::fee_wu(weight).

      • feeWu

         abstract Amount feeWu(ULong wu)

        Calculates fee by multiplying this fee rate by weight, in weight units, returning None if overflow occurred.

        This is equivalent to Self::checked_mul_by_weight().