6 namespace org { namespace ldk { namespace structs {
10 * A funding_signed message to be sent or received from a peer
12 public class FundingSigned : CommonBase {
13 internal FundingSigned(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.FundingSigned_free(ptr); }
21 public byte[] get_channel_id() {
22 byte[] ret = bindings.FundingSigned_get_channel_id(this.ptr);
30 public void set_channel_id(byte[] val) {
31 bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * The signature of the channel acceptor (fundee) on the initial commitment transaction
39 public byte[] get_signature() {
40 byte[] ret = bindings.FundingSigned_get_signature(this.ptr);
46 * The signature of the channel acceptor (fundee) on the initial commitment transaction
48 public void set_signature(byte[] val) {
49 bindings.FundingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
55 * Constructs a new FundingSigned given each field
57 public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) {
58 long ret = bindings.FundingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64));
59 GC.KeepAlive(channel_id_arg);
60 GC.KeepAlive(signature_arg);
61 if (ret >= 0 && ret <= 4096) { return null; }
62 org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); }
63 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
67 internal long clone_ptr() {
68 long ret = bindings.FundingSigned_clone_ptr(this.ptr);
74 * Creates a copy of the FundingSigned
76 public FundingSigned clone() {
77 long ret = bindings.FundingSigned_clone(this.ptr);
79 if (ret >= 0 && ret <= 4096) { return null; }
80 org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); }
81 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
86 * Checks if two FundingSigneds contain equal inner contents.
87 * This ignores pointers and is_owned flags and looks at the values in fields.
88 * Two objects with NULL inner values will be considered "equal" here.
90 public bool eq(org.ldk.structs.FundingSigned b) {
91 bool ret = bindings.FundingSigned_eq(this.ptr, b == null ? 0 : b.ptr);
94 if (this != null) { this.ptrs_to.AddLast(b); };
98 public override bool Equals(object o) {
99 if (!(o is FundingSigned)) return false;
100 return this.eq((FundingSigned)o);
103 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
105 public byte[] write() {
106 byte[] ret = bindings.FundingSigned_write(this.ptr);
112 * Read a FundingSigned from a byte array, created by FundingSigned_write
114 public static Result_FundingSignedDecodeErrorZ read(byte[] ser) {
115 long ret = bindings.FundingSigned_read(ser);
117 if (ret >= 0 && ret <= 4096) { return null; }
118 Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);