[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          * Checks if two TxInitRbfs contain equal inner contents.
135          * This ignores pointers and is_owned flags and looks at the values in fields.
136          * Two objects with NULL inner values will be considered "equal" here.
137          */
138         public bool eq(org.ldk.structs.TxInitRbf b) {
139                 bool ret = bindings.TxInitRbf_eq(this.ptr, b == null ? 0 : b.ptr);
140                 GC.KeepAlive(this);
141                 GC.KeepAlive(b);
142                 if (this != null) { this.ptrs_to.AddLast(b); };
143                 return ret;
144         }
145
146         public override bool Equals(object o) {
147                 if (!(o is TxInitRbf)) return false;
148                 return this.eq((TxInitRbf)o);
149         }
150         /**
151          * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
152          */
153         public byte[] write() {
154                 long ret = bindings.TxInitRbf_write(this.ptr);
155                 GC.KeepAlive(this);
156                 if (ret >= 0 && ret <= 4096) { return null; }
157                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
158                 return ret_conv;
159         }
160
161         /**
162          * Read a TxInitRbf from a byte array, created by TxInitRbf_write
163          */
164         public static Result_TxInitRbfDecodeErrorZ read(byte[] ser) {
165                 long ret = bindings.TxInitRbf_read(InternalUtils.encodeUint8Array(ser));
166                 GC.KeepAlive(ser);
167                 if (ret >= 0 && ret <= 4096) { return null; }
168                 Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret);
169                 return ret_hu_conv;
170         }
171
172 }
173 } } }