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