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