Package-level declarations

Types

Link copied to clipboard
data class Balance(var balance: Long, var confirmed: Long, var unconfirmed: Long, var reserved: Long)
Link copied to clipboard
Link copied to clipboard
class InteractiveMultisigDestination(chain: ChainSelector, var walletName: String, var contractName: String, var convoSecret: ByteArray, var minSigs: Int, var pubkeys: Array<Bytes>, var privkeys: Array<Secret?>, var comms: ProtocolCommunication) : Pay2TemplateDestination
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

this class tracks and completes the spend of a single input of a transaction

Link copied to clipboard
class MultisigWalletContract(val name: String, val account: Wallet) : WalletContract
Link copied to clipboard
Link copied to clipboard
interface TextUI

Contracts have a UI; they need to display stuff and solicit user input. This defines a text-based interface into contracts. You can ask the WalletContract for a particular UI bu class via the WalletContract.ui function.

Link copied to clipboard
class TimeLockTextUI(val contract: TimeLockVault) : TextUI
Link copied to clipboard
class TimeLockVault(val name: String, val account: Bip44Wallet, var contractIndex: Long = 1, val chain: ChainSelector = account.chainSelector) : WalletContract

Wallet-facing half of the time lock vault: a non-interactive contract that locks coins to an address until a committed unlock value — a block height or, at/above the BIP-65 500,000,000 split, a Unix timestamp — is reached, after which only the holder of the committed private key can spend them.

Link copied to clipboard
class TimeLockVaultDestination(chain: ChainSelector, var unlockValue: Long, _secret: Secret, var hdIndex: Long, var contractName: String? = null) : Pay2TemplateDestination

Pay-to-Template destination for a single time lock vault.

Link copied to clipboard
Link copied to clipboard
interface WalletContract
Link copied to clipboard

Properties

Link copied to clipboard
val contractCoCtxt: CloseableCoroutineDispatcher
Link copied to clipboard
val multisigLock: iMutex

This map makes sure multiple interactions with the same transaction resolve to a single object in memory

Link copied to clipboard
Link copied to clipboard
val OneImdLock: iMutex

Functions

Link copied to clipboard
Link copied to clipboard
fun formMultisig(cs: ChainSelector, requiredSigs: Int, dests: Array<Bytes>): SatoshiScript
Link copied to clipboard

Given an invitation from someone else, call this function to begin the formation of a multi-party contract

Link copied to clipboard

Register the TimeLockVaultDestination deserializer so wallets can rehydrate spendables that carry one as their backingPayDestination. Call once at startup, after org.nexa.libnexakotlin.initializeLibNexa. Without this, any wallet that has signed a vault spend will throw "destination type not handled" on the next load.

Link copied to clipboard

Deserialize an InteractiveMultisigDestination

fun interactiveMultisigDestinationOf(chainSelector: ChainSelector, walletName: String, contractName: String, convoSecret: ByteArray, minSigs: Int, pubkeys: Array<Bytes>, privkeys: Array<Secret?>, comms: ProtocolCommunication): InteractiveMultisigDestination

Create a InteractiveMultisigDestination, storing this object for later use since we really need one per destination to share communications channels

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun oneImdUniqueName(walletName: String, contractName: String, pubkeys: Array<Bytes>, minSigs: Int): String
Link copied to clipboard

Deserializer factory for the DestinationDeserializer map. Reads a TimeLockVaultDestination from a disk-format byte stream.

Link copied to clipboard
inline fun <T> WalletContract.ui(): T?

Return an object of the expected Wallet Contract Interface