Class WalletSource


  • public class WalletSource
    extends Object
    An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to provide a default implementation to [`CoinSelectionSource`].
    • Method Detail

      • destroy

        public void destroy()
        Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
      • list_confirmed_utxos

        public Result_CVec_UtxoZNoneZ list_confirmed_utxos()
        Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
      • get_change_script

        public Result_CVec_u8ZNoneZ get_change_script()
        Returns a script to use for change above dust resulting from a successful coin selection attempt.
      • sign_tx

        public Result_TransactionNoneZ sign_tx​(byte[] tx)
        Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within the transaction known to the wallet (i.e., any provided via [`WalletSource::list_confirmed_utxos`]).