[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / ClosingSignedFeeRange.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  * The minimum and maximum fees which the sender is willing to place on the closing transaction.
11  * 
12  * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
13  * to use.
14  */
15 public class ClosingSignedFeeRange : CommonBase {
16         internal ClosingSignedFeeRange(object _dummy, long ptr) : base(ptr) { }
17         ~ClosingSignedFeeRange() {
18                 if (ptr != 0) { bindings.ClosingSignedFeeRange_free(ptr); }
19         }
20
21         /**
22          * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
23          * transaction.
24          */
25         public long get_min_fee_satoshis() {
26                 long ret = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
27                 GC.KeepAlive(this);
28                 return ret;
29         }
30
31         /**
32          * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33          * transaction.
34          */
35         public void set_min_fee_satoshis(long val) {
36                 bindings.ClosingSignedFeeRange_set_min_fee_satoshis(this.ptr, val);
37                 GC.KeepAlive(this);
38                 GC.KeepAlive(val);
39         }
40
41         /**
42          * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
43          * transaction.
44          */
45         public long get_max_fee_satoshis() {
46                 long ret = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
47                 GC.KeepAlive(this);
48                 return ret;
49         }
50
51         /**
52          * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
53          * transaction.
54          */
55         public void set_max_fee_satoshis(long val) {
56                 bindings.ClosingSignedFeeRange_set_max_fee_satoshis(this.ptr, val);
57                 GC.KeepAlive(this);
58                 GC.KeepAlive(val);
59         }
60
61         /**
62          * Constructs a new ClosingSignedFeeRange given each field
63          */
64         public static ClosingSignedFeeRange of(long min_fee_satoshis_arg, long max_fee_satoshis_arg) {
65                 long ret = bindings.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
66                 GC.KeepAlive(min_fee_satoshis_arg);
67                 GC.KeepAlive(max_fee_satoshis_arg);
68                 if (ret >= 0 && ret <= 4096) { return null; }
69                 org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); }
70                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
71                 return ret_hu_conv;
72         }
73
74         internal long clone_ptr() {
75                 long ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr);
76                 GC.KeepAlive(this);
77                 return ret;
78         }
79
80         /**
81          * Creates a copy of the ClosingSignedFeeRange
82          */
83         public ClosingSignedFeeRange clone() {
84                 long ret = bindings.ClosingSignedFeeRange_clone(this.ptr);
85                 GC.KeepAlive(this);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); }
88                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
89                 return ret_hu_conv;
90         }
91
92         /**
93          * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
94          */
95         public long hash() {
96                 long ret = bindings.ClosingSignedFeeRange_hash(this.ptr);
97                 GC.KeepAlive(this);
98                 return ret;
99         }
100
101         public override int GetHashCode() {
102                 return (int)this.hash();
103         }
104         /**
105          * Checks if two ClosingSignedFeeRanges contain equal inner contents.
106          * This ignores pointers and is_owned flags and looks at the values in fields.
107          * Two objects with NULL inner values will be considered "equal" here.
108          */
109         public bool eq(org.ldk.structs.ClosingSignedFeeRange b) {
110                 bool ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b == null ? 0 : b.ptr);
111                 GC.KeepAlive(this);
112                 GC.KeepAlive(b);
113                 if (this != null) { this.ptrs_to.AddLast(b); };
114                 return ret;
115         }
116
117         public override bool Equals(object o) {
118                 if (!(o is ClosingSignedFeeRange)) return false;
119                 return this.eq((ClosingSignedFeeRange)o);
120         }
121         /**
122          * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
123          */
124         public byte[] write() {
125                 long ret = bindings.ClosingSignedFeeRange_write(this.ptr);
126                 GC.KeepAlive(this);
127                 if (ret >= 0 && ret <= 4096) { return null; }
128                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
129                 return ret_conv;
130         }
131
132         /**
133          * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
134          */
135         public static Result_ClosingSignedFeeRangeDecodeErrorZ read(byte[] ser) {
136                 long ret = bindings.ClosingSignedFeeRange_read(InternalUtils.encodeUint8Array(ser));
137                 GC.KeepAlive(ser);
138                 if (ret >= 0 && ret <= 4096) { return null; }
139                 Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
140                 return ret_hu_conv;
141         }
142
143 }
144 } } }