6 namespace org { namespace ldk { namespace structs {
10 * A tx_add_input message for adding an input during interactive transaction construction
12 public class TxAddInput : CommonBase {
13 internal TxAddInput(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.TxAddInput_free(ptr); }
21 public byte[] get_channel_id() {
22 byte[] ret = bindings.TxAddInput_get_channel_id(this.ptr);
30 public void set_channel_id(byte[] val) {
31 bindings.TxAddInput_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
40 public long get_serial_id() {
41 long ret = bindings.TxAddInput_get_serial_id(this.ptr);
47 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
50 public void set_serial_id(long val) {
51 bindings.TxAddInput_set_serial_id(this.ptr, val);
57 * Serialized transaction that contains the output this input spends to verify that it is non
60 public TransactionU16LenLimited get_prevtx() {
61 long ret = bindings.TxAddInput_get_prevtx(this.ptr);
63 if (ret >= 0 && ret <= 4096) { return null; }
64 org.ldk.structs.TransactionU16LenLimited ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TransactionU16LenLimited(null, ret); }
65 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
70 * Serialized transaction that contains the output this input spends to verify that it is non
73 public void set_prevtx(org.ldk.structs.TransactionU16LenLimited val) {
74 bindings.TxAddInput_set_prevtx(this.ptr, val == null ? 0 : val.ptr);
77 if (this != null) { this.ptrs_to.AddLast(val); };
81 * The index of the output being spent
83 public int get_prevtx_out() {
84 int ret = bindings.TxAddInput_get_prevtx_out(this.ptr);
90 * The index of the output being spent
92 public void set_prevtx_out(int val) {
93 bindings.TxAddInput_set_prevtx_out(this.ptr, val);
99 * The sequence number of this input
101 public int get_sequence() {
102 int ret = bindings.TxAddInput_get_sequence(this.ptr);
108 * The sequence number of this input
110 public void set_sequence(int val) {
111 bindings.TxAddInput_set_sequence(this.ptr, val);
117 * Constructs a new TxAddInput given each field
119 public static TxAddInput of(byte[] channel_id_arg, long serial_id_arg, org.ldk.structs.TransactionU16LenLimited prevtx_arg, int prevtx_out_arg, int sequence_arg) {
120 long ret = bindings.TxAddInput_new(InternalUtils.check_arr_len(channel_id_arg, 32), serial_id_arg, prevtx_arg == null ? 0 : prevtx_arg.ptr, prevtx_out_arg, sequence_arg);
121 GC.KeepAlive(channel_id_arg);
122 GC.KeepAlive(serial_id_arg);
123 GC.KeepAlive(prevtx_arg);
124 GC.KeepAlive(prevtx_out_arg);
125 GC.KeepAlive(sequence_arg);
126 if (ret >= 0 && ret <= 4096) { return null; }
127 org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); }
128 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
129 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prevtx_arg); };
133 internal long clone_ptr() {
134 long ret = bindings.TxAddInput_clone_ptr(this.ptr);
140 * Creates a copy of the TxAddInput
142 public TxAddInput clone() {
143 long ret = bindings.TxAddInput_clone(this.ptr);
145 if (ret >= 0 && ret <= 4096) { return null; }
146 org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); }
147 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
152 * Checks if two TxAddInputs contain equal inner contents.
153 * This ignores pointers and is_owned flags and looks at the values in fields.
154 * Two objects with NULL inner values will be considered "equal" here.
156 public bool eq(org.ldk.structs.TxAddInput b) {
157 bool ret = bindings.TxAddInput_eq(this.ptr, b == null ? 0 : b.ptr);
160 if (this != null) { this.ptrs_to.AddLast(b); };
164 public override bool Equals(object o) {
165 if (!(o is TxAddInput)) return false;
166 return this.eq((TxAddInput)o);
169 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
171 public byte[] write() {
172 byte[] ret = bindings.TxAddInput_write(this.ptr);
178 * Read a TxAddInput from a byte array, created by TxAddInput_write
180 public static Result_TxAddInputDecodeErrorZ read(byte[] ser) {
181 long ret = bindings.TxAddInput_read(ser);
183 if (ret >= 0 && ret <= 4096) { return null; }
184 Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret);