Package 

Class FeeRate

  • All Implemented Interfaces:
    java.lang.AutoCloseable , org.bitcoindevkit.Disposable , org.bitcoindevkit.FeeRateInterface

    
    public class FeeRate
     implements Disposable, AutoCloseable, 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class FeeRate.Companion
    • Method Summary

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

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

      • feeVb

         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

         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().