Balance

data class Balance(    var immature: ULong,     var trustedPending: ULong,     var untrustedPending: ULong,     var confirmed: ULong,     var spendable: ULong,     var total: ULong)

Balance differentiated in various categories.

Samples


fun main() { 
   //sampleStart 
   object LogProgress : Progress {
    override fun update(progress: Float, message: String?) {}
}

val memoryDatabaseConfig = DatabaseConfig.Memory
private val blockchainConfig = BlockchainConfig.Electrum(
    ElectrumConfig(
        "ssl://electrum.blockstream.info:60002",
        null,
        5u,
        null,
        200u
    )
)
val wallet = Wallet(descriptor, null, Network.TESTNET, memoryDatabaseConfig)
val blockchain = Blockchain(blockchainConfig)
wallet.sync(blockchain, LogProgress)

val balance: Balance = wallet.getBalance()
println("Total wallet balance is ${balance.total}") 
   //sampleEnd
}

Constructors

Link copied to clipboard
fun Balance(    immature: ULong,     trustedPending: ULong,     untrustedPending: ULong,     confirmed: ULong,     spendable: ULong,     total: ULong)

Properties

Link copied to clipboard
var confirmed: ULong

Confirmed and immediately spendable balance.

Link copied to clipboard
var immature: ULong

All coinbase outputs not yet matured.

Link copied to clipboard
var spendable: ULong

The sum of trustedPending and confirmed coins.

Link copied to clipboard
var total: ULong

The whole balance visible to the wallet.

Link copied to clipboard
var trustedPending: ULong

Unconfirmed UTXOs generated by a wallet tx.

Link copied to clipboard
var untrustedPending: ULong

Unconfirmed UTXOs received from an external wallet.