6 namespace org { namespace ldk { namespace structs {
10 * A splice message to be sent by or received from the stfu initiator (splice initiator).
12 public class Splice : CommonBase {
13 internal Splice(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.Splice_free(ptr); }
19 * The channel ID where splicing is intended
21 public ChannelId get_channel_id() {
22 long ret = bindings.Splice_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.Splice_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.Splice_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.Splice_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 initiator) by splicing into/from the channel.
64 public long get_relative_satoshis() {
65 long ret = bindings.Splice_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 initiator) by splicing into/from the channel.
74 public void set_relative_satoshis(long val) {
75 bindings.Splice_set_relative_satoshis(this.ptr, val);
81 * The feerate for the new funding transaction, set by the splice initiator
83 public int get_funding_feerate_perkw() {
84 int ret = bindings.Splice_get_funding_feerate_perkw(this.ptr);
90 * The feerate for the new funding transaction, set by the splice initiator
92 public void set_funding_feerate_perkw(int val) {
93 bindings.Splice_set_funding_feerate_perkw(this.ptr, val);
99 * The locktime for the new funding transaction
101 public int get_locktime() {
102 int ret = bindings.Splice_get_locktime(this.ptr);
108 * The locktime for the new funding transaction
110 public void set_locktime(int val) {
111 bindings.Splice_set_locktime(this.ptr, val);
117 * The key of the sender (splice initiator) controlling the new funding transaction
119 public byte[] get_funding_pubkey() {
120 long ret = bindings.Splice_get_funding_pubkey(this.ptr);
122 if (ret >= 0 && ret <= 4096) { return null; }
123 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
128 * The key of the sender (splice initiator) controlling the new funding transaction
130 public void set_funding_pubkey(byte[] val) {
131 bindings.Splice_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
137 * Constructs a new Splice given each field
139 public static Splice of(org.ldk.structs.ChannelId channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg) {
140 long ret = bindings.Splice_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)));
141 GC.KeepAlive(channel_id_arg);
142 GC.KeepAlive(chain_hash_arg);
143 GC.KeepAlive(relative_satoshis_arg);
144 GC.KeepAlive(funding_feerate_perkw_arg);
145 GC.KeepAlive(locktime_arg);
146 GC.KeepAlive(funding_pubkey_arg);
147 if (ret >= 0 && ret <= 4096) { return null; }
148 org.ldk.structs.Splice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Splice(null, ret); }
149 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
150 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
154 internal long clone_ptr() {
155 long ret = bindings.Splice_clone_ptr(this.ptr);
161 * Creates a copy of the Splice
163 public Splice clone() {
164 long ret = bindings.Splice_clone(this.ptr);
166 if (ret >= 0 && ret <= 4096) { return null; }
167 org.ldk.structs.Splice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Splice(null, ret); }
168 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
173 * Checks if two Splices contain equal inner contents.
174 * This ignores pointers and is_owned flags and looks at the values in fields.
175 * Two objects with NULL inner values will be considered "equal" here.
177 public bool eq(org.ldk.structs.Splice b) {
178 bool ret = bindings.Splice_eq(this.ptr, b.ptr);
181 if (this != null) { this.ptrs_to.AddLast(b); };
185 public override bool Equals(object o) {
186 if (!(o is Splice)) return false;
187 return this.eq((Splice)o);
190 * Serialize the Splice object into a byte array which can be read by Splice_read
192 public byte[] write() {
193 long ret = bindings.Splice_write(this.ptr);
195 if (ret >= 0 && ret <= 4096) { return null; }
196 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
201 * Read a Splice from a byte array, created by Splice_write
203 public static Result_SpliceDecodeErrorZ read(byte[] ser) {
204 long ret = bindings.Splice_read(InternalUtils.encodeUint8Array(ser));
206 if (ret >= 0 && ret <= 4096) { return null; }
207 Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret);