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 byte[] get_channel_id() {
22 long ret = bindings.SpliceAck_get_channel_id(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
30 * The channel ID where splicing is intended
32 public void set_channel_id(byte[] val) {
33 bindings.SpliceAck_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
39 * The genesis hash of the blockchain where the channel is intended to be spliced
41 public byte[] get_chain_hash() {
42 long ret = bindings.SpliceAck_get_chain_hash(this.ptr);
44 if (ret >= 0 && ret <= 4096) { return null; }
45 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
50 * The genesis hash of the blockchain where the channel is intended to be spliced
52 public void set_chain_hash(byte[] val) {
53 bindings.SpliceAck_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
59 * The intended change in channel capacity: the amount to be added (positive value)
60 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
62 public long get_relative_satoshis() {
63 long ret = bindings.SpliceAck_get_relative_satoshis(this.ptr);
69 * The intended change in channel capacity: the amount to be added (positive value)
70 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
72 public void set_relative_satoshis(long val) {
73 bindings.SpliceAck_set_relative_satoshis(this.ptr, val);
79 * The key of the sender (splice acceptor) controlling the new funding transaction
81 public byte[] get_funding_pubkey() {
82 long ret = bindings.SpliceAck_get_funding_pubkey(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
90 * The key of the sender (splice acceptor) controlling the new funding transaction
92 public void set_funding_pubkey(byte[] val) {
93 bindings.SpliceAck_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
99 * Constructs a new SpliceAck given each field
101 public static SpliceAck of(byte[] channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, byte[] funding_pubkey_arg) {
102 long ret = bindings.SpliceAck_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), relative_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)));
103 GC.KeepAlive(channel_id_arg);
104 GC.KeepAlive(chain_hash_arg);
105 GC.KeepAlive(relative_satoshis_arg);
106 GC.KeepAlive(funding_pubkey_arg);
107 if (ret >= 0 && ret <= 4096) { return null; }
108 org.ldk.structs.SpliceAck ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceAck(null, ret); }
109 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
113 internal long clone_ptr() {
114 long ret = bindings.SpliceAck_clone_ptr(this.ptr);
120 * Creates a copy of the SpliceAck
122 public SpliceAck clone() {
123 long ret = bindings.SpliceAck_clone(this.ptr);
125 if (ret >= 0 && ret <= 4096) { return null; }
126 org.ldk.structs.SpliceAck ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceAck(null, ret); }
127 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
132 * Checks if two SpliceAcks contain equal inner contents.
133 * This ignores pointers and is_owned flags and looks at the values in fields.
134 * Two objects with NULL inner values will be considered "equal" here.
136 public bool eq(org.ldk.structs.SpliceAck b) {
137 bool ret = bindings.SpliceAck_eq(this.ptr, b == null ? 0 : b.ptr);
140 if (this != null) { this.ptrs_to.AddLast(b); };
144 public override bool Equals(object o) {
145 if (!(o is SpliceAck)) return false;
146 return this.eq((SpliceAck)o);
149 * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
151 public byte[] write() {
152 long ret = bindings.SpliceAck_write(this.ptr);
154 if (ret >= 0 && ret <= 4096) { return null; }
155 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
160 * Read a SpliceAck from a byte array, created by SpliceAck_write
162 public static Result_SpliceAckDecodeErrorZ read(byte[] ser) {
163 long ret = bindings.SpliceAck_read(InternalUtils.encodeUint8Array(ser));
165 if (ret >= 0 && ret <= 4096) { return null; }
166 Result_SpliceAckDecodeErrorZ ret_hu_conv = Result_SpliceAckDecodeErrorZ.constr_from_ptr(ret);