6 namespace org { namespace ldk { namespace structs {
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`].
14 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
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;
26 ~WriteableEcdsaChannelSigner() {
27 if (ptr != 0) { bindings.WriteableEcdsaChannelSigner_free(ptr); }
30 public interface WriteableEcdsaChannelSignerInterface {
32 * Serialize the object into a byte array
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();
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;
54 * Gets the underlying EcdsaChannelSigner.
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);
64 * Gets the underlying ChannelSigner.
66 public ChannelSigner get_channel_signer() {
67 ChannelSigner res = new ChannelSigner(null, bindings.LDKWriteableEcdsaChannelSigner_get_ChannelSigner(this.ptr));
68 this.ptrs_to.AddLast(res);
73 * Serialize the object into a byte array
75 public byte[] write() {
76 byte[] ret = bindings.WriteableEcdsaChannelSigner_write(this.ptr);
81 internal long clone_ptr() {
82 long ret = bindings.WriteableEcdsaChannelSigner_clone_ptr(this.ptr);
88 * Creates a copy of a WriteableEcdsaChannelSigner
90 public WriteableEcdsaChannelSigner clone() {
91 long ret = bindings.WriteableEcdsaChannelSigner_clone(this.ptr);
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); };