Interface AmountInterface

  • All Implemented Interfaces:

    public interface AmountInterface
    
                        

    The Amount type can be used to express Bitcoin amounts that support arithmetic and conversion to various denominations. The operations that Amount implements will panic when overflow or underflow occurs. Also note that since the internal representation of amounts is unsigned, subtracting below zero is considered an underflow and will cause a panic.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Double toBtc() Express this Amount as a floating-point value in Bitcoin.
      abstract ULong toSat() Get the number of satoshis in this Amount.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • toBtc

         abstract Double toBtc()

        Express this Amount as a floating-point value in Bitcoin. Please be aware of the risk of using floating-point numbers.

      • toSat

         abstract ULong toSat()

        Get the number of satoshis in this Amount.