6 namespace org { namespace ldk { namespace structs {
10 * A tx_remove_input message for removing an input during interactive transaction construction.
12 public class TxRemoveInput : CommonBase {
13 internal TxRemoveInput(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.TxRemoveInput_free(ptr); }
21 public ChannelId get_channel_id() {
22 long ret = bindings.TxRemoveInput_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.TxRemoveInput_set_channel_id(this.ptr, val.ptr);
37 if (this != null) { this.ptrs_to.AddLast(val); };
41 * The serial ID of the input to be removed
43 public long get_serial_id() {
44 long ret = bindings.TxRemoveInput_get_serial_id(this.ptr);
50 * The serial ID of the input to be removed
52 public void set_serial_id(long val) {
53 bindings.TxRemoveInput_set_serial_id(this.ptr, val);
59 * Constructs a new TxRemoveInput given each field
61 public static TxRemoveInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg) {
62 long ret = bindings.TxRemoveInput_new(channel_id_arg.ptr, serial_id_arg);
63 GC.KeepAlive(channel_id_arg);
64 GC.KeepAlive(serial_id_arg);
65 if (ret >= 0 && ret <= 4096) { return null; }
66 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
67 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
68 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
72 internal long clone_ptr() {
73 long ret = bindings.TxRemoveInput_clone_ptr(this.ptr);
79 * Creates a copy of the TxRemoveInput
81 public TxRemoveInput clone() {
82 long ret = bindings.TxRemoveInput_clone(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
91 * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
94 long ret = bindings.TxRemoveInput_hash(this.ptr);
99 public override int GetHashCode() {
100 return (int)this.hash();
103 * Checks if two TxRemoveInputs contain equal inner contents.
104 * This ignores pointers and is_owned flags and looks at the values in fields.
105 * Two objects with NULL inner values will be considered "equal" here.
107 public bool eq(org.ldk.structs.TxRemoveInput b) {
108 bool ret = bindings.TxRemoveInput_eq(this.ptr, b.ptr);
111 if (this != null) { this.ptrs_to.AddLast(b); };
115 public override bool Equals(object o) {
116 if (!(o is TxRemoveInput)) return false;
117 return this.eq((TxRemoveInput)o);
120 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
122 public byte[] write() {
123 long ret = bindings.TxRemoveInput_write(this.ptr);
125 if (ret >= 0 && ret <= 4096) { return null; }
126 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
131 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
133 public static Result_TxRemoveInputDecodeErrorZ read(byte[] ser) {
134 long ret = bindings.TxRemoveInput_read(InternalUtils.encodeUint8Array(ser));
136 if (ret >= 0 && ret <= 4096) { return null; }
137 Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret);