6 namespace org { namespace ldk { namespace structs {
10 * An input that must be included in a transaction when performing coin selection through
11 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
12 * must have an empty [`TxIn::script_sig`] when spent.
14 public class Input : CommonBase {
15 internal Input(object _dummy, long ptr) : base(ptr) { }
17 if (ptr != 0) { bindings.Input_free(ptr); }
21 * The unique identifier of the input.
23 public OutPoint get_outpoint() {
24 long ret = bindings.Input_get_outpoint(this.ptr);
26 if (ret >= 0 && ret <= 4096) { return null; }
27 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
28 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
33 * The unique identifier of the input.
35 public void set_outpoint(org.ldk.structs.OutPoint val) {
36 bindings.Input_set_outpoint(this.ptr, val == null ? 0 : val.ptr);
39 if (this != null) { this.ptrs_to.AddLast(val); };
43 * The UTXO being spent by the input.
45 public TxOut get_previous_utxo() {
46 long ret = bindings.Input_get_previous_utxo(this.ptr);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 TxOut ret_conv = new TxOut(null, ret);
54 * The UTXO being spent by the input.
56 public void set_previous_utxo(org.ldk.structs.TxOut val) {
57 bindings.Input_set_previous_utxo(this.ptr, val.ptr);
63 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
64 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
67 public long get_satisfaction_weight() {
68 long ret = bindings.Input_get_satisfaction_weight(this.ptr);
74 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
75 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
78 public void set_satisfaction_weight(long val) {
79 bindings.Input_set_satisfaction_weight(this.ptr, val);
85 * Constructs a new Input given each field
87 public static Input of(org.ldk.structs.OutPoint outpoint_arg, org.ldk.structs.TxOut previous_utxo_arg, long satisfaction_weight_arg) {
88 long ret = bindings.Input_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, previous_utxo_arg.ptr, satisfaction_weight_arg);
89 GC.KeepAlive(outpoint_arg);
90 GC.KeepAlive(previous_utxo_arg);
91 GC.KeepAlive(satisfaction_weight_arg);
92 if (ret >= 0 && ret <= 4096) { return null; }
93 org.ldk.structs.Input ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Input(null, ret); }
94 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
95 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); };
99 internal long clone_ptr() {
100 long ret = bindings.Input_clone_ptr(this.ptr);
106 * Creates a copy of the Input
108 public Input clone() {
109 long ret = bindings.Input_clone(this.ptr);
111 if (ret >= 0 && ret <= 4096) { return null; }
112 org.ldk.structs.Input ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Input(null, ret); }
113 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
118 * Generates a non-cryptographic 64-bit hash of the Input.
121 long ret = bindings.Input_hash(this.ptr);
126 public override int GetHashCode() {
127 return (int)this.hash();
130 * Checks if two Inputs contain equal inner contents.
131 * This ignores pointers and is_owned flags and looks at the values in fields.
132 * Two objects with NULL inner values will be considered "equal" here.
134 public bool eq(org.ldk.structs.Input b) {
135 bool ret = bindings.Input_eq(this.ptr, b == null ? 0 : b.ptr);
138 if (this != null) { this.ptrs_to.AddLast(b); };
142 public override bool Equals(object o) {
143 if (!(o is Input)) return false;
144 return this.eq((Input)o);