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 ChannelId get_channel_id() {
22 long ret = bindings.TxAddInput_get_channel_id(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
26 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
33 public void set_channel_id(org.ldk.structs.ChannelId val) {
34 bindings.TxAddInput_set_channel_id(this.ptr, val.ptr);
37 if (this != null) { this.ptrs_to.AddLast(val); };
41 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
44 public long get_serial_id() {
45 long ret = bindings.TxAddInput_get_serial_id(this.ptr);
51 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
54 public void set_serial_id(long val) {
55 bindings.TxAddInput_set_serial_id(this.ptr, val);
61 * Serialized transaction that contains the output this input spends to verify that it is non
64 public TransactionU16LenLimited get_prevtx() {
65 long ret = bindings.TxAddInput_get_prevtx(this.ptr);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 org.ldk.structs.TransactionU16LenLimited ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TransactionU16LenLimited(null, ret); }
69 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
74 * Serialized transaction that contains the output this input spends to verify that it is non
77 public void set_prevtx(org.ldk.structs.TransactionU16LenLimited val) {
78 bindings.TxAddInput_set_prevtx(this.ptr, val.ptr);
81 if (this != null) { this.ptrs_to.AddLast(val); };
85 * The index of the output being spent
87 public int get_prevtx_out() {
88 int ret = bindings.TxAddInput_get_prevtx_out(this.ptr);
94 * The index of the output being spent
96 public void set_prevtx_out(int val) {
97 bindings.TxAddInput_set_prevtx_out(this.ptr, val);
103 * The sequence number of this input
105 public int get_sequence() {
106 int ret = bindings.TxAddInput_get_sequence(this.ptr);
112 * The sequence number of this input
114 public void set_sequence(int val) {
115 bindings.TxAddInput_set_sequence(this.ptr, val);
121 * Constructs a new TxAddInput given each field
123 public static TxAddInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg, org.ldk.structs.TransactionU16LenLimited prevtx_arg, int prevtx_out_arg, int sequence_arg) {
124 long ret = bindings.TxAddInput_new(channel_id_arg.ptr, serial_id_arg, prevtx_arg.ptr, prevtx_out_arg, sequence_arg);
125 GC.KeepAlive(channel_id_arg);
126 GC.KeepAlive(serial_id_arg);
127 GC.KeepAlive(prevtx_arg);
128 GC.KeepAlive(prevtx_out_arg);
129 GC.KeepAlive(sequence_arg);
130 if (ret >= 0 && ret <= 4096) { return null; }
131 org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); }
132 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
133 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
134 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prevtx_arg); };
138 internal long clone_ptr() {
139 long ret = bindings.TxAddInput_clone_ptr(this.ptr);
145 * Creates a copy of the TxAddInput
147 public TxAddInput clone() {
148 long ret = bindings.TxAddInput_clone(this.ptr);
150 if (ret >= 0 && ret <= 4096) { return null; }
151 org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); }
152 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
157 * Generates a non-cryptographic 64-bit hash of the TxAddInput.
160 long ret = bindings.TxAddInput_hash(this.ptr);
165 public override int GetHashCode() {
166 return (int)this.hash();
169 * Checks if two TxAddInputs contain equal inner contents.
170 * This ignores pointers and is_owned flags and looks at the values in fields.
171 * Two objects with NULL inner values will be considered "equal" here.
173 public bool eq(org.ldk.structs.TxAddInput b) {
174 bool ret = bindings.TxAddInput_eq(this.ptr, b.ptr);
177 if (this != null) { this.ptrs_to.AddLast(b); };
181 public override bool Equals(object o) {
182 if (!(o is TxAddInput)) return false;
183 return this.eq((TxAddInput)o);
186 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
188 public byte[] write() {
189 long ret = bindings.TxAddInput_write(this.ptr);
191 if (ret >= 0 && ret <= 4096) { return null; }
192 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
197 * Read a TxAddInput from a byte array, created by TxAddInput_write
199 public static Result_TxAddInputDecodeErrorZ read(byte[] ser) {
200 long ret = bindings.TxAddInput_read(InternalUtils.encodeUint8Array(ser));
202 if (ret >= 0 && ret <= 4096) { return null; }
203 Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret);