[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / TxComplete.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A tx_complete message signalling the conclusion of a peer's transaction contributions during
11  * interactive transaction construction.
12  */
13 public class TxComplete : CommonBase {
14         internal TxComplete(object _dummy, long ptr) : base(ptr) { }
15         ~TxComplete() {
16                 if (ptr != 0) { bindings.TxComplete_free(ptr); }
17         }
18
19         /**
20          * The channel ID
21          */
22         public byte[] get_channel_id() {
23                 long ret = bindings.TxComplete_get_channel_id(this.ptr);
24                 GC.KeepAlive(this);
25                 if (ret >= 0 && ret <= 4096) { return null; }
26                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
27                 return ret_conv;
28         }
29
30         /**
31          * The channel ID
32          */
33         public void set_channel_id(byte[] val) {
34                 bindings.TxComplete_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
35                 GC.KeepAlive(this);
36                 GC.KeepAlive(val);
37         }
38
39         /**
40          * Constructs a new TxComplete given each field
41          */
42         public static TxComplete of(byte[] channel_id_arg) {
43                 long ret = bindings.TxComplete_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)));
44                 GC.KeepAlive(channel_id_arg);
45                 if (ret >= 0 && ret <= 4096) { return null; }
46                 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
47                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
48                 return ret_hu_conv;
49         }
50
51         internal long clone_ptr() {
52                 long ret = bindings.TxComplete_clone_ptr(this.ptr);
53                 GC.KeepAlive(this);
54                 return ret;
55         }
56
57         /**
58          * Creates a copy of the TxComplete
59          */
60         public TxComplete clone() {
61                 long ret = bindings.TxComplete_clone(this.ptr);
62                 GC.KeepAlive(this);
63                 if (ret >= 0 && ret <= 4096) { return null; }
64                 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
65                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
66                 return ret_hu_conv;
67         }
68
69         /**
70          * Checks if two TxCompletes contain equal inner contents.
71          * This ignores pointers and is_owned flags and looks at the values in fields.
72          * Two objects with NULL inner values will be considered "equal" here.
73          */
74         public bool eq(org.ldk.structs.TxComplete b) {
75                 bool ret = bindings.TxComplete_eq(this.ptr, b == null ? 0 : b.ptr);
76                 GC.KeepAlive(this);
77                 GC.KeepAlive(b);
78                 if (this != null) { this.ptrs_to.AddLast(b); };
79                 return ret;
80         }
81
82         public override bool Equals(object o) {
83                 if (!(o is TxComplete)) return false;
84                 return this.eq((TxComplete)o);
85         }
86         /**
87          * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
88          */
89         public byte[] write() {
90                 long ret = bindings.TxComplete_write(this.ptr);
91                 GC.KeepAlive(this);
92                 if (ret >= 0 && ret <= 4096) { return null; }
93                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
94                 return ret_conv;
95         }
96
97         /**
98          * Read a TxComplete from a byte array, created by TxComplete_write
99          */
100         public static Result_TxCompleteDecodeErrorZ read(byte[] ser) {
101                 long ret = bindings.TxComplete_read(InternalUtils.encodeUint8Array(ser));
102                 GC.KeepAlive(ser);
103                 if (ret >= 0 && ret <= 4096) { return null; }
104                 Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret);
105                 return ret_hu_conv;
106         }
107
108 }
109 } } }