[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / WriteableEcdsaChannelSigner.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8 /**
9  * A writeable signer.
10  * 
11  * There will always be two instances of a signer per channel, one occupied by the
12  * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
13  * 
14  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
16  */
17 public class WriteableEcdsaChannelSigner : CommonBase {
18         internal readonly bindings.LDKWriteableEcdsaChannelSigner bindings_instance;
19         internal WriteableEcdsaChannelSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; }
20         private WriteableEcdsaChannelSigner(bindings.LDKWriteableEcdsaChannelSigner arg, bindings.LDKEcdsaChannelSigner EcdsaChannelSigner, bindings.LDKChannelSigner ChannelSigner, ChannelPublicKeys pubkeys) : base(bindings.LDKWriteableEcdsaChannelSigner_new(arg, EcdsaChannelSigner, ChannelSigner, pubkeys == null ? 0 : pubkeys.clone_ptr())) {
21                 this.ptrs_to.AddLast(arg);
22                 this.ptrs_to.AddLast(EcdsaChannelSigner);
23                 this.ptrs_to.AddLast(ChannelSigner);
24                 this.bindings_instance = arg;
25         }
26         ~WriteableEcdsaChannelSigner() {
27                 if (ptr != 0) { bindings.WriteableEcdsaChannelSigner_free(ptr); }
28         }
29
30         public interface WriteableEcdsaChannelSignerInterface {
31                 /**
32                  * Serialize the object into a byte array
33                  */
34                 byte[] write();
35         }
36         private class LDKWriteableEcdsaChannelSignerHolder { internal WriteableEcdsaChannelSigner held; }
37         private class LDKWriteableEcdsaChannelSignerImpl : bindings.LDKWriteableEcdsaChannelSigner {
38                 internal LDKWriteableEcdsaChannelSignerImpl(WriteableEcdsaChannelSignerInterface arg, LDKWriteableEcdsaChannelSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; }
39                 private WriteableEcdsaChannelSignerInterface arg;
40                 private LDKWriteableEcdsaChannelSignerHolder impl_holder;
41                 public byte[] write() {
42                         byte[] ret = arg.write();
43                                 GC.KeepAlive(arg);
44                         return ret;
45                 }
46         }
47         public static WriteableEcdsaChannelSigner new_impl(WriteableEcdsaChannelSignerInterface arg, EcdsaChannelSigner.EcdsaChannelSignerInterface EcdsaChannelSigner_impl, ChannelSigner.ChannelSignerInterface ChannelSigner_impl, ChannelPublicKeys pubkeys) {
48                 LDKWriteableEcdsaChannelSignerHolder impl_holder = new LDKWriteableEcdsaChannelSignerHolder();
49                 impl_holder.held = new WriteableEcdsaChannelSigner(new LDKWriteableEcdsaChannelSignerImpl(arg, impl_holder), EcdsaChannelSigner.new_impl(EcdsaChannelSigner_impl, ChannelSigner_impl, pubkeys).bindings_instance, ChannelSigner.new_impl(ChannelSigner_impl, pubkeys).bindings_instance, pubkeys);
50                 return impl_holder.held;
51         }
52
53         /**
54          * Gets the underlying EcdsaChannelSigner.
55          */
56         public EcdsaChannelSigner get_ecdsa_channel_signer() {
57                 EcdsaChannelSigner res = new EcdsaChannelSigner(null, bindings.LDKWriteableEcdsaChannelSigner_get_EcdsaChannelSigner(this.ptr));
58                 this.ptrs_to.AddLast(res);
59                 return res;
60         }
61
62
63         /**
64          * Gets the underlying ChannelSigner.
65          */
66         public ChannelSigner get_channel_signer() {
67                 ChannelSigner res = new ChannelSigner(null, bindings.LDKWriteableEcdsaChannelSigner_get_ChannelSigner(this.ptr));
68                 this.ptrs_to.AddLast(res);
69                 return res;
70         }
71
72         /**
73          * Serialize the object into a byte array
74          */
75         public byte[] write() {
76                 byte[] ret = bindings.WriteableEcdsaChannelSigner_write(this.ptr);
77                 GC.KeepAlive(this);
78                 return ret;
79         }
80
81         internal long clone_ptr() {
82                 long ret = bindings.WriteableEcdsaChannelSigner_clone_ptr(this.ptr);
83                 GC.KeepAlive(this);
84                 return ret;
85         }
86
87         /**
88          * Creates a copy of a WriteableEcdsaChannelSigner
89          */
90         public WriteableEcdsaChannelSigner clone() {
91                 long ret = bindings.WriteableEcdsaChannelSigner_clone(this.ptr);
92                 GC.KeepAlive(this);
93                 if (ret >= 0 && ret <= 4096) { return null; }
94                 WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret);
95                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
96                 return ret_hu_conv;
97         }
98
99 }
100 } } }