6 namespace org { namespace ldk { namespace structs {
10 * An announcement_signatures message to be sent or received from a peer
12 public class AnnouncementSignatures : CommonBase {
13 internal AnnouncementSignatures(object _dummy, long ptr) : base(ptr) { }
14 ~AnnouncementSignatures() {
15 if (ptr != 0) { bindings.AnnouncementSignatures_free(ptr); }
21 public byte[] get_channel_id() {
22 byte[] ret = bindings.AnnouncementSignatures_get_channel_id(this.ptr);
30 public void set_channel_id(byte[] val) {
31 bindings.AnnouncementSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * The short channel ID
39 public long get_short_channel_id() {
40 long ret = bindings.AnnouncementSignatures_get_short_channel_id(this.ptr);
46 * The short channel ID
48 public void set_short_channel_id(long val) {
49 bindings.AnnouncementSignatures_set_short_channel_id(this.ptr, val);
55 * A signature by the node key
57 public byte[] get_node_signature() {
58 byte[] ret = bindings.AnnouncementSignatures_get_node_signature(this.ptr);
64 * A signature by the node key
66 public void set_node_signature(byte[] val) {
67 bindings.AnnouncementSignatures_set_node_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
73 * A signature by the funding key
75 public byte[] get_bitcoin_signature() {
76 byte[] ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this.ptr);
82 * A signature by the funding key
84 public void set_bitcoin_signature(byte[] val) {
85 bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
91 * Constructs a new AnnouncementSignatures given each field
93 public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) {
94 long ret = bindings.AnnouncementSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), short_channel_id_arg, InternalUtils.check_arr_len(node_signature_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_arg, 64));
95 GC.KeepAlive(channel_id_arg);
96 GC.KeepAlive(short_channel_id_arg);
97 GC.KeepAlive(node_signature_arg);
98 GC.KeepAlive(bitcoin_signature_arg);
99 if (ret >= 0 && ret <= 4096) { return null; }
100 org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); }
101 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
105 internal long clone_ptr() {
106 long ret = bindings.AnnouncementSignatures_clone_ptr(this.ptr);
112 * Creates a copy of the AnnouncementSignatures
114 public AnnouncementSignatures clone() {
115 long ret = bindings.AnnouncementSignatures_clone(this.ptr);
117 if (ret >= 0 && ret <= 4096) { return null; }
118 org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); }
119 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
124 * Checks if two AnnouncementSignaturess contain equal inner contents.
125 * This ignores pointers and is_owned flags and looks at the values in fields.
126 * Two objects with NULL inner values will be considered "equal" here.
128 public bool eq(org.ldk.structs.AnnouncementSignatures b) {
129 bool ret = bindings.AnnouncementSignatures_eq(this.ptr, b == null ? 0 : b.ptr);
132 if (this != null) { this.ptrs_to.AddLast(b); };
136 public override bool Equals(object o) {
137 if (!(o is AnnouncementSignatures)) return false;
138 return this.eq((AnnouncementSignatures)o);
141 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
143 public byte[] write() {
144 byte[] ret = bindings.AnnouncementSignatures_write(this.ptr);
150 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
152 public static Result_AnnouncementSignaturesDecodeErrorZ read(byte[] ser) {
153 long ret = bindings.AnnouncementSignatures_read(ser);
155 if (ret >= 0 && ret <= 4096) { return null; }
156 Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);