BitcoinAmount

data class BitcoinAmount(val satoshi: Long, val picoRemainder: Int = 0)(source)

A quantity of Bitcoin, internally denominated in satoshi, with a pico-btc remainder

Constructors

Link copied to clipboard
constructor(satoshi: Long, picoRemainder: Int = 0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

If necessary, any sub-satoshi remainder in pico btc (10^-12 Bitcoin, or 10k pico per satoshi)

Link copied to clipboard

The base unit of account in satoshis (10^-8 Bitcoin, or 100m satoshi per Bitcoin

Functions

Link copied to clipboard

Provide the amount denominated in BTC

Link copied to clipboard
fun millisat(): Long

Provide the amount denominated in millisats (1,000th of a satoshi, 10 x pico btc). Rounded towards zero if necessary.

Link copied to clipboard
fun pico(): Long

Provide the amount denominated in pico btc (10,000th of a satoshi)