6 namespace org { namespace ldk { namespace structs {
10 * A [`funding_signed`] message to be sent to or received from a peer.
12 * Used in V1 channel establishment
14 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
16 public class FundingSigned : CommonBase {
17 internal FundingSigned(object _dummy, long ptr) : base(ptr) { }
19 if (ptr != 0) { bindings.FundingSigned_free(ptr); }
25 public byte[] get_channel_id() {
26 byte[] ret = bindings.FundingSigned_get_channel_id(this.ptr);
34 public void set_channel_id(byte[] val) {
35 bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
41 * The signature of the channel acceptor (fundee) on the initial commitment transaction
43 public byte[] get_signature() {
44 byte[] ret = bindings.FundingSigned_get_signature(this.ptr);
50 * The signature of the channel acceptor (fundee) on the initial commitment transaction
52 public void set_signature(byte[] val) {
53 bindings.FundingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
59 * Constructs a new FundingSigned given each field
61 public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) {
62 long ret = bindings.FundingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64));
63 GC.KeepAlive(channel_id_arg);
64 GC.KeepAlive(signature_arg);
65 if (ret >= 0 && ret <= 4096) { return null; }
66 org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); }
67 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
71 internal long clone_ptr() {
72 long ret = bindings.FundingSigned_clone_ptr(this.ptr);
78 * Creates a copy of the FundingSigned
80 public FundingSigned clone() {
81 long ret = bindings.FundingSigned_clone(this.ptr);
83 if (ret >= 0 && ret <= 4096) { return null; }
84 org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); }
85 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
90 * Checks if two FundingSigneds contain equal inner contents.
91 * This ignores pointers and is_owned flags and looks at the values in fields.
92 * Two objects with NULL inner values will be considered "equal" here.
94 public bool eq(org.ldk.structs.FundingSigned b) {
95 bool ret = bindings.FundingSigned_eq(this.ptr, b == null ? 0 : b.ptr);
98 if (this != null) { this.ptrs_to.AddLast(b); };
102 public override bool Equals(object o) {
103 if (!(o is FundingSigned)) return false;
104 return this.eq((FundingSigned)o);
107 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
109 public byte[] write() {
110 byte[] ret = bindings.FundingSigned_write(this.ptr);
116 * Read a FundingSigned from a byte array, created by FundingSigned_write
118 public static Result_FundingSignedDecodeErrorZ read(byte[] ser) {
119 long ret = bindings.FundingSigned_read(ser);
121 if (ret >= 0 && ret <= 4096) { return null; }
122 Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);