6 namespace org { namespace ldk { namespace structs {
10 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
11 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
14 public class Wallet : CommonBase {
15 internal Wallet(object _dummy, long ptr) : base(ptr) { }
17 if (ptr != 0) { bindings.Wallet_free(ptr); }
21 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
22 * of [`CoinSelectionSource`].
24 public static Wallet of(org.ldk.structs.WalletSource source, org.ldk.structs.Logger logger) {
25 long ret = bindings.Wallet_new(source.ptr, logger.ptr);
28 if (ret >= 0 && ret <= 4096) { return null; }
29 org.ldk.structs.Wallet ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Wallet(null, ret); }
30 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
31 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(source); };
32 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); };
37 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
38 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
40 public CoinSelectionSource as_CoinSelectionSource() {
41 long ret = bindings.Wallet_as_CoinSelectionSource(this.ptr);
43 if (ret >= 0 && ret <= 4096) { return null; }
44 CoinSelectionSource ret_hu_conv = new CoinSelectionSource(null, ret);
45 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };