1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * The unsigned part of a channel_announcement
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class UnsignedChannelAnnouncement extends CommonBase {
14 UnsignedChannelAnnouncement(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); }
22 * The advertised channel features
24 public ChannelFeatures get_features() {
25 long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
26 ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
27 ret_hu_conv.ptrs_to.add(this);
32 * The advertised channel features
34 public void set_features(ChannelFeatures val) {
35 bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
36 this.ptrs_to.add(val);
40 * The genesis hash of the blockchain where the channel is to be opened
42 public byte[] get_chain_hash() {
43 byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr);
48 * The genesis hash of the blockchain where the channel is to be opened
50 public void set_chain_hash(byte[] val) {
51 bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, val);
55 * The short channel ID
57 public long get_short_channel_id() {
58 long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr);
63 * The short channel ID
65 public void set_short_channel_id(long val) {
66 bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val);
70 * One of the two node_ids which are endpoints of this channel
72 public byte[] get_node_id_1() {
73 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr);
78 * One of the two node_ids which are endpoints of this channel
80 public void set_node_id_1(byte[] val) {
81 bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val);
85 * The other of the two node_ids which are endpoints of this channel
87 public byte[] get_node_id_2() {
88 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr);
93 * The other of the two node_ids which are endpoints of this channel
95 public void set_node_id_2(byte[] val) {
96 bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val);
100 * The funding key for the first node
102 public byte[] get_bitcoin_key_1() {
103 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr);
108 * The funding key for the first node
110 public void set_bitcoin_key_1(byte[] val) {
111 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val);
115 * The funding key for the second node
117 public byte[] get_bitcoin_key_2() {
118 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr);
123 * The funding key for the second node
125 public void set_bitcoin_key_2(byte[] val) {
126 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val);
130 * Creates a copy of the UnsignedChannelAnnouncement
132 public UnsignedChannelAnnouncement clone() {
133 long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
134 UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret);
135 ret_hu_conv.ptrs_to.add(this);
140 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
142 public byte[] write() {
143 byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr);
148 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
150 public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_read(byte[] ser) {
151 long ret = bindings.UnsignedChannelAnnouncement_read(ser);
152 Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);