6 namespace org { namespace ldk { namespace structs {
10 * A closing_signed message to be sent or received from a peer
12 public class ClosingSigned : CommonBase {
13 internal ClosingSigned(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.ClosingSigned_free(ptr); }
21 public byte[] get_channel_id() {
22 byte[] ret = bindings.ClosingSigned_get_channel_id(this.ptr);
30 public void set_channel_id(byte[] val) {
31 bindings.ClosingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * The proposed total fee for the closing transaction
39 public long get_fee_satoshis() {
40 long ret = bindings.ClosingSigned_get_fee_satoshis(this.ptr);
46 * The proposed total fee for the closing transaction
48 public void set_fee_satoshis(long val) {
49 bindings.ClosingSigned_set_fee_satoshis(this.ptr, val);
55 * A signature on the closing transaction
57 public byte[] get_signature() {
58 byte[] ret = bindings.ClosingSigned_get_signature(this.ptr);
64 * A signature on the closing transaction
66 public void set_signature(byte[] val) {
67 bindings.ClosingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
73 * The minimum and maximum fees which the sender is willing to accept, provided only by new
76 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
78 public ClosingSignedFeeRange get_fee_range() {
79 long ret = bindings.ClosingSigned_get_fee_range(this.ptr);
81 if (ret >= 0 && ret <= 4096) { return null; }
82 org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); }
83 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
88 * The minimum and maximum fees which the sender is willing to accept, provided only by new
91 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
93 public void set_fee_range(org.ldk.structs.ClosingSignedFeeRange val) {
94 bindings.ClosingSigned_set_fee_range(this.ptr, val == null ? 0 : val.ptr);
97 if (this != null) { this.ptrs_to.AddLast(val); };
101 * Constructs a new ClosingSigned given each field
103 public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, org.ldk.structs.ClosingSignedFeeRange fee_range_arg) {
104 long ret = bindings.ClosingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), fee_satoshis_arg, InternalUtils.check_arr_len(signature_arg, 64), fee_range_arg == null ? 0 : fee_range_arg.ptr);
105 GC.KeepAlive(channel_id_arg);
106 GC.KeepAlive(fee_satoshis_arg);
107 GC.KeepAlive(signature_arg);
108 GC.KeepAlive(fee_range_arg);
109 if (ret >= 0 && ret <= 4096) { return null; }
110 org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(null, ret); }
111 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
112 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_range_arg); };
116 internal long clone_ptr() {
117 long ret = bindings.ClosingSigned_clone_ptr(this.ptr);
123 * Creates a copy of the ClosingSigned
125 public ClosingSigned clone() {
126 long ret = bindings.ClosingSigned_clone(this.ptr);
128 if (ret >= 0 && ret <= 4096) { return null; }
129 org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(null, ret); }
130 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
135 * Checks if two ClosingSigneds contain equal inner contents.
136 * This ignores pointers and is_owned flags and looks at the values in fields.
137 * Two objects with NULL inner values will be considered "equal" here.
139 public bool eq(org.ldk.structs.ClosingSigned b) {
140 bool ret = bindings.ClosingSigned_eq(this.ptr, b == null ? 0 : b.ptr);
143 if (this != null) { this.ptrs_to.AddLast(b); };
147 public override bool Equals(object o) {
148 if (!(o is ClosingSigned)) return false;
149 return this.eq((ClosingSigned)o);
152 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
154 public byte[] write() {
155 byte[] ret = bindings.ClosingSigned_write(this.ptr);
161 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
163 public static Result_ClosingSignedDecodeErrorZ read(byte[] ser) {
164 long ret = bindings.ClosingSigned_read(ser);
166 if (ret >= 0 && ret <= 4096) { return null; }
167 Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);