[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / TxAckRbf.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_ack_rbf message which acknowledges replacement of the transaction after it's been
11  * completed.
12  */
13 public class TxAckRbf : CommonBase {
14         internal TxAckRbf(object _dummy, long ptr) : base(ptr) { }
15         ~TxAckRbf() {
16                 if (ptr != 0) { bindings.TxAckRbf_free(ptr); }
17         }
18
19         /**
20          * The channel ID
21          */
22         public byte[] get_channel_id() {
23                 byte[] ret = bindings.TxAckRbf_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.TxAckRbf_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
33                 GC.KeepAlive(this);
34                 GC.KeepAlive(val);
35         }
36
37         /**
38          * The number of satoshis the sender will contribute to or, if negative, remove from
39          * (e.g. splice-out) the funding output of the transaction
40          */
41         public Option_i64Z get_funding_output_contribution() {
42                 long ret = bindings.TxAckRbf_get_funding_output_contribution(this.ptr);
43                 GC.KeepAlive(this);
44                 if (ret >= 0 && ret <= 4096) { return null; }
45                 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
46                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
47                 return ret_hu_conv;
48         }
49
50         /**
51          * The number of satoshis the sender will contribute to or, if negative, remove from
52          * (e.g. splice-out) the funding output of the transaction
53          */
54         public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
55                 bindings.TxAckRbf_set_funding_output_contribution(this.ptr, val.ptr);
56                 GC.KeepAlive(this);
57                 GC.KeepAlive(val);
58                 if (this != null) { this.ptrs_to.AddLast(val); };
59         }
60
61         /**
62          * Constructs a new TxAckRbf given each field
63          */
64         public static TxAckRbf of(byte[] channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) {
65                 long ret = bindings.TxAckRbf_new(InternalUtils.check_arr_len(channel_id_arg, 32), funding_output_contribution_arg.ptr);
66                 GC.KeepAlive(channel_id_arg);
67                 GC.KeepAlive(funding_output_contribution_arg);
68                 if (ret >= 0 && ret <= 4096) { return null; }
69                 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
70                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
71                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
72                 return ret_hu_conv;
73         }
74
75         internal long clone_ptr() {
76                 long ret = bindings.TxAckRbf_clone_ptr(this.ptr);
77                 GC.KeepAlive(this);
78                 return ret;
79         }
80
81         /**
82          * Creates a copy of the TxAckRbf
83          */
84         public TxAckRbf clone() {
85                 long ret = bindings.TxAckRbf_clone(this.ptr);
86                 GC.KeepAlive(this);
87                 if (ret >= 0 && ret <= 4096) { return null; }
88                 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
89                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
90                 return ret_hu_conv;
91         }
92
93         /**
94          * Checks if two TxAckRbfs contain equal inner contents.
95          * This ignores pointers and is_owned flags and looks at the values in fields.
96          * Two objects with NULL inner values will be considered "equal" here.
97          */
98         public bool eq(org.ldk.structs.TxAckRbf b) {
99                 bool ret = bindings.TxAckRbf_eq(this.ptr, b == null ? 0 : b.ptr);
100                 GC.KeepAlive(this);
101                 GC.KeepAlive(b);
102                 if (this != null) { this.ptrs_to.AddLast(b); };
103                 return ret;
104         }
105
106         public override bool Equals(object o) {
107                 if (!(o is TxAckRbf)) return false;
108                 return this.eq((TxAckRbf)o);
109         }
110         /**
111          * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
112          */
113         public byte[] write() {
114                 byte[] ret = bindings.TxAckRbf_write(this.ptr);
115                 GC.KeepAlive(this);
116                 return ret;
117         }
118
119         /**
120          * Read a TxAckRbf from a byte array, created by TxAckRbf_write
121          */
122         public static Result_TxAckRbfDecodeErrorZ read(byte[] ser) {
123                 long ret = bindings.TxAckRbf_read(ser);
124                 GC.KeepAlive(ser);
125                 if (ret >= 0 && ret <= 4096) { return null; }
126                 Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret);
127                 return ret_hu_conv;
128         }
129
130 }
131 } } }