-
- 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 classFeeRate.Companion
-
Method Summary
Modifier and Type Method Description Unitdestroy()Unitclose()AmountfeeVb(ULong vb)Calculates fee in satoshis by multiplying this fee rate by weight, in virtual bytes, returning Noneif overflow occurred.AmountfeeWu(ULong wu)Calculates fee by multiplying this fee rate by weight, in weight units, returning Noneif overflow occurred.ULongtoSatPerKwu()Returns raw fee rate. ULongtoSatPerVbCeil()Converts to sat/vB rounding up. ULongtoSatPerVbFloor()Converts to sat/vB rounding down. StringtoString()-
-
Method Detail
-
feeVb
Amount feeVb(ULong vb)
Calculates fee in satoshis by multiplying this fee rate by weight, in virtual bytes, returning
Noneif 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
Noneif overflow occurred.This is equivalent to Self::checked_mul_by_weight().
-
toSatPerKwu
ULong toSatPerKwu()
Returns raw fee rate.
-
toSatPerVbCeil
ULong toSatPerVbCeil()
Converts to sat/vB rounding up.
-
toSatPerVbFloor
ULong toSatPerVbFloor()
Converts to sat/vB rounding down.
-
-
-
-