lightningdevkit
Version:
Lightning Development Kit
49 lines (48 loc) • 2.29 kB
text/typescript
import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
import { Result_CVec_u8ZNoneZ } from '../structs/Result_CVec_u8ZNoneZ.mjs';
import { Result_CVec_UtxoZNoneZ } from '../structs/Result_CVec_UtxoZNoneZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/** An implementation of WalletSource */
export interface WalletSourceInterface {
/**Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
*/
list_confirmed_utxos(): Result_CVec_UtxoZNoneZ;
/**Returns a script to use for change above dust resulting from a successful coin selection
* attempt.
*/
get_change_script(): Result_CVec_u8ZNoneZ;
/**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`]).
*
* If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
* unsigned transaction and then sign it with your wallet.
*/
sign_psbt(psbt: Uint8Array): Result_TransactionNoneZ;
}
/**
* An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
* provide a default implementation to [`CoinSelectionSource`].
*/
export declare class WalletSource extends CommonBase {
/** Creates a new instance of WalletSource from a given implementation */
static new_impl(arg: WalletSourceInterface): WalletSource;
/**
* Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
*/
list_confirmed_utxos(): Result_CVec_UtxoZNoneZ;
/**
* Returns a script to use for change above dust resulting from a successful coin selection
* attempt.
*/
get_change_script(): Result_CVec_u8ZNoneZ;
/**
* 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`]).
*
* If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
* unsigned transaction and then sign it with your wallet.
*/
sign_psbt(psbt: Uint8Array): Result_TransactionNoneZ;
}