6 namespace org { namespace ldk { namespace structs {
10 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
11 * interactive transaction construction.
13 public class TxComplete : CommonBase {
14 internal TxComplete(object _dummy, long ptr) : base(ptr) { }
16 if (ptr != 0) { bindings.TxComplete_free(ptr); }
22 public ChannelId get_channel_id() {
23 long ret = bindings.TxComplete_get_channel_id(this.ptr);
25 if (ret >= 0 && ret <= 4096) { return null; }
26 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
27 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
34 public void set_channel_id(org.ldk.structs.ChannelId val) {
35 bindings.TxComplete_set_channel_id(this.ptr, val.ptr);
38 if (this != null) { this.ptrs_to.AddLast(val); };
42 * Constructs a new TxComplete given each field
44 public static TxComplete of(org.ldk.structs.ChannelId channel_id_arg) {
45 long ret = bindings.TxComplete_new(channel_id_arg.ptr);
46 GC.KeepAlive(channel_id_arg);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
50 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
54 internal long clone_ptr() {
55 long ret = bindings.TxComplete_clone_ptr(this.ptr);
61 * Creates a copy of the TxComplete
63 public TxComplete clone() {
64 long ret = bindings.TxComplete_clone(this.ptr);
66 if (ret >= 0 && ret <= 4096) { return null; }
67 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
68 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
73 * Generates a non-cryptographic 64-bit hash of the TxComplete.
76 long ret = bindings.TxComplete_hash(this.ptr);
81 public override int GetHashCode() {
82 return (int)this.hash();
85 * Checks if two TxCompletes contain equal inner contents.
86 * This ignores pointers and is_owned flags and looks at the values in fields.
87 * Two objects with NULL inner values will be considered "equal" here.
89 public bool eq(org.ldk.structs.TxComplete b) {
90 bool ret = bindings.TxComplete_eq(this.ptr, b.ptr);
93 if (this != null) { this.ptrs_to.AddLast(b); };
97 public override bool Equals(object o) {
98 if (!(o is TxComplete)) return false;
99 return this.eq((TxComplete)o);
102 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
104 public byte[] write() {
105 long ret = bindings.TxComplete_write(this.ptr);
107 if (ret >= 0 && ret <= 4096) { return null; }
108 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
113 * Read a TxComplete from a byte array, created by TxComplete_write
115 public static Result_TxCompleteDecodeErrorZ read(byte[] ser) {
116 long ret = bindings.TxComplete_read(InternalUtils.encodeUint8Array(ser));
118 if (ret >= 0 && ret <= 4096) { return null; }
119 Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret);