Wallet class

A Bitcoin wallet.

The Wallet acts as a way of coherently interfacing with output descriptors and related transactions. Its main components are:

1. Output descriptors from which it can derive addresses.

2. A Database where it tracks transactions and utxos related to the descriptors.

3. Signers that can contribute signatures to addresses instantiated from the descriptors.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAddress({required AddressIndex addressIndex}) Future<AddressInfo>
Return a derived address using the external descriptor, see AddressIndex for available address index selection strategies. If none of the keys in the descriptor are derivable (i.e. does not end with /*) then the same address will always be returned for any AddressIndex.
getBalance() Future<Balance>
Return the Balance, separated into available, trusted-pending, untrusted-pending and immature values.
getDescriptorForKeyChain(KeychainKind keychainKind) Future<Descriptor>
Returns the descriptor used to create addresses for a particular keychain.
getInternalAddress({required AddressIndex addressIndex}) Future<AddressInfo>
Return a derived address using the internal (change) descriptor.
getPsbtInput({required LocalUtxo utxo, required bool onlyWitnessUtxo, PsbtSigHashType? psbtSighashType}) Future<Input>
isMine(Script script) Future<bool>
Return whether or not a script is part of this wallet (either internal or external).
listTransactions(bool includeRaw) Future<List<TransactionDetails>>
Return an unsorted list of transactions made and received by the wallet
listUnspent() Future<List<LocalUtxo>>
Return the list of unspent outputs of this wallet
network() Future<Network>
Get the Bitcoin network the wallet is using.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign({required PartiallySignedTransaction psbt, SignOptions? signOptions}) Future<PartiallySignedTransaction>
Sign a transaction with all the wallet’s signers, in the order specified by every signer’s SignerOrdering
sync(Blockchain blockchain) Future
Sync the internal database with the Blockchain
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create({required Descriptor descriptor, Descriptor? changeDescriptor, required Network network, required DatabaseConfig databaseConfig}) Future<Wallet>
Wallet constructor