+ EcdsaChannelSigner(const EcdsaChannelSigner&) = delete;
+ EcdsaChannelSigner(EcdsaChannelSigner&& o) : self(o.self) { memset(&o, 0, sizeof(EcdsaChannelSigner)); }
+ EcdsaChannelSigner(LDKEcdsaChannelSigner&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKEcdsaChannelSigner)); }
+ operator LDKEcdsaChannelSigner() && { LDKEcdsaChannelSigner res = self; memset(&self, 0, sizeof(LDKEcdsaChannelSigner)); return res; }
+ ~EcdsaChannelSigner() { EcdsaChannelSigner_free(self); }
+ EcdsaChannelSigner& operator=(EcdsaChannelSigner&& o) { EcdsaChannelSigner_free(self); self = o.self; memset(&o, 0, sizeof(EcdsaChannelSigner)); return *this; }
+ LDKEcdsaChannelSigner* operator &() { return &self; }
+ LDKEcdsaChannelSigner* operator ->() { return &self; }
+ const LDKEcdsaChannelSigner* operator &() const { return &self; }
+ const LDKEcdsaChannelSigner* operator ->() const { return &self; }
+ /**
+ * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
+ *
+ * Note that if signing fails or is rejected, the channel will be force-closed.
+ *
+ * Policy checks should be implemented in this function, including checking the amount
+ * sent to us and checking the HTLCs.
+ *
+ * The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
+ * are provided. A validating signer should ensure that an outbound HTLC output is removed
+ * only when the matching preimage is provided and after the corresponding inbound HTLC has
+ * been removed for forwarded payments.
+ *
+ * Note that all the relevant preimages will be provided, but there may also be additional
+ * irrelevant or duplicate preimages.
+ */
+ inline LDK::CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment(const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
+ /**
+ * Creates a signature for a holder's commitment transaction.
+ *
+ * This will be called
+ * - with a non-revoked `commitment_tx`.
+ * - with the latest `commitment_tx` when we initiate a force-close.
+ *
+ * This may be called multiple times for the same transaction.
+ *
+ * An external signer implementation should check that the commitment has not been revoked.
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_holder_commitment(const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
+ /**
+ * Create a signature for the given input in a transaction spending an HTLC transaction output
+ * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
+ *
+ * A justice transaction may claim multiple outputs at the same time if timelocks are
+ * similar, but only a signature for the input at index `input` should be signed for here.
+ * It may be called multiple times for same output(s) if a fee-bump is needed with regards
+ * to an upcoming timelock expiration.
+ *
+ * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
+ *
+ * `per_commitment_key` is revocation secret which was provided by our counterparty when they
+ * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
+ * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
+ * so).
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_justice_revoked_output(struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32]);
+ /**
+ * Create a signature for the given input in a transaction spending a commitment transaction
+ * HTLC output when our counterparty broadcasts an old state.
+ *
+ * A justice transaction may claim multiple outputs at the same time if timelocks are
+ * similar, but only a signature for the input at index `input` should be signed for here.
+ * It may be called multiple times for same output(s) if a fee-bump is needed with regards
+ * to an upcoming timelock expiration.
+ *
+ * `amount` is the value of the output spent by this input, committed to in the BIP 143
+ * signature.
+ *
+ * `per_commitment_key` is revocation secret which was provided by our counterparty when they
+ * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
+ * not allow the spending of any funds by itself (you need our holder revocation_secret to do
+ * so).
+ *
+ * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
+ * (which is committed to in the BIP 143 signatures).
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_justice_revoked_htlc(struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
+ /**
+ * Computes the signature for a commitment transaction's HTLC output used as an input within
+ * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
+ * must be be computed using [`EcdsaSighashType::All`].
+ *
+ * Note that this may be called for HTLCs in the penultimate commitment transaction if a
+ * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
+ * broadcasts it before receiving the update for the latest commitment transaction.
+ *
+ * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
+ * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_holder_htlc_transaction(struct LDKTransaction htlc_tx, uintptr_t input, const struct LDKHTLCDescriptor *NONNULL_PTR htlc_descriptor);
+ /**
+ * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
+ * transaction, either offered or received.
+ *
+ * Such a transaction may claim multiples offered outputs at same time if we know the
+ * preimage for each when we create it, but only the input at index `input` should be
+ * signed for here. It may be called multiple times for same output(s) if a fee-bump is
+ * needed with regards to an upcoming timelock expiration.
+ *
+ * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
+ * outputs.
+ *
+ * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
+ *
+ * `per_commitment_point` is the dynamic point corresponding to the channel state
+ * detected onchain. It has been generated by our counterparty and is used to derive
+ * channel state keys, which are then included in the witness script and committed to in the
+ * BIP 143 signature.
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
+ /**
+ * Create a signature for a (proposed) closing transaction.
+ *
+ * Note that, due to rounding, there may be one "missing" satoshi, and either party may have
+ * chosen to forgo their output as dust.
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_closing_transaction(const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
+ /**
+ * Computes the signature for a commitment transaction's anchor output used as an
+ * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_holder_anchor_input(struct LDKTransaction anchor_tx, uintptr_t input);
+ /**
+ * Signs a channel announcement message with our funding key proving it comes from one of the
+ * channel participants.
+ *
+ * Channel announcements also require a signature from each node's network key. Our node
+ * signature is computed through [`NodeSigner::sign_gossip_message`].
+ *
+ * Note that if this fails or is rejected, the channel will not be publicly announced and
+ * our counterparty may (though likely will not) close the channel on us for violating the
+ * protocol.
+ *
+ * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
+ */
+ inline LDK::CResult_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
+};
+class WriteableEcdsaChannelSigner {
+private:
+ LDKWriteableEcdsaChannelSigner self;
+public:
+ WriteableEcdsaChannelSigner(const WriteableEcdsaChannelSigner&) = delete;
+ WriteableEcdsaChannelSigner(WriteableEcdsaChannelSigner&& o) : self(o.self) { memset(&o, 0, sizeof(WriteableEcdsaChannelSigner)); }
+ WriteableEcdsaChannelSigner(LDKWriteableEcdsaChannelSigner&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKWriteableEcdsaChannelSigner)); }
+ operator LDKWriteableEcdsaChannelSigner() && { LDKWriteableEcdsaChannelSigner res = self; memset(&self, 0, sizeof(LDKWriteableEcdsaChannelSigner)); return res; }
+ ~WriteableEcdsaChannelSigner() { WriteableEcdsaChannelSigner_free(self); }
+ WriteableEcdsaChannelSigner& operator=(WriteableEcdsaChannelSigner&& o) { WriteableEcdsaChannelSigner_free(self); self = o.self; memset(&o, 0, sizeof(WriteableEcdsaChannelSigner)); return *this; }
+ LDKWriteableEcdsaChannelSigner* operator &() { return &self; }
+ LDKWriteableEcdsaChannelSigner* operator ->() { return &self; }
+ const LDKWriteableEcdsaChannelSigner* operator &() const { return &self; }
+ const LDKWriteableEcdsaChannelSigner* operator ->() const { return &self; }
+};
+class ChannelMonitorUpdate {
+private:
+ LDKChannelMonitorUpdate self;
+public:
+ ChannelMonitorUpdate(const ChannelMonitorUpdate&) = delete;
+ ChannelMonitorUpdate(ChannelMonitorUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMonitorUpdate)); }
+ ChannelMonitorUpdate(LDKChannelMonitorUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMonitorUpdate)); }
+ operator LDKChannelMonitorUpdate() && { LDKChannelMonitorUpdate res = self; memset(&self, 0, sizeof(LDKChannelMonitorUpdate)); return res; }
+ ~ChannelMonitorUpdate() { ChannelMonitorUpdate_free(self); }
+ ChannelMonitorUpdate& operator=(ChannelMonitorUpdate&& o) { ChannelMonitorUpdate_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMonitorUpdate)); return *this; }
+ LDKChannelMonitorUpdate* operator &() { return &self; }
+ LDKChannelMonitorUpdate* operator ->() { return &self; }
+ const LDKChannelMonitorUpdate* operator &() const { return &self; }
+ const LDKChannelMonitorUpdate* operator ->() const { return &self; }
+};
+class MonitorEvent {
+private:
+ LDKMonitorEvent self;
+public:
+ MonitorEvent(const MonitorEvent&) = delete;
+ MonitorEvent(MonitorEvent&& o) : self(o.self) { memset(&o, 0, sizeof(MonitorEvent)); }
+ MonitorEvent(LDKMonitorEvent&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMonitorEvent)); }
+ operator LDKMonitorEvent() && { LDKMonitorEvent res = self; memset(&self, 0, sizeof(LDKMonitorEvent)); return res; }
+ ~MonitorEvent() { MonitorEvent_free(self); }
+ MonitorEvent& operator=(MonitorEvent&& o) { MonitorEvent_free(self); self = o.self; memset(&o, 0, sizeof(MonitorEvent)); return *this; }
+ LDKMonitorEvent* operator &() { return &self; }
+ LDKMonitorEvent* operator ->() { return &self; }
+ const LDKMonitorEvent* operator &() const { return &self; }
+ const LDKMonitorEvent* operator ->() const { return &self; }
+};
+class HTLCUpdate {
+private:
+ LDKHTLCUpdate self;
+public:
+ HTLCUpdate(const HTLCUpdate&) = delete;
+ HTLCUpdate(HTLCUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(HTLCUpdate)); }
+ HTLCUpdate(LDKHTLCUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHTLCUpdate)); }
+ operator LDKHTLCUpdate() && { LDKHTLCUpdate res = self; memset(&self, 0, sizeof(LDKHTLCUpdate)); return res; }