- public void set_bitcoin_signature_2(ChannelAnnouncement this_ptr, byte[] val) {
- bindings.ChannelAnnouncement_set_bitcoin_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
- this.ptrs_to.add(this_ptr);
+ /**
+ * Constructs a new ChannelAnnouncement given each field
+ */
+ public static ChannelAnnouncement of(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) {
+ long ret = bindings.ChannelAnnouncement_new(InternalUtils.check_arr_len(node_signature_1_arg, 64), InternalUtils.check_arr_len(node_signature_2_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_1_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_2_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;