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