- public void set_channel_id(CommitmentSigned this_ptr, byte[] val) {
- bindings.CommitmentSigned_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
- this.ptrs_to.add(this_ptr);
+ /**
+ * A signature on the commitment transaction
+ */
+ public void set_signature(byte[] val) {
+ bindings.CommitmentSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * Signatures on the HTLC transactions
+ */
+ public void set_htlc_signatures(byte[][] val) {
+ bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val != null ? Arrays.stream(val).map(val_conv_8 -> InternalUtils.check_arr_len(val_conv_8, 64)).toArray(byte[][]::new) : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * Constructs a new CommitmentSigned given each field
+ */
+ public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
+ long ret = bindings.CommitmentSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64), htlc_signatures_arg != null ? Arrays.stream(htlc_signatures_arg).map(htlc_signatures_arg_conv_8 -> InternalUtils.check_arr_len(htlc_signatures_arg_conv_8, 64)).toArray(byte[][]::new) : null);
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(signature_arg);
+ Reference.reachabilityFence(htlc_signatures_arg);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;