[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / TxSignatures.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_signatures message containing the sender's signatures for a transaction constructed with
11  * interactive transaction construction.
12  */
13 public class TxSignatures : CommonBase {
14         internal TxSignatures(object _dummy, long ptr) : base(ptr) { }
15         ~TxSignatures() {
16                 if (ptr != 0) { bindings.TxSignatures_free(ptr); }
17         }
18
19         /**
20          * The channel ID
21          */
22         public byte[] get_channel_id() {
23                 byte[] ret = bindings.TxSignatures_get_channel_id(this.ptr);
24                 GC.KeepAlive(this);
25                 return ret;
26         }
27
28         /**
29          * The channel ID
30          */
31         public void set_channel_id(byte[] val) {
32                 bindings.TxSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
33                 GC.KeepAlive(this);
34                 GC.KeepAlive(val);
35         }
36
37         /**
38          * The TXID
39          */
40         public byte[] get_tx_hash() {
41                 byte[] ret = bindings.TxSignatures_get_tx_hash(this.ptr);
42                 GC.KeepAlive(this);
43                 return ret;
44         }
45
46         /**
47          * The TXID
48          */
49         public void set_tx_hash(byte[] val) {
50                 bindings.TxSignatures_set_tx_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
51                 GC.KeepAlive(this);
52                 GC.KeepAlive(val);
53         }
54
55         /**
56          * The list of witnesses
57          * 
58          * Returns a copy of the field.
59          */
60         public byte[][] get_witnesses() {
61                 byte[][] ret = bindings.TxSignatures_get_witnesses(this.ptr);
62                 GC.KeepAlive(this);
63                 return ret;
64         }
65
66         /**
67          * The list of witnesses
68          */
69         public void set_witnesses(byte[][] val) {
70                 bindings.TxSignatures_set_witnesses(this.ptr, val);
71                 GC.KeepAlive(this);
72                 GC.KeepAlive(val);
73         }
74
75         /**
76          * Constructs a new TxSignatures given each field
77          */
78         public static TxSignatures of(byte[] channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg) {
79                 long ret = bindings.TxSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(tx_hash_arg, 32), witnesses_arg);
80                 GC.KeepAlive(channel_id_arg);
81                 GC.KeepAlive(tx_hash_arg);
82                 GC.KeepAlive(witnesses_arg);
83                 if (ret >= 0 && ret <= 4096) { return null; }
84                 org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); }
85                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
86                 return ret_hu_conv;
87         }
88
89         internal long clone_ptr() {
90                 long ret = bindings.TxSignatures_clone_ptr(this.ptr);
91                 GC.KeepAlive(this);
92                 return ret;
93         }
94
95         /**
96          * Creates a copy of the TxSignatures
97          */
98         public TxSignatures clone() {
99                 long ret = bindings.TxSignatures_clone(this.ptr);
100                 GC.KeepAlive(this);
101                 if (ret >= 0 && ret <= 4096) { return null; }
102                 org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); }
103                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
104                 return ret_hu_conv;
105         }
106
107         /**
108          * Checks if two TxSignaturess contain equal inner contents.
109          * This ignores pointers and is_owned flags and looks at the values in fields.
110          * Two objects with NULL inner values will be considered "equal" here.
111          */
112         public bool eq(org.ldk.structs.TxSignatures b) {
113                 bool ret = bindings.TxSignatures_eq(this.ptr, b == null ? 0 : b.ptr);
114                 GC.KeepAlive(this);
115                 GC.KeepAlive(b);
116                 if (this != null) { this.ptrs_to.AddLast(b); };
117                 return ret;
118         }
119
120         public override bool Equals(object o) {
121                 if (!(o is TxSignatures)) return false;
122                 return this.eq((TxSignatures)o);
123         }
124         /**
125          * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
126          */
127         public byte[] write() {
128                 byte[] ret = bindings.TxSignatures_write(this.ptr);
129                 GC.KeepAlive(this);
130                 return ret;
131         }
132
133         /**
134          * Read a TxSignatures from a byte array, created by TxSignatures_write
135          */
136         public static Result_TxSignaturesDecodeErrorZ read(byte[] ser) {
137                 long ret = bindings.TxSignatures_read(ser);
138                 GC.KeepAlive(ser);
139                 if (ret >= 0 && ret <= 4096) { return null; }
140                 Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret);
141                 return ret_hu_conv;
142         }
143
144 }
145 } } }