[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / TxInitRbf.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_init_rbf message which initiates a replacement of the transaction after it's been
11  * completed.
12  */
13 public class TxInitRbf : CommonBase {
14         internal TxInitRbf(object _dummy, long ptr) : base(ptr) { }
15         ~TxInitRbf() {
16                 if (ptr != 0) { bindings.TxInitRbf_free(ptr); }
17         }
18
19         /**
20          * The channel ID
21          */
22         public byte[] get_channel_id() {
23                 long ret = bindings.TxInitRbf_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.TxInitRbf_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          * The locktime of the transaction
41          */
42         public int get_locktime() {
43                 int ret = bindings.TxInitRbf_get_locktime(this.ptr);
44                 GC.KeepAlive(this);
45                 return ret;
46         }
47
48         /**
49          * The locktime of the transaction
50          */
51         public void set_locktime(int val) {
52                 bindings.TxInitRbf_set_locktime(this.ptr, val);
53                 GC.KeepAlive(this);
54                 GC.KeepAlive(val);
55         }
56
57         /**
58          * The feerate of the transaction
59          */
60         public int get_feerate_sat_per_1000_weight() {
61                 int ret = bindings.TxInitRbf_get_feerate_sat_per_1000_weight(this.ptr);
62                 GC.KeepAlive(this);
63                 return ret;
64         }
65
66         /**
67          * The feerate of the transaction
68          */
69         public void set_feerate_sat_per_1000_weight(int val) {
70                 bindings.TxInitRbf_set_feerate_sat_per_1000_weight(this.ptr, val);
71                 GC.KeepAlive(this);
72                 GC.KeepAlive(val);
73         }
74
75         /**
76          * The number of satoshis the sender will contribute to or, if negative, remove from
77          * (e.g. splice-out) the funding output of the transaction
78          */
79         public Option_i64Z get_funding_output_contribution() {
80                 long ret = bindings.TxInitRbf_get_funding_output_contribution(this.ptr);
81                 GC.KeepAlive(this);
82                 if (ret >= 0 && ret <= 4096) { return null; }
83                 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
84                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
85                 return ret_hu_conv;
86         }
87
88         /**
89          * The number of satoshis the sender will contribute to or, if negative, remove from
90          * (e.g. splice-out) the funding output of the transaction
91          */
92         public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
93                 bindings.TxInitRbf_set_funding_output_contribution(this.ptr, val.ptr);
94                 GC.KeepAlive(this);
95                 GC.KeepAlive(val);
96                 if (this != null) { this.ptrs_to.AddLast(val); };
97         }
98
99         /**
100          * Constructs a new TxInitRbf given each field
101          */
102         public static TxInitRbf of(byte[] channel_id_arg, int locktime_arg, int feerate_sat_per_1000_weight_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) {
103                 long ret = bindings.TxInitRbf_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg.ptr);
104                 GC.KeepAlive(channel_id_arg);
105                 GC.KeepAlive(locktime_arg);
106                 GC.KeepAlive(feerate_sat_per_1000_weight_arg);
107                 GC.KeepAlive(funding_output_contribution_arg);
108                 if (ret >= 0 && ret <= 4096) { return null; }
109                 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
110                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
111                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
112                 return ret_hu_conv;
113         }
114
115         internal long clone_ptr() {
116                 long ret = bindings.TxInitRbf_clone_ptr(this.ptr);
117                 GC.KeepAlive(this);
118                 return ret;
119         }
120
121         /**
122          * Creates a copy of the TxInitRbf
123          */
124         public TxInitRbf clone() {
125                 long ret = bindings.TxInitRbf_clone(this.ptr);
126                 GC.KeepAlive(this);
127                 if (ret >= 0 && ret <= 4096) { return null; }
128                 org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); }
129                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
130                 return ret_hu_conv;
131         }
132
133         /**
134          * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
135          */
136         public long hash() {
137                 long ret = bindings.TxInitRbf_hash(this.ptr);
138                 GC.KeepAlive(this);
139                 return ret;
140         }
141
142         public override int GetHashCode() {
143                 return (int)this.hash();
144         }
145         /**
146          * Checks if two TxInitRbfs contain equal inner contents.
147          * This ignores pointers and is_owned flags and looks at the values in fields.
148          * Two objects with NULL inner values will be considered "equal" here.
149          */
150         public bool eq(org.ldk.structs.TxInitRbf b) {
151                 bool ret = bindings.TxInitRbf_eq(this.ptr, b == null ? 0 : b.ptr);
152                 GC.KeepAlive(this);
153                 GC.KeepAlive(b);
154                 if (this != null) { this.ptrs_to.AddLast(b); };
155                 return ret;
156         }
157
158         public override bool Equals(object o) {
159                 if (!(o is TxInitRbf)) return false;
160                 return this.eq((TxInitRbf)o);
161         }
162         /**
163          * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
164          */
165         public byte[] write() {
166                 long ret = bindings.TxInitRbf_write(this.ptr);
167                 GC.KeepAlive(this);
168                 if (ret >= 0 && ret <= 4096) { return null; }
169                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
170                 return ret_conv;
171         }
172
173         /**
174          * Read a TxInitRbf from a byte array, created by TxInitRbf_write
175          */
176         public static Result_TxInitRbfDecodeErrorZ read(byte[] ser) {
177                 long ret = bindings.TxInitRbf_read(InternalUtils.encodeUint8Array(ser));
178                 GC.KeepAlive(ser);
179                 if (ret >= 0 && ret <= 4096) { return null; }
180                 Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret);
181                 return ret_hu_conv;
182         }
183
184 }
185 } } }