6 namespace org { namespace ldk { namespace structs {
10 * A channel_ready message to be sent or received from a peer
12 public class ChannelReady : CommonBase {
13 internal ChannelReady(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.ChannelReady_free(ptr); }
21 public byte[] get_channel_id() {
22 byte[] ret = bindings.ChannelReady_get_channel_id(this.ptr);
30 public void set_channel_id(byte[] val) {
31 bindings.ChannelReady_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * The per-commitment point of the second commitment transaction
39 public byte[] get_next_per_commitment_point() {
40 byte[] ret = bindings.ChannelReady_get_next_per_commitment_point(this.ptr);
46 * The per-commitment point of the second commitment transaction
48 public void set_next_per_commitment_point(byte[] val) {
49 bindings.ChannelReady_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
55 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
56 * to be forwarded over this SCID and forward them to this messages' recipient.
58 public Option_u64Z get_short_channel_id_alias() {
59 long ret = bindings.ChannelReady_get_short_channel_id_alias(this.ptr);
61 if (ret >= 0 && ret <= 4096) { return null; }
62 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
63 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
68 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
69 * to be forwarded over this SCID and forward them to this messages' recipient.
71 public void set_short_channel_id_alias(org.ldk.structs.Option_u64Z val) {
72 bindings.ChannelReady_set_short_channel_id_alias(this.ptr, val.ptr);
78 * Constructs a new ChannelReady given each field
80 public static ChannelReady of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, org.ldk.structs.Option_u64Z short_channel_id_alias_arg) {
81 long ret = bindings.ChannelReady_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33), short_channel_id_alias_arg.ptr);
82 GC.KeepAlive(channel_id_arg);
83 GC.KeepAlive(next_per_commitment_point_arg);
84 GC.KeepAlive(short_channel_id_alias_arg);
85 if (ret >= 0 && ret <= 4096) { return null; }
86 org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); }
87 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
91 internal long clone_ptr() {
92 long ret = bindings.ChannelReady_clone_ptr(this.ptr);
98 * Creates a copy of the ChannelReady
100 public ChannelReady clone() {
101 long ret = bindings.ChannelReady_clone(this.ptr);
103 if (ret >= 0 && ret <= 4096) { return null; }
104 org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); }
105 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
110 * Checks if two ChannelReadys contain equal inner contents.
111 * This ignores pointers and is_owned flags and looks at the values in fields.
112 * Two objects with NULL inner values will be considered "equal" here.
114 public bool eq(org.ldk.structs.ChannelReady b) {
115 bool ret = bindings.ChannelReady_eq(this.ptr, b == null ? 0 : b.ptr);
118 if (this != null) { this.ptrs_to.AddLast(b); };
122 public override bool Equals(object o) {
123 if (!(o is ChannelReady)) return false;
124 return this.eq((ChannelReady)o);
127 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
129 public byte[] write() {
130 byte[] ret = bindings.ChannelReady_write(this.ptr);
136 * Read a ChannelReady from a byte array, created by ChannelReady_write
138 public static Result_ChannelReadyDecodeErrorZ read(byte[] ser) {
139 long ret = bindings.ChannelReady_read(ser);
141 if (ret >= 0 && ret <= 4096) { return null; }
142 Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret);