6 namespace org { namespace ldk { namespace structs {
10 * A splice_ack message to be received by or sent to the splice initiator.
12 public class SpliceAck : CommonBase {
13 internal SpliceAck(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.SpliceAck_free(ptr); }
19 * The channel ID where splicing is intended
21 public ChannelId get_channel_id() {
22 long ret = bindings.SpliceAck_get_channel_id(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
26 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
31 * The channel ID where splicing is intended
33 public void set_channel_id(org.ldk.structs.ChannelId val) {
34 bindings.SpliceAck_set_channel_id(this.ptr, val.ptr);
37 if (this != null) { this.ptrs_to.AddLast(val); };
41 * The genesis hash of the blockchain where the channel is intended to be spliced
43 public byte[] get_chain_hash() {
44 long ret = bindings.SpliceAck_get_chain_hash(this.ptr);
46 if (ret >= 0 && ret <= 4096) { return null; }
47 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
52 * The genesis hash of the blockchain where the channel is intended to be spliced
54 public void set_chain_hash(byte[] val) {
55 bindings.SpliceAck_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
61 * The intended change in channel capacity: the amount to be added (positive value)
62 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
64 public long get_relative_satoshis() {
65 long ret = bindings.SpliceAck_get_relative_satoshis(this.ptr);
71 * The intended change in channel capacity: the amount to be added (positive value)
72 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
74 public void set_relative_satoshis(long val) {
75 bindings.SpliceAck_set_relative_satoshis(this.ptr, val);
81 * The key of the sender (splice acceptor) controlling the new funding transaction
83 public byte[] get_funding_pubkey() {
84 long ret = bindings.SpliceAck_get_funding_pubkey(this.ptr);
86 if (ret >= 0 && ret <= 4096) { return null; }
87 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
92 * The key of the sender (splice acceptor) controlling the new funding transaction
94 public void set_funding_pubkey(byte[] val) {
95 bindings.SpliceAck_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
101 * Constructs a new SpliceAck given each field
103 public static SpliceAck of(org.ldk.structs.ChannelId channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, byte[] funding_pubkey_arg) {
104 long ret = bindings.SpliceAck_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), relative_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)));
105 GC.KeepAlive(channel_id_arg);
106 GC.KeepAlive(chain_hash_arg);
107 GC.KeepAlive(relative_satoshis_arg);
108 GC.KeepAlive(funding_pubkey_arg);
109 if (ret >= 0 && ret <= 4096) { return null; }
110 org.ldk.structs.SpliceAck ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceAck(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(channel_id_arg); };
116 internal long clone_ptr() {
117 long ret = bindings.SpliceAck_clone_ptr(this.ptr);
123 * Creates a copy of the SpliceAck
125 public SpliceAck clone() {
126 long ret = bindings.SpliceAck_clone(this.ptr);
128 if (ret >= 0 && ret <= 4096) { return null; }
129 org.ldk.structs.SpliceAck ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceAck(null, ret); }
130 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
135 * Checks if two SpliceAcks 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.SpliceAck b) {
140 bool ret = bindings.SpliceAck_eq(this.ptr, b.ptr);
143 if (this != null) { this.ptrs_to.AddLast(b); };
147 public override bool Equals(object o) {
148 if (!(o is SpliceAck)) return false;
149 return this.eq((SpliceAck)o);
152 * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
154 public byte[] write() {
155 long ret = bindings.SpliceAck_write(this.ptr);
157 if (ret >= 0 && ret <= 4096) { return null; }
158 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
163 * Read a SpliceAck from a byte array, created by SpliceAck_write
165 public static Result_SpliceAckDecodeErrorZ read(byte[] ser) {
166 long ret = bindings.SpliceAck_read(InternalUtils.encodeUint8Array(ser));
168 if (ret >= 0 && ret <= 4096) { return null; }
169 Result_SpliceAckDecodeErrorZ ret_hu_conv = Result_SpliceAckDecodeErrorZ.constr_from_ptr(ret);