Package 

Class Amount

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

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

    • Nested Class Summary

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

      Modifier and Type Method Description
      Unit destroy()
      Unit close()
      Double toBtc() Express this Amount as a floating-point value in Bitcoin.
      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
    • Method Detail

      • toBtc

         Double toBtc()

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

      • toSat

         ULong toSat()

        Get the number of satoshis in this Amount.