From: Matt Corallo Date: Thu, 7 Sep 2023 16:20:15 +0000 (+0000) Subject: [C#] Update auto-generated files X-Git-Tag: v0.0.117.0~17 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c6777737ea14e7814b0fa7d6fe16536f31d4a82b;p=ldk-java [C#] Update auto-generated files --- diff --git a/c_sharp/src/org/ldk/enums/AccessError.cs b/c_sharp/src/org/ldk/enums/AccessError.cs deleted file mode 100644 index a5c7af17..00000000 --- a/c_sharp/src/org/ldk/enums/AccessError.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace org { namespace ldk { namespace enums {/** - * An error when accessing the chain via [`Access`]. - */ -public enum AccessError { - /** - * The requested chain is unknown. - */ - LDKAccessError_UnknownChain, - /** - * The requested transaction doesn't exist or hasn't confirmed. - */ - LDKAccessError_UnknownTx, -}} } } diff --git a/c_sharp/src/org/ldk/enums/Bolt11SemanticError.cs b/c_sharp/src/org/ldk/enums/Bolt11SemanticError.cs new file mode 100644 index 00000000..50a49233 --- /dev/null +++ b/c_sharp/src/org/ldk/enums/Bolt11SemanticError.cs @@ -0,0 +1,47 @@ +namespace org { namespace ldk { namespace enums {/** + * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to + * the requirements sections in BOLT #11 + */ +public enum Bolt11SemanticError { + /** + * The invoice is missing the mandatory payment hash + */ + LDKBolt11SemanticError_NoPaymentHash, + /** + * The invoice has multiple payment hashes which isn't allowed + */ + LDKBolt11SemanticError_MultiplePaymentHashes, + /** + * No description or description hash are part of the invoice + */ + LDKBolt11SemanticError_NoDescription, + /** + * The invoice contains multiple descriptions and/or description hashes which isn't allowed + */ + LDKBolt11SemanticError_MultipleDescriptions, + /** + * The invoice is missing the mandatory payment secret, which all modern lightning nodes + * should provide. + */ + LDKBolt11SemanticError_NoPaymentSecret, + /** + * The invoice contains multiple payment secrets + */ + LDKBolt11SemanticError_MultiplePaymentSecrets, + /** + * The invoice's features are invalid + */ + LDKBolt11SemanticError_InvalidFeatures, + /** + * The recovery id doesn't fit the signature/pub key + */ + LDKBolt11SemanticError_InvalidRecoveryId, + /** + * The invoice's signature is invalid + */ + LDKBolt11SemanticError_InvalidSignature, + /** + * The invoice's amount was not a whole number of millisatoshis + */ + LDKBolt11SemanticError_ImpreciseAmount, +}} } } diff --git a/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs b/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs new file mode 100644 index 00000000..28189079 --- /dev/null +++ b/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs @@ -0,0 +1,109 @@ +namespace org { namespace ldk { namespace enums {/** + * Error when interpreting a TLV stream as a specific type. + */ +public enum Bolt12SemanticError { + /** + * The current [`std::time::SystemTime`] is past the offer or invoice's expiration. + */ + LDKBolt12SemanticError_AlreadyExpired, + /** + * The provided chain hash does not correspond to a supported chain. + */ + LDKBolt12SemanticError_UnsupportedChain, + /** + * A chain was provided but was not expected. + */ + LDKBolt12SemanticError_UnexpectedChain, + /** + * An amount was expected but was missing. + */ + LDKBolt12SemanticError_MissingAmount, + /** + * The amount exceeded the total bitcoin supply. + */ + LDKBolt12SemanticError_InvalidAmount, + /** + * An amount was provided but was not sufficient in value. + */ + LDKBolt12SemanticError_InsufficientAmount, + /** + * An amount was provided but was not expected. + */ + LDKBolt12SemanticError_UnexpectedAmount, + /** + * A currency was provided that is not supported. + */ + LDKBolt12SemanticError_UnsupportedCurrency, + /** + * A feature was required but is unknown. + */ + LDKBolt12SemanticError_UnknownRequiredFeatures, + /** + * Features were provided but were not expected. + */ + LDKBolt12SemanticError_UnexpectedFeatures, + /** + * A required description was not provided. + */ + LDKBolt12SemanticError_MissingDescription, + /** + * A signing pubkey was not provided. + */ + LDKBolt12SemanticError_MissingSigningPubkey, + /** + * A signing pubkey was provided but a different one was expected. + */ + LDKBolt12SemanticError_InvalidSigningPubkey, + /** + * A signing pubkey was provided but was not expected. + */ + LDKBolt12SemanticError_UnexpectedSigningPubkey, + /** + * A quantity was expected but was missing. + */ + LDKBolt12SemanticError_MissingQuantity, + /** + * An unsupported quantity was provided. + */ + LDKBolt12SemanticError_InvalidQuantity, + /** + * A quantity or quantity bounds was provided but was not expected. + */ + LDKBolt12SemanticError_UnexpectedQuantity, + /** + * Metadata could not be used to verify the offers message. + */ + LDKBolt12SemanticError_InvalidMetadata, + /** + * Metadata was provided but was not expected. + */ + LDKBolt12SemanticError_UnexpectedMetadata, + /** + * Payer metadata was expected but was missing. + */ + LDKBolt12SemanticError_MissingPayerMetadata, + /** + * A payer id was expected but was missing. + */ + LDKBolt12SemanticError_MissingPayerId, + /** + * Blinded paths were expected but were missing. + */ + LDKBolt12SemanticError_MissingPaths, + /** + * The blinded payinfo given does not match the number of blinded path hops. + */ + LDKBolt12SemanticError_InvalidPayInfo, + /** + * An invoice creation time was expected but was missing. + */ + LDKBolt12SemanticError_MissingCreationTime, + /** + * An invoice payment hash was expected but was missing. + */ + LDKBolt12SemanticError_MissingPaymentHash, + /** + * A signature was expected but was missing. + */ + LDKBolt12SemanticError_MissingSignature, +}} } } diff --git a/c_sharp/src/org/ldk/enums/ChannelShutdownState.cs b/c_sharp/src/org/ldk/enums/ChannelShutdownState.cs new file mode 100644 index 00000000..03a1790d --- /dev/null +++ b/c_sharp/src/org/ldk/enums/ChannelShutdownState.cs @@ -0,0 +1,32 @@ +namespace org { namespace ldk { namespace enums {/** + * Further information on the details of the channel shutdown. + * Upon channels being forced closed (i.e. commitment transaction confirmation detected + * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or + * the channel will be removed shortly. + * Also note, that in normal operation, peers could disconnect at any of these states + * and require peer re-connection before making progress onto other states + */ +public enum ChannelShutdownState { + /** + * Channel has not sent or received a shutdown message. + */ + LDKChannelShutdownState_NotShuttingDown, + /** + * Local node has sent a shutdown message for this channel. + */ + LDKChannelShutdownState_ShutdownInitiated, + /** + * Shutdown message exchanges have concluded and the channels are in the midst of + * resolving all existing open HTLCs before closing can continue. + */ + LDKChannelShutdownState_ResolvingHTLCs, + /** + * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates. + */ + LDKChannelShutdownState_NegotiatingClosingFee, + /** + * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about + * to drop the channel. + */ + LDKChannelShutdownState_ShutdownComplete, +}} } } diff --git a/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs b/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs index 47f1cf53..4a05f56c 100644 --- a/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs +++ b/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs @@ -1,18 +1,29 @@ namespace org { namespace ldk { namespace enums {/** - * An enum that represents the speed at which we want a transaction to confirm used for feerate + * An enum that represents the priority at which we want a transaction to confirm used for feerate * estimation. */ public enum ConfirmationTarget { /** - * We are happy with this transaction confirming slowly when feerate drops some. + * We'd like a transaction to confirm in the future, but don't want to commit most of the fees + * required to do so yet. The remaining fees will come via a Child-Pays-For-Parent (CPFP) fee + * bump of the transaction. + * + * The feerate returned should be the absolute minimum feerate required to enter most node + * mempools across the network. Note that if you are not able to obtain this feerate estimate, + * you should likely use the furthest-out estimate allowed by your fee estimator. + */ + LDKConfirmationTarget_MempoolMinimum, + /** + * We are happy with a transaction confirming slowly, at least within a day or so worth of + * blocks. */ LDKConfirmationTarget_Background, /** - * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine. + * We'd like a transaction to confirm without major delayed, i.e., within the next 12-24 blocks. */ LDKConfirmationTarget_Normal, /** - * We'd like this transaction to confirm in the next few blocks. + * We'd like a transaction to confirm in the next few blocks. */ LDKConfirmationTarget_HighPriority, }} } } diff --git a/c_sharp/src/org/ldk/enums/CreationError.cs b/c_sharp/src/org/ldk/enums/CreationError.cs index 1e1aec0a..71d37306 100644 --- a/c_sharp/src/org/ldk/enums/CreationError.cs +++ b/c_sharp/src/org/ldk/enums/CreationError.cs @@ -1,9 +1,9 @@ namespace org { namespace ldk { namespace enums {/** - * Errors that may occur when constructing a new `RawInvoice` or `Invoice` + * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`] */ public enum CreationError { /** - * The supplied description string was longer than 639 __bytes__ (see [`Description::new(...)`](./struct.Description.html#method.new)) + * The supplied description string was longer than 639 __bytes__ (see [`Description::new`]) */ LDKCreationError_DescriptionTooLong, /** @@ -25,4 +25,10 @@ public enum CreationError { * [phantom invoices]: crate::utils::create_phantom_invoice */ LDKCreationError_MissingRouteHints, + /** + * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA + */ + LDKCreationError_MinFinalCltvExpiryDeltaTooShort, }} } } diff --git a/c_sharp/src/org/ldk/enums/FailureCode.cs b/c_sharp/src/org/ldk/enums/FailureCode.cs new file mode 100644 index 00000000..3cfeac8e --- /dev/null +++ b/c_sharp/src/org/ldk/enums/FailureCode.cs @@ -0,0 +1,25 @@ +namespace org { namespace ldk { namespace enums {/** + * This enum is used to specify which error data to send to peers when failing back an HTLC + * using [`ChannelManager::fail_htlc_backwards_with_reason`]. + * + * For more info on failure codes, see . + */ +public enum FailureCode { + /** + * We had a temporary error processing the payment. Useful if no other error codes fit + * and you want to indicate that the payer may want to retry. + */ + LDKFailureCode_TemporaryNodeFailure, + /** + * We have a required feature which was not in this onion. For example, you may require + * some additional metadata that was not provided with this payment. + */ + LDKFailureCode_RequiredNodeFeatureMissing, + /** + * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of + * the HTLC is too close to the current block height for safe handling. + * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is + * equivalent to calling [`ChannelManager::fail_htlc_backwards`]. + */ + LDKFailureCode_IncorrectOrUnknownPaymentDetails, +}} } } diff --git a/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs b/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs new file mode 100644 index 00000000..d0e5774f --- /dev/null +++ b/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs @@ -0,0 +1,40 @@ +namespace org { namespace ldk { namespace enums {/** + * The reason the payment failed. Used in [`Event::PaymentFailed`]. + */ +public enum PaymentFailureReason { + /** + * The intended recipient rejected our payment. + */ + LDKPaymentFailureReason_RecipientRejected, + /** + * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`]. + * + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ + LDKPaymentFailureReason_UserAbandoned, + /** + * We exhausted all of our retry attempts while trying to send the payment, or we + * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry + * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will + * have come before this. + * + * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout + */ + LDKPaymentFailureReason_RetriesExhausted, + /** + * The payment expired while retrying, based on the provided + * [`PaymentParameters::expiry_time`]. + * + * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time + */ + LDKPaymentFailureReason_PaymentExpired, + /** + * We failed to find a route while retrying the payment. + */ + LDKPaymentFailureReason_RouteNotFound, + /** + * This error should generally never happen. This likely means that there is a problem with + * your router. + */ + LDKPaymentFailureReason_UnexpectedError, +}} } } diff --git a/c_sharp/src/org/ldk/enums/Recipient.cs b/c_sharp/src/org/ldk/enums/Recipient.cs index cbbfd785..66a68ebe 100644 --- a/c_sharp/src/org/ldk/enums/Recipient.cs +++ b/c_sharp/src/org/ldk/enums/Recipient.cs @@ -1,7 +1,7 @@ namespace org { namespace ldk { namespace enums {/** * Specifies the recipient of an invoice. * - * This indicates to [`KeysInterface::sign_invoice`] what node secret key should be used to sign + * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign * the invoice. */ public enum Recipient { diff --git a/c_sharp/src/org/ldk/enums/RetryableSendFailure.cs b/c_sharp/src/org/ldk/enums/RetryableSendFailure.cs new file mode 100644 index 00000000..400a2ca3 --- /dev/null +++ b/c_sharp/src/org/ldk/enums/RetryableSendFailure.cs @@ -0,0 +1,30 @@ +namespace org { namespace ldk { namespace enums {/** + * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be + * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed + * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed + */ +public enum RetryableSendFailure { + /** + * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note + * that this error is *not* caused by [`Retry::Timeout`]. + * + * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time + */ + LDKRetryableSendFailure_PaymentExpired, + /** + * We were unable to find a route to the destination. + */ + LDKRetryableSendFailure_RouteNotFound, + /** + * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not + * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]). + * + * [`PaymentId`]: crate::ln::channelmanager::PaymentId + * [`Event::PaymentSent`]: crate::events::Event::PaymentSent + * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed + */ + LDKRetryableSendFailure_DuplicatePayment, +}} } } diff --git a/c_sharp/src/org/ldk/enums/SemanticError.cs b/c_sharp/src/org/ldk/enums/SemanticError.cs deleted file mode 100644 index f749b58a..00000000 --- a/c_sharp/src/org/ldk/enums/SemanticError.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace org { namespace ldk { namespace enums {/** - * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the - * requirements sections in BOLT #11 - */ -public enum SemanticError { - /** - * The invoice is missing the mandatory payment hash - */ - LDKSemanticError_NoPaymentHash, - /** - * The invoice has multiple payment hashes which isn't allowed - */ - LDKSemanticError_MultiplePaymentHashes, - /** - * No description or description hash are part of the invoice - */ - LDKSemanticError_NoDescription, - /** - * The invoice contains multiple descriptions and/or description hashes which isn't allowed - */ - LDKSemanticError_MultipleDescriptions, - /** - * The invoice is missing the mandatory payment secret, which all modern lightning nodes - * should provide. - */ - LDKSemanticError_NoPaymentSecret, - /** - * The invoice contains multiple payment secrets - */ - LDKSemanticError_MultiplePaymentSecrets, - /** - * The invoice's features are invalid - */ - LDKSemanticError_InvalidFeatures, - /** - * The recovery id doesn't fit the signature/pub key - */ - LDKSemanticError_InvalidRecoveryId, - /** - * The invoice's signature is invalid - */ - LDKSemanticError_InvalidSignature, - /** - * The invoice's amount was not a whole number of millisatoshis - */ - LDKSemanticError_ImpreciseAmount, -}} } } diff --git a/c_sharp/src/org/ldk/enums/UtxoLookupError.cs b/c_sharp/src/org/ldk/enums/UtxoLookupError.cs new file mode 100644 index 00000000..56056fd9 --- /dev/null +++ b/c_sharp/src/org/ldk/enums/UtxoLookupError.cs @@ -0,0 +1,13 @@ +namespace org { namespace ldk { namespace enums {/** + * An error when accessing the chain via [`UtxoLookup`]. + */ +public enum UtxoLookupError { + /** + * The requested chain is unknown. + */ + LDKUtxoLookupError_UnknownChain, + /** + * The requested transaction doesn't exist or hasn't confirmed. + */ + LDKUtxoLookupError_UnknownTx, +}} } } diff --git a/c_sharp/src/org/ldk/impl/bindings.cs b/c_sharp/src/org/ldk/impl/bindings.cs index 6a98a4f5..f3c70865 100644 --- a/c_sharp/src/org/ldk/impl/bindings.cs +++ b/c_sharp/src/org/ldk/impl/bindings.cs @@ -1,11 +1,42 @@ using org.ldk.enums; using org.ldk.impl; +using System; using System.Runtime.InteropServices; namespace org { namespace ldk { namespace impl { internal class bindings { + internal class ArrayCoder : ICustomMarshaler { + int size = 0; + GCHandle pinnedArray; + public static ICustomMarshaler GetInstance(string pstrCookie) { + return new ArrayCoder(); + } + + public Object MarshalNativeToManaged(IntPtr pNativeData) { throw new NotImplementedException(); } + public IntPtr MarshalManagedToNative(Object obj) { + if (obj.GetType() == typeof(byte[])) { + byte[] inp = (byte[])obj; + IntPtr data = Marshal.AllocHGlobal(inp.Length + 8); + Marshal.WriteInt64(data, inp.Length); + Marshal.Copy(inp, 0, data + 8, inp.Length); + this.size = inp.Length + 8; + return data; + } else { + throw new NotImplementedException(); + } + } + public void CleanUpNativeData(IntPtr pNativeData) { + Marshal.FreeHGlobal(pNativeData); + } + public void CleanUpManagedData(Object ManagedObj) { } + public int GetNativeDataSize() { + // Blindly guess based on the last allocation, no idea how else to implement this. + return this.size; + } + } + /*static { init(java.lang.Enum.class, VecOrSliceDef.class); init_class_cache(); @@ -27,107 +58,219 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBech32Error_ty_from_ptr")] public static extern long LDKBech32Error_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBech32Error_InvalidChar_get_invalid_char")] public static extern int LDKBech32Error_InvalidChar_get_invalid_char(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBech32Error_InvalidData_get_invalid_data")] public static extern byte LDKBech32Error_InvalidData_get_invalid_data(long ptr); + // struct LDKWitness TxIn_get_witness (struct LDKTxIn* thing) + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxIn_get_witness")] public static extern byte[] TxIn_get_witness(long _thing); + // struct LDKCVec_u8Z TxIn_get_script_sig (struct LDKTxIn* thing) + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxIn_get_script_sig")] public static extern byte[] TxIn_get_script_sig(long _thing); + // LDKThirtyTwoBytes TxIn_get_previous_txid (struct LDKTxIn* thing) + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxIn_get_previous_txid")] public static extern byte[] TxIn_get_previous_txid(long _thing); + // uint32_t TxIn_get_previous_vout (struct LDKTxIn* thing) + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxIn_get_previous_vout")] public static extern int TxIn_get_previous_vout(long _thing); + // uint32_t TxIn_get_sequence (struct LDKTxIn* thing) + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxIn_get_sequence")] public static extern int TxIn_get_sequence(long _thing); // struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxOut_get_script_pubkey")] public static extern byte[] TxOut_get_script_pubkey(long _thing); // uint64_t TxOut_get_value (struct LDKTxOut* thing) [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxOut_get_value")] public static extern long TxOut_get_value(long _thing); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCClaimZ_ty_from_ptr")] public static extern long LDKCOption_HTLCClaimZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCClaimZ_Some_get_some")] public static extern HTLCClaim LDKCOption_HTLCClaimZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_DurationZ_ty_from_ptr")] public static extern long LDKCOption_DurationZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_DurationZ_Some_get_some")] public static extern long LDKCOption_DurationZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u64Z_ty_from_ptr")] public static extern long LDKCOption_u64Z_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u64Z_Some_get_some")] public static extern long LDKCOption_u64Z_Some_get_some(long ptr); + // struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_get_ok")] public static extern long CResult_RefundBolt12ParseErrorZ_get_ok(long _owner); + // struct LDKBolt12ParseError CResult_RefundBolt12ParseErrorZ_get_err(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_get_err")] public static extern long CResult_RefundBolt12ParseErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_ty_from_ptr")] public static extern long LDKAPIError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_APIMisuseError_get_err")] public static extern string LDKAPIError_APIMisuseError_get_err(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_FeeRateTooHigh_get_err")] public static extern string LDKAPIError_FeeRateTooHigh_get_err(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_FeeRateTooHigh_get_feerate")] public static extern int LDKAPIError_FeeRateTooHigh_get_feerate(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_InvalidRoute_get_err")] public static extern string LDKAPIError_InvalidRoute_get_err(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_ChannelUnavailable_get_err")] public static extern string LDKAPIError_ChannelUnavailable_get_err(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_IncompatibleShutdownScript_get_script")] public static extern long LDKAPIError_IncompatibleShutdownScript_get_script(long ptr); + // void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_get_ok")] public static extern void CResult_NoneAPIErrorZ_get_ok(long _owner); + // struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_get_err")] public static extern long CResult_NoneAPIErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentSecretZ_ty_from_ptr")] public static extern long LDKCOption_PaymentSecretZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentSecretZ_Some_get_some")] public static extern byte[] LDKCOption_PaymentSecretZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_u8ZZ_ty_from_ptr")] public static extern long LDKCOption_CVec_u8ZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_u8ZZ_Some_get_some")] public static extern byte[] LDKCOption_CVec_u8ZZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_ty_from_ptr")] public static extern long LDKDecodeError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_Io_get_io")] public static extern IOError LDKDecodeError_Io_get_io(long ptr); + // struct LDKRecipientOnionFields CResult_RecipientOnionFieldsDecodeErrorZ_get_ok(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_get_ok")] public static extern long CResult_RecipientOnionFieldsDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_RecipientOnionFieldsDecodeErrorZ_get_err(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_get_err")] public static extern long CResult_RecipientOnionFieldsDecodeErrorZ_get_err(long _owner); + // struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_ok")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_get_err")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_get_err(long _owner); + // struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(long _owner); + // struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_ty_from_ptr")] public static extern long LDKSpendableOutputDescriptor_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint")] public static extern long LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_StaticOutput_get_output")] public static extern long LDKSpendableOutputDescriptor_StaticOutput_get_output(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output")] public static extern long LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output")] public static extern long LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(long ptr); + // struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PackedLockTimeZ_ty_from_ptr")] public static extern long LDKCOption_PackedLockTimeZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PackedLockTimeZ_Some_get_some")] public static extern int LDKCOption_PackedLockTimeZ_Some_get_some(long ptr); + // struct LDKCVec_u8Z C2Tuple_PartiallySignedTransactionusizeZ_get_a(LDKC2Tuple_PartiallySignedTransactionusizeZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PartiallySignedTransactionusizeZ_get_a")] public static extern byte[] C2Tuple_PartiallySignedTransactionusizeZ_get_a(long _owner); + // uintptr_t C2Tuple_PartiallySignedTransactionusizeZ_get_b(LDKC2Tuple_PartiallySignedTransactionusizeZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PartiallySignedTransactionusizeZ_get_b")] public static extern long C2Tuple_PartiallySignedTransactionusizeZ_get_b(long _owner); + // struct LDKC2Tuple_PartiallySignedTransactionusizeZ CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_get_ok(LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_get_ok")] public static extern long CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_get_ok(long _owner); + // void CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_get_err(LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_get_err")] public static extern void CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_get_err(long _owner); // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_get_ok")] public static extern void CResult_NoneNoneZ_get_ok(long _owner); // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_get_err")] public static extern void CResult_NoneNoneZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_ty_from_ptr")] public static extern long LDKDecodeError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDecodeError_Io_get_io")] public static extern IOError LDKDecodeError_Io_get_io(long ptr); - // struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(long _owner); - // struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_get_ok")] public static extern long CResult_TxCreationKeysDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_get_err")] public static extern long CResult_TxCreationKeysDecodeErrorZ_get_err(long _owner); - // struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_get_ok")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_get_err")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u32Z_ty_from_ptr")] public static extern long LDKCOption_u32Z_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u32Z_Some_get_some")] public static extern int LDKCOption_u32Z_Some_get_some(long ptr); - // struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(long _owner); - // struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(long _owner); - // struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_get_err")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_get_err(long _owner); - // struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(long _owner); - // struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(long _owner); - // struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_get_ok")] public static extern long CResult_TrustedClosingTransactionNoneZ_get_ok(long _owner); - // void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_get_err")] public static extern void CResult_TrustedClosingTransactionNoneZ_get_err(long _owner); - // struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_get_ok")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_get_err")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_get_err(long _owner); - // struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_get_ok")] public static extern long CResult_TrustedCommitmentTransactionNoneZ_get_ok(long _owner); - // void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_get_err")] public static extern void CResult_TrustedCommitmentTransactionNoneZ_get_err(long _owner); - // struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_get_ok")] public static extern byte[][] CResult_CVec_SignatureZNoneZ_get_ok(long _owner); - // void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_get_err")] public static extern void CResult_CVec_SignatureZNoneZ_get_err(long _owner); - // struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_get_ok")] public static extern long CResult_ShutdownScriptDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_get_err")] public static extern long CResult_ShutdownScriptDecodeErrorZ_get_err(long _owner); - // struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long _owner); - // struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long _owner); - // struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_get_ok")] public static extern long CResult_BlindedPathNoneZ_get_ok(long _owner); - // void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_get_err")] public static extern void CResult_BlindedPathNoneZ_get_err(long _owner); - // struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_get_ok")] public static extern long CResult_BlindedPathDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_get_err")] public static extern long CResult_BlindedPathDecodeErrorZ_get_err(long _owner); - // struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_get_ok")] public static extern long CResult_BlindedHopDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_get_err")] public static extern long CResult_BlindedHopDecodeErrorZ_get_err(long _owner); + // struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_get_a")] public static extern byte[] C2Tuple_SignatureCVec_SignatureZZ_get_a(long _owner); + // struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_get_b")] public static extern byte[][] C2Tuple_SignatureCVec_SignatureZZ_get_b(long _owner); + // struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok")] public static extern long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long _owner); + // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err")] public static extern void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long _owner); + // struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_get_ok")] public static extern byte[] CResult_SignatureNoneZ_get_ok(long _owner); + // void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_get_err")] public static extern void CResult_SignatureNoneZ_get_err(long _owner); + // struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_get_ok")] public static extern byte[] CResult_PublicKeyNoneZ_get_ok(long _owner); + // void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_get_err")] public static extern void CResult_PublicKeyNoneZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ScalarZ_ty_from_ptr")] public static extern long LDKCOption_ScalarZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ScalarZ_Some_get_some")] public static extern long LDKCOption_ScalarZ_Some_get_some(long ptr); + // struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_get_ok")] public static extern byte[] CResult_SharedSecretNoneZ_get_ok(long _owner); + // void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_get_err")] public static extern void CResult_SharedSecretNoneZ_get_err(long _owner); + // struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_get_ok")] public static extern byte[] CResult_RecoverableSignatureNoneZ_get_ok(long _owner); + // void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_get_err")] public static extern void CResult_RecoverableSignatureNoneZ_get_err(long _owner); + public interface LDKChannelSigner { + byte[] get_per_commitment_point(long _idx); + byte[] release_commitment_secret(long _idx); + long validate_holder_commitment(long _holder_tx, byte[][] _preimages); + byte[] channel_keys_id(); + void provide_channel_parameters(long _channel_parameters); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKChannelSigner_new")] public static extern long LDKChannelSigner_new(LDKChannelSigner impl, long pubkeys); + // LDKPublicKey ChannelSigner_get_per_commitment_point LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_get_per_commitment_point")] public static extern byte[] ChannelSigner_get_per_commitment_point(long _this_arg, long _idx); + // LDKThirtyTwoBytes ChannelSigner_release_commitment_secret LDKChannelSigner *NONNULL_PTR this_arg, uint64_t idx + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_release_commitment_secret")] public static extern byte[] ChannelSigner_release_commitment_secret(long _this_arg, long _idx); + // LDKCResult_NoneNoneZ ChannelSigner_validate_holder_commitment LDKChannelSigner *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_validate_holder_commitment")] public static extern long ChannelSigner_validate_holder_commitment(long _this_arg, long _holder_tx, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _preimages); + // LDKThirtyTwoBytes ChannelSigner_channel_keys_id LDKChannelSigner *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_channel_keys_id")] public static extern byte[] ChannelSigner_channel_keys_id(long _this_arg); + // void ChannelSigner_provide_channel_parameters LDKChannelSigner *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_provide_channel_parameters")] public static extern void ChannelSigner_provide_channel_parameters(long _this_arg, long _channel_parameters); + // LDKChannelPublicKeys ChannelSigner_get_pubkeys LDKChannelSigner *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_get_pubkeys")] public static extern long ChannelSigner_get_pubkeys(long _this_arg); + public interface LDKEcdsaChannelSigner { + long sign_counterparty_commitment(long _commitment_tx, byte[][] _preimages); + long validate_counterparty_revocation(long _idx, byte[] _secret); + long sign_holder_commitment_and_htlcs(long _commitment_tx); + long sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key); + long sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, long _htlc); + long sign_holder_htlc_transaction(byte[] _htlc_tx, long _input, long _htlc_descriptor); + long sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, long _htlc); + long sign_closing_transaction(long _closing_tx); + long sign_holder_anchor_input(byte[] _anchor_tx, long _input); + long sign_channel_announcement_with_funding_key(long _msg); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEcdsaChannelSigner_new")] public static extern long LDKEcdsaChannelSigner_new(LDKEcdsaChannelSigner impl, LDKChannelSigner ChannelSigner, long pubkeys); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEcdsaChannelSigner_get_ChannelSigner")] public static extern long LDKEcdsaChannelSigner_get_ChannelSigner(long arg); + // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ EcdsaChannelSigner_sign_counterparty_commitment LDKEcdsaChannelSigner *NONNULL_PTR this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_counterparty_commitment")] public static extern long EcdsaChannelSigner_sign_counterparty_commitment(long _this_arg, long _commitment_tx, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _preimages); + // LDKCResult_NoneNoneZ EcdsaChannelSigner_validate_counterparty_revocation LDKEcdsaChannelSigner *NONNULL_PTR this_arg, uint64_t idx, const uint8_t (*secret)[32] + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_validate_counterparty_revocation")] public static extern long EcdsaChannelSigner_validate_counterparty_revocation(long _this_arg, long _idx, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _secret); + // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ EcdsaChannelSigner_sign_holder_commitment_and_htlcs LDKEcdsaChannelSigner *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_holder_commitment_and_htlcs")] public static extern long EcdsaChannelSigner_sign_holder_commitment_and_htlcs(long _this_arg, long _commitment_tx); + // LDKCResult_SignatureNoneZ EcdsaChannelSigner_sign_justice_revoked_output LDKEcdsaChannelSigner *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32] + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_justice_revoked_output")] public static extern long EcdsaChannelSigner_sign_justice_revoked_output(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _justice_tx, long _input, long _amount, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_key); + // LDKCResult_SignatureNoneZ EcdsaChannelSigner_sign_justice_revoked_htlc LDKEcdsaChannelSigner *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_justice_revoked_htlc")] public static extern long EcdsaChannelSigner_sign_justice_revoked_htlc(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _justice_tx, long _input, long _amount, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_key, long _htlc); + // LDKCResult_SignatureNoneZ EcdsaChannelSigner_sign_holder_htlc_transaction LDKEcdsaChannelSigner *NONNULL_PTR this_arg, struct LDKTransaction htlc_tx, uintptr_t input, const struct LDKHTLCDescriptor *NONNULL_PTR htlc_descriptor + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_holder_htlc_transaction")] public static extern long EcdsaChannelSigner_sign_holder_htlc_transaction(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_tx, long _input, long _htlc_descriptor); + // LDKCResult_SignatureNoneZ EcdsaChannelSigner_sign_counterparty_htlc_transaction LDKEcdsaChannelSigner *NONNULL_PTR this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_counterparty_htlc_transaction")] public static extern long EcdsaChannelSigner_sign_counterparty_htlc_transaction(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_tx, long _input, long _amount, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point, long _htlc); + // LDKCResult_SignatureNoneZ EcdsaChannelSigner_sign_closing_transaction LDKEcdsaChannelSigner *NONNULL_PTR this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_closing_transaction")] public static extern long EcdsaChannelSigner_sign_closing_transaction(long _this_arg, long _closing_tx); + // LDKCResult_SignatureNoneZ EcdsaChannelSigner_sign_holder_anchor_input LDKEcdsaChannelSigner *NONNULL_PTR this_arg, struct LDKTransaction anchor_tx, uintptr_t input + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_holder_anchor_input")] public static extern long EcdsaChannelSigner_sign_holder_anchor_input(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _anchor_tx, long _input); + // LDKCResult_SignatureNoneZ EcdsaChannelSigner_sign_channel_announcement_with_funding_key LDKEcdsaChannelSigner *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_sign_channel_announcement_with_funding_key")] public static extern long EcdsaChannelSigner_sign_channel_announcement_with_funding_key(long _this_arg, long _msg); + public interface LDKWriteableEcdsaChannelSigner { + byte[] write(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKWriteableEcdsaChannelSigner_new")] public static extern long LDKWriteableEcdsaChannelSigner_new(LDKWriteableEcdsaChannelSigner impl, LDKEcdsaChannelSigner EcdsaChannelSigner, LDKChannelSigner ChannelSigner, long pubkeys); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKWriteableEcdsaChannelSigner_get_EcdsaChannelSigner")] public static extern long LDKWriteableEcdsaChannelSigner_get_EcdsaChannelSigner(long arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKWriteableEcdsaChannelSigner_get_ChannelSigner")] public static extern long LDKWriteableEcdsaChannelSigner_get_ChannelSigner(long arg); + // LDKCVec_u8Z WriteableEcdsaChannelSigner_write LDKWriteableEcdsaChannelSigner *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_write")] public static extern byte[] WriteableEcdsaChannelSigner_write(long _this_arg); + // struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(long _owner); + // struct LDKCVec_u8Z CResult_ScriptNoneZ_get_ok(LDKCResult_ScriptNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_get_ok")] public static extern byte[] CResult_ScriptNoneZ_get_ok(long _owner); + // void CResult_ScriptNoneZ_get_err(LDKCResult_ScriptNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_get_err")] public static extern void CResult_ScriptNoneZ_get_err(long _owner); + // struct LDKShutdownScript CResult_ShutdownScriptNoneZ_get_ok(LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_get_ok")] public static extern long CResult_ShutdownScriptNoneZ_get_ok(long _owner); + // void CResult_ShutdownScriptNoneZ_get_err(LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_get_err")] public static extern void CResult_ShutdownScriptNoneZ_get_err(long _owner); + // struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_get_ok")] public static extern byte[][] CResult_CVec_CVec_u8ZZNoneZ_get_ok(long _owner); + // void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_get_err")] public static extern void CResult_CVec_CVec_u8ZZNoneZ_get_err(long _owner); + // struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_ok")] public static extern long CResult_InMemorySignerDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_err")] public static extern long CResult_InMemorySignerDecodeErrorZ_get_err(long _owner); + // struct LDKCVec_u8Z CResult_PartiallySignedTransactionNoneZ_get_ok(LDKCResult_PartiallySignedTransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_get_ok")] public static extern byte[] CResult_PartiallySignedTransactionNoneZ_get_ok(long _owner); + // void CResult_PartiallySignedTransactionNoneZ_get_err(LDKCResult_PartiallySignedTransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_get_err")] public static extern void CResult_PartiallySignedTransactionNoneZ_get_err(long _owner); + // struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_ok")] public static extern byte[] CResult_TransactionNoneZ_get_ok(long _owner); + // void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_err")] public static extern void CResult_TransactionNoneZ_get_err(long _owner); public interface LDKScore { - long channel_penalty_msat(long _short_channel_id, long _source, long _target, long _usage); - void payment_path_failed(long[] _path, long _short_channel_id); - void payment_path_successful(long[] _path); - void probe_failed(long[] _path, long _short_channel_id); - void probe_successful(long[] _path); + long channel_penalty_msat(long _short_channel_id, long _source, long _target, long _usage, long _score_params); + void payment_path_failed(long _path, long _short_channel_id); + void payment_path_successful(long _path); + void probe_failed(long _path, long _short_channel_id); + void probe_successful(long _path); byte[] write(); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKScore_new")] public static extern long LDKScore_new(LDKScore impl); - // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_channel_penalty_msat")] public static extern long Score_channel_penalty_msat(long _this_arg, long _short_channel_id, long _source, long _target, long _usage); - // void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_payment_path_failed")] public static extern void Score_payment_path_failed(long _this_arg, long[] _path, long _short_channel_id); - // void Score_payment_path_successful LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_payment_path_successful")] public static extern void Score_payment_path_successful(long _this_arg, long[] _path); - // void Score_probe_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_probe_failed")] public static extern void Score_probe_failed(long _this_arg, long[] _path, long _short_channel_id); - // void Score_probe_successful LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_probe_successful")] public static extern void Score_probe_successful(long _this_arg, long[] _path); + // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_channel_penalty_msat")] public static extern long Score_channel_penalty_msat(long _this_arg, long _short_channel_id, long _source, long _target, long _usage, long _score_params); + // void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_payment_path_failed")] public static extern void Score_payment_path_failed(long _this_arg, long _path, long _short_channel_id); + // void Score_payment_path_successful LDKScore *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_payment_path_successful")] public static extern void Score_payment_path_successful(long _this_arg, long _path); + // void Score_probe_failed LDKScore *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_probe_failed")] public static extern void Score_probe_failed(long _this_arg, long _path, long _short_channel_id); + // void Score_probe_successful LDKScore *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_probe_successful")] public static extern void Score_probe_successful(long _this_arg, long _path); // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_write")] public static extern byte[] Score_write(long _this_arg); public interface LDKLockableScore { @@ -153,8 +296,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_get_ok")] public static extern long CResult_RouteLightningErrorZ_get_ok(long _owner); // struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_get_err")] public static extern long CResult_RouteLightningErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u64Z_ty_from_ptr")] public static extern long LDKCOption_u64Z_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u64Z_Some_get_some")] public static extern long LDKCOption_u64Z_Some_get_some(long ptr); // struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_get_ok")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); @@ -163,6 +304,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_get_ok")] public static extern long CResult_RouteHopDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_get_err")] public static extern long CResult_RouteHopDecodeErrorZ_get_err(long _owner); + // struct LDKBlindedTail CResult_BlindedTailDecodeErrorZ_get_ok(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_get_ok")] public static extern long CResult_BlindedTailDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BlindedTailDecodeErrorZ_get_err(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_get_err")] public static extern long CResult_BlindedTailDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u32Z_ty_from_ptr")] public static extern long LDKCOption_u32Z_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u32Z_Some_get_some")] public static extern int LDKCOption_u32Z_Some_get_some(long ptr); // struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_get_ok")] public static extern long CResult_RouteDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); @@ -175,6 +322,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_get_ok")] public static extern long CResult_PaymentParametersDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_get_err")] public static extern long CResult_PaymentParametersDecodeErrorZ_get_err(long _owner); + // struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_a")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_get_a(long _owner); + // struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_b")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_get_b(long _owner); // struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_get_ok")] public static extern long CResult_RouteHintDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner); @@ -183,37 +334,96 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_get_ok")] public static extern long CResult_RouteHintHopDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_get_err")] public static extern long CResult_RouteHintHopDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_ty_from_ptr")] public static extern long LDKPaymentPurpose_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_preimage")] public static extern byte[] LDKPaymentPurpose_InvoicePayment_get_payment_preimage(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_secret")] public static extern byte[] LDKPaymentPurpose_InvoicePayment_get_payment_secret(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment")] public static extern byte[] LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(long ptr); - // struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_get_ok")] public static extern long CResult_PaymentPurposeDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_get_err")] public static extern long CResult_PaymentPurposeDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ty_from_ptr")] public static extern long LDKClosureReason_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg")] public static extern string LDKClosureReason_CounterpartyForceClosed_get_peer_msg(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ProcessingError_get_err")] public static extern string LDKClosureReason_ProcessingError_get_err(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ClosureReasonZ_ty_from_ptr")] public static extern long LDKCOption_ClosureReasonZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ClosureReasonZ_Some_get_some")] public static extern long LDKCOption_ClosureReasonZ_Some_get_some(long ptr); - // struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_get_err")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_ty_from_ptr")] public static extern long LDKHTLCDestination_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_NextHopChannel_get_node_id")] public static extern byte[] LDKHTLCDestination_NextHopChannel_get_node_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id")] public static extern byte[] LDKHTLCDestination_NextHopChannel_get_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid")] public static extern long LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_InvalidForward_get_requested_forward_scid")] public static extern long LDKHTLCDestination_InvalidForward_get_requested_forward_scid(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_FailedPayment_get_payment_hash")] public static extern byte[] LDKHTLCDestination_FailedPayment_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCDestinationZ_ty_from_ptr")] public static extern long LDKCOption_HTLCDestinationZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCDestinationZ_Some_get_some")] public static extern long LDKCOption_HTLCDestinationZ_Some_get_some(long ptr); - // struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u128Z_ty_from_ptr")] public static extern long LDKCOption_u128Z_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u128Z_Some_get_some")] public static extern byte[] LDKCOption_u128Z_Some_get_some(long ptr); + // struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_get_err")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_get_err(long _owner); + // uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_get_a")] public static extern long C2Tuple_u64u64Z_get_a(long _owner); + // uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_get_b")] public static extern long C2Tuple_u64u64Z_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr")] public static extern long LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(long ptr); + // struct LDKEightU16s C2Tuple_Z_get_a(LDKC2Tuple_Z *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_Z_get_a")] public static extern short[] C2Tuple_Z_get_a(long _owner); + // struct LDKEightU16s C2Tuple_Z_get_b(LDKC2Tuple_Z *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_Z_get_b")] public static extern short[] C2Tuple_Z_get_b(long _owner); + // struct LDKEightU16s C2Tuple__u168_u168Z_get_a(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u168_u168Z_get_a")] public static extern short[] C2Tuple__u168_u168Z_get_a(long _owner); + // struct LDKEightU16s C2Tuple__u168_u168Z_get_b(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u168_u168Z_get_b")] public static extern short[] C2Tuple__u168_u168Z_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_EightU16sEightU16sZZ_ty_from_ptr")] public static extern long LDKCOption_C2Tuple_EightU16sEightU16sZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_get_some(long ptr); + public interface LDKLogger { + void log(long _record); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKLogger_new")] public static extern long LDKLogger_new(LDKLogger impl); + // struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_ok")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_err")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_get_err(long _owner); + // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_get_a")] public static extern long C2Tuple_usizeTransactionZ_get_a(long _owner); + // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_get_b")] public static extern byte[] C2Tuple_usizeTransactionZ_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_BlockHashZ_ty_from_ptr")] public static extern long LDKCOption_BlockHashZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_BlockHashZ_Some_get_some")] public static extern byte[] LDKCOption_BlockHashZ_Some_get_some(long ptr); + // struct LDKThirtyTwoBytes C2Tuple_TxidCOption_BlockHashZZ_get_a(LDKC2Tuple_TxidCOption_BlockHashZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCOption_BlockHashZZ_get_a")] public static extern byte[] C2Tuple_TxidCOption_BlockHashZZ_get_a(long _owner); + // struct LDKCOption_BlockHashZ C2Tuple_TxidCOption_BlockHashZZ_get_b(LDKC2Tuple_TxidCOption_BlockHashZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCOption_BlockHashZZ_get_b")] public static extern long C2Tuple_TxidCOption_BlockHashZZ_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_ty_from_ptr")] public static extern long LDKMonitorEvent_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_HTLCEvent_get_htlc_event")] public static extern long LDKMonitorEvent_HTLCEvent_get_htlc_event(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed")] public static extern long LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_Completed_get_funding_txo")] public static extern long LDKMonitorEvent_Completed_get_funding_txo(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_Completed_get_monitor_update_id")] public static extern long LDKMonitorEvent_Completed_get_monitor_update_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_UpdateFailed_get_update_failed")] public static extern long LDKMonitorEvent_UpdateFailed_get_update_failed(long ptr); + // struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(long _owner); + // struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b")] public static extern long[] C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(long _owner); + // struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c")] public static extern byte[] C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(long _owner); + // struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_InitFeaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_get_err")] public static extern long CResult_InitFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_get_err")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_NodeFeaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_get_err")] public static extern long CResult_NodeFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKBolt11InvoiceFeatures CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err")] public static extern long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKBolt12InvoiceFeatures CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err")] public static extern long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_get_err")] public static extern long CResult_BlindedHopFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_get_ok")] public static extern long CResult_OfferBolt12ParseErrorZ_get_ok(long _owner); + // struct LDKBolt12ParseError CResult_OfferBolt12ParseErrorZ_get_err(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_get_err")] public static extern long CResult_OfferBolt12ParseErrorZ_get_err(long _owner); + // struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_get_ok")] public static extern byte[] CResult_PublicKeyErrorZ_get_ok(long _owner); + // enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_get_err")] public static extern Secp256k1Error CResult_PublicKeyErrorZ_get_err(long _owner); + // struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_get_ok")] public static extern long CResult_NodeIdDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_get_err")] public static extern long CResult_NodeIdDecodeErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_ty_from_ptr")] public static extern long LDKNetworkUpdate_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_ChannelUpdateMessage_get_msg")] public static extern long LDKNetworkUpdate_ChannelUpdateMessage_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_ChannelFailure_get_short_channel_id")] public static extern long LDKNetworkUpdate_ChannelFailure_get_short_channel_id(long ptr); @@ -222,86 +432,44 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_NodeFailure_get_is_permanent")] public static extern bool LDKNetworkUpdate_NodeFailure_get_is_permanent(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_NetworkUpdateZ_ty_from_ptr")] public static extern long LDKCOption_NetworkUpdateZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_NetworkUpdateZ_Some_get_some")] public static extern long LDKCOption_NetworkUpdateZ_Some_get_some(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_ty_from_ptr")] public static extern long LDKSpendableOutputDescriptor_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint")] public static extern long LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_StaticOutput_get_output")] public static extern long LDKSpendableOutputDescriptor_StaticOutput_get_output(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output")] public static extern long LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output")] public static extern long LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ty_from_ptr")] public static extern long LDKEvent_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id")] public static extern byte[] LDKEvent_FundingGenerationReady_get_temporary_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_counterparty_node_id")] public static extern byte[] LDKEvent_FundingGenerationReady_get_counterparty_node_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_channel_value_satoshis")] public static extern long LDKEvent_FundingGenerationReady_get_channel_value_satoshis(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_output_script")] public static extern byte[] LDKEvent_FundingGenerationReady_get_output_script(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_user_channel_id")] public static extern byte[] LDKEvent_FundingGenerationReady_get_user_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_receiver_node_id")] public static extern byte[] LDKEvent_PaymentClaimable_get_receiver_node_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_payment_hash")] public static extern byte[] LDKEvent_PaymentClaimable_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_amount_msat")] public static extern long LDKEvent_PaymentClaimable_get_amount_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_purpose")] public static extern long LDKEvent_PaymentClaimable_get_purpose(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_via_channel_id")] public static extern byte[] LDKEvent_PaymentClaimable_get_via_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_via_user_channel_id")] public static extern long LDKEvent_PaymentClaimable_get_via_user_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_receiver_node_id")] public static extern byte[] LDKEvent_PaymentClaimed_get_receiver_node_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_payment_hash")] public static extern byte[] LDKEvent_PaymentClaimed_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_amount_msat")] public static extern long LDKEvent_PaymentClaimed_get_amount_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_purpose")] public static extern long LDKEvent_PaymentClaimed_get_purpose(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_id")] public static extern byte[] LDKEvent_PaymentSent_get_payment_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_preimage")] public static extern byte[] LDKEvent_PaymentSent_get_payment_preimage(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_hash")] public static extern byte[] LDKEvent_PaymentSent_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_fee_paid_msat")] public static extern long LDKEvent_PaymentSent_get_fee_paid_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentFailed_get_payment_id")] public static extern byte[] LDKEvent_PaymentFailed_get_payment_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentFailed_get_payment_hash")] public static extern byte[] LDKEvent_PaymentFailed_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathSuccessful_get_payment_id")] public static extern byte[] LDKEvent_PaymentPathSuccessful_get_payment_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathSuccessful_get_payment_hash")] public static extern byte[] LDKEvent_PaymentPathSuccessful_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathSuccessful_get_path")] public static extern long[] LDKEvent_PaymentPathSuccessful_get_path(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_payment_id")] public static extern byte[] LDKEvent_PaymentPathFailed_get_payment_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_payment_hash")] public static extern byte[] LDKEvent_PaymentPathFailed_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_payment_failed_permanently")] public static extern bool LDKEvent_PaymentPathFailed_get_payment_failed_permanently(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_network_update")] public static extern long LDKEvent_PaymentPathFailed_get_network_update(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_all_paths_failed")] public static extern bool LDKEvent_PaymentPathFailed_get_all_paths_failed(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_path")] public static extern long[] LDKEvent_PaymentPathFailed_get_path(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_short_channel_id")] public static extern long LDKEvent_PaymentPathFailed_get_short_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_retry")] public static extern long LDKEvent_PaymentPathFailed_get_retry(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeSuccessful_get_payment_id")] public static extern byte[] LDKEvent_ProbeSuccessful_get_payment_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeSuccessful_get_payment_hash")] public static extern byte[] LDKEvent_ProbeSuccessful_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeSuccessful_get_path")] public static extern long[] LDKEvent_ProbeSuccessful_get_path(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_payment_id")] public static extern byte[] LDKEvent_ProbeFailed_get_payment_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_payment_hash")] public static extern byte[] LDKEvent_ProbeFailed_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_path")] public static extern long[] LDKEvent_ProbeFailed_get_path(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_short_channel_id")] public static extern long LDKEvent_ProbeFailed_get_short_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PendingHTLCsForwardable_get_time_forwardable")] public static extern long LDKEvent_PendingHTLCsForwardable_get_time_forwardable(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_intercept_id")] public static extern byte[] LDKEvent_HTLCIntercepted_get_intercept_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_requested_next_hop_scid")] public static extern long LDKEvent_HTLCIntercepted_get_requested_next_hop_scid(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_payment_hash")] public static extern byte[] LDKEvent_HTLCIntercepted_get_payment_hash(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_inbound_amount_msat")] public static extern long LDKEvent_HTLCIntercepted_get_inbound_amount_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat")] public static extern long LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_SpendableOutputs_get_outputs")] public static extern long[] LDKEvent_SpendableOutputs_get_outputs(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_prev_channel_id")] public static extern byte[] LDKEvent_PaymentForwarded_get_prev_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_next_channel_id")] public static extern byte[] LDKEvent_PaymentForwarded_get_next_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_fee_earned_msat")] public static extern long LDKEvent_PaymentForwarded_get_fee_earned_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx")] public static extern bool LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_channel_id")] public static extern byte[] LDKEvent_ChannelReady_get_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_user_channel_id")] public static extern byte[] LDKEvent_ChannelReady_get_user_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_counterparty_node_id")] public static extern byte[] LDKEvent_ChannelReady_get_counterparty_node_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_channel_type")] public static extern long LDKEvent_ChannelReady_get_channel_type(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_channel_id")] public static extern byte[] LDKEvent_ChannelClosed_get_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_user_channel_id")] public static extern byte[] LDKEvent_ChannelClosed_get_user_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_reason")] public static extern long LDKEvent_ChannelClosed_get_reason(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_DiscardFunding_get_channel_id")] public static extern byte[] LDKEvent_DiscardFunding_get_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_DiscardFunding_get_transaction")] public static extern byte[] LDKEvent_DiscardFunding_get_transaction(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id")] public static extern byte[] LDKEvent_OpenChannelRequest_get_temporary_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_counterparty_node_id")] public static extern byte[] LDKEvent_OpenChannelRequest_get_counterparty_node_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_funding_satoshis")] public static extern long LDKEvent_OpenChannelRequest_get_funding_satoshis(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_push_msat")] public static extern long LDKEvent_OpenChannelRequest_get_push_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_channel_type")] public static extern long LDKEvent_OpenChannelRequest_get_channel_type(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id")] public static extern byte[] LDKEvent_HTLCHandlingFailed_get_prev_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCHandlingFailed_get_failed_next_destination")] public static extern long LDKEvent_HTLCHandlingFailed_get_failed_next_destination(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_EventZ_ty_from_ptr")] public static extern long LDKCOption_EventZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_EventZ_Some_get_some")] public static extern long LDKCOption_EventZ_Some_get_some(long ptr); - // struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_get_ok")] public static extern long CResult_COption_EventZDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_get_err")] public static extern long CResult_COption_EventZDecodeErrorZ_get_err(long _owner); + // struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(long _owner); + // struct LDKTxOut CResult_TxOutUtxoLookupErrorZ_get_ok(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_get_ok")] public static extern long CResult_TxOutUtxoLookupErrorZ_get_ok(long _owner); + // enum LDKUtxoLookupError CResult_TxOutUtxoLookupErrorZ_get_err(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_get_err")] public static extern UtxoLookupError CResult_TxOutUtxoLookupErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUtxoResult_ty_from_ptr")] public static extern long LDKUtxoResult_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUtxoResult_Sync_get_sync")] public static extern long LDKUtxoResult_Sync_get_sync(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUtxoResult_Async_get_async")] public static extern long LDKUtxoResult_Async_get_async(long ptr); + public interface LDKUtxoLookup { + long get_utxo(byte[] _genesis_hash, long _short_channel_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUtxoLookup_new")] public static extern long LDKUtxoLookup_new(LDKUtxoLookup impl); + // LDKUtxoResult UtxoLookup_get_utxo LDKUtxoLookup *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoLookup_get_utxo")] public static extern long UtxoLookup_get_utxo(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _genesis_hash, long _short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_UtxoLookupZ_ty_from_ptr")] public static extern long LDKCOption_UtxoLookupZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_UtxoLookupZ_Some_get_some")] public static extern long LDKCOption_UtxoLookupZ_Some_get_some(long ptr); + // void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_get_ok")] public static extern void CResult_NoneLightningErrorZ_get_ok(long _owner); + // struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_get_err")] public static extern long CResult_NoneLightningErrorZ_get_err(long _owner); + // bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_get_ok")] public static extern bool CResult_boolLightningErrorZ_get_ok(long _owner); + // struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_get_err")] public static extern long CResult_boolLightningErrorZ_get_err(long _owner); + // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long _owner); + // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long _owner); + // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr")] public static extern long LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some")] public static extern long LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKErrorAction_ty_from_ptr")] public static extern long LDKErrorAction_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKErrorAction_DisconnectPeer_get_msg")] public static extern long LDKErrorAction_DisconnectPeer_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKErrorAction_DisconnectPeerWithWarning_get_msg")] public static extern long LDKErrorAction_DisconnectPeerWithWarning_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKErrorAction_IgnoreAndLog_get_ignore_and_log")] public static extern Level LDKErrorAction_IgnoreAndLog_get_ignore_and_log(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKErrorAction_SendErrorMessage_get_msg")] public static extern long LDKErrorAction_SendErrorMessage_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKErrorAction_SendWarningMessage_get_msg")] public static extern long LDKErrorAction_SendWarningMessage_get_msg(long ptr); @@ -309,12 +477,34 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_ty_from_ptr")] public static extern long LDKMessageSendEvent_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendAcceptChannel_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendAcceptChannel_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendAcceptChannel_get_msg")] public static extern long LDKMessageSendEvent_SendAcceptChannel_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendAcceptChannelV2_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendAcceptChannelV2_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendAcceptChannelV2_get_msg")] public static extern long LDKMessageSendEvent_SendAcceptChannelV2_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendOpenChannel_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendOpenChannel_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendOpenChannel_get_msg")] public static extern long LDKMessageSendEvent_SendOpenChannel_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendOpenChannelV2_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendOpenChannelV2_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendOpenChannelV2_get_msg")] public static extern long LDKMessageSendEvent_SendOpenChannelV2_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendFundingCreated_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendFundingCreated_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendFundingCreated_get_msg")] public static extern long LDKMessageSendEvent_SendFundingCreated_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendFundingSigned_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendFundingSigned_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendFundingSigned_get_msg")] public static extern long LDKMessageSendEvent_SendFundingSigned_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAddInput_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxAddInput_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAddInput_get_msg")] public static extern long LDKMessageSendEvent_SendTxAddInput_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAddOutput_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxAddOutput_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAddOutput_get_msg")] public static extern long LDKMessageSendEvent_SendTxAddOutput_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxRemoveInput_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxRemoveInput_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxRemoveInput_get_msg")] public static extern long LDKMessageSendEvent_SendTxRemoveInput_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxRemoveOutput_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxRemoveOutput_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxRemoveOutput_get_msg")] public static extern long LDKMessageSendEvent_SendTxRemoveOutput_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxComplete_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxComplete_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxComplete_get_msg")] public static extern long LDKMessageSendEvent_SendTxComplete_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxSignatures_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxSignatures_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxSignatures_get_msg")] public static extern long LDKMessageSendEvent_SendTxSignatures_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxInitRbf_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxInitRbf_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxInitRbf_get_msg")] public static extern long LDKMessageSendEvent_SendTxInitRbf_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAckRbf_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxAckRbf_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAckRbf_get_msg")] public static extern long LDKMessageSendEvent_SendTxAckRbf_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAbort_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendTxAbort_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendTxAbort_get_msg")] public static extern long LDKMessageSendEvent_SendTxAbort_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendChannelReady_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendChannelReady_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendChannelReady_get_msg")] public static extern long LDKMessageSendEvent_SendChannelReady_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(long ptr); @@ -335,6 +525,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg")] public static extern long LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg")] public static extern long LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg")] public static extern long LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg")] public static extern long LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendChannelUpdate_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendChannelUpdate_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendChannelUpdate_get_msg")] public static extern long LDKMessageSendEvent_SendChannelUpdate_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_HandleError_get_node_id")] public static extern byte[] LDKMessageSendEvent_HandleError_get_node_id(long ptr); @@ -347,108 +538,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendReplyChannelRange_get_msg")] public static extern long LDKMessageSendEvent_SendReplyChannelRange_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id")] public static extern byte[] LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg")] public static extern long LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(long ptr); - // struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_get_ok")] public static extern long CResult_TxOutAccessErrorZ_get_ok(long _owner); - // enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_get_err")] public static extern AccessError CResult_TxOutAccessErrorZ_get_err(long _owner); - // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_get_a")] public static extern long C2Tuple_usizeTransactionZ_get_a(long _owner); - // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_get_b")] public static extern byte[] C2Tuple_usizeTransactionZ_get_b(long _owner); - // struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidBlockHashZ_get_a")] public static extern byte[] C2Tuple_TxidBlockHashZ_get_a(long _owner); - // struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidBlockHashZ_get_b")] public static extern byte[] C2Tuple_TxidBlockHashZ_get_b(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_ty_from_ptr")] public static extern long LDKMonitorEvent_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_HTLCEvent_get_htlc_event")] public static extern long LDKMonitorEvent_HTLCEvent_get_htlc_event(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed")] public static extern long LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_Completed_get_funding_txo")] public static extern long LDKMonitorEvent_Completed_get_funding_txo(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_Completed_get_monitor_update_id")] public static extern long LDKMonitorEvent_Completed_get_monitor_update_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_UpdateFailed_get_update_failed")] public static extern long LDKMonitorEvent_UpdateFailed_get_update_failed(long ptr); - // struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(long _owner); - // struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b")] public static extern long[] C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(long _owner); - // struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c")] public static extern byte[] C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(long _owner); - // struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_get_err")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_get_err(long _owner); - // uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_get_a")] public static extern long C2Tuple_u64u64Z_get_a(long _owner); - // uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_get_b")] public static extern long C2Tuple_u64u64Z_get_b(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr")] public static extern long LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(long ptr); - public interface LDKLogger { - void log(long _record); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKLogger_new")] public static extern long LDKLogger_new(LDKLogger impl); - // struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_ok")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_err")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_get_err(long _owner); - // struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_InitFeaturesDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_get_err")] public static extern long CResult_InitFeaturesDecodeErrorZ_get_err(long _owner); - // struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_get_err")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_get_err(long _owner); - // struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_NodeFeaturesDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_get_err")] public static extern long CResult_NodeFeaturesDecodeErrorZ_get_err(long _owner); - // struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_InvoiceFeaturesDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_get_err")] public static extern long CResult_InvoiceFeaturesDecodeErrorZ_get_err(long _owner); - // struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(long _owner); - // struct LDKOfferFeatures CResult_OfferFeaturesDecodeErrorZ_get_ok(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_OfferFeaturesDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_OfferFeaturesDecodeErrorZ_get_err(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_get_err")] public static extern long CResult_OfferFeaturesDecodeErrorZ_get_err(long _owner); - // struct LDKInvoiceRequestFeatures CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err")] public static extern long CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(long _owner); - // struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_get_ok")] public static extern long CResult_NodeIdDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_get_err")] public static extern long CResult_NodeIdDecodeErrorZ_get_err(long _owner); - // struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(long _owner); - public interface LDKAccess { - long get_utxo(byte[] _genesis_hash, long _short_channel_id); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAccess_new")] public static extern long LDKAccess_new(LDKAccess impl); - // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Access_get_utxo")] public static extern long Access_get_utxo(long _this_arg, byte[] _genesis_hash, long _short_channel_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_AccessZ_ty_from_ptr")] public static extern long LDKCOption_AccessZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_AccessZ_Some_get_some")] public static extern long LDKCOption_AccessZ_Some_get_some(long ptr); - // bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_get_ok")] public static extern bool CResult_boolLightningErrorZ_get_ok(long _owner); - // struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_get_err")] public static extern long CResult_boolLightningErrorZ_get_err(long _owner); - // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long _owner); - // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long _owner); - // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr")] public static extern long LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some")] public static extern long LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some(long ptr); - // void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_get_ok")] public static extern void CResult_NoneLightningErrorZ_get_ok(long _owner); - // struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_get_err")] public static extern long CResult_NoneLightningErrorZ_get_err(long _owner); // struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner); @@ -491,151 +580,33 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_get_err")] public static extern long CResult_NetworkGraphDecodeErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_NetAddressZZ_ty_from_ptr")] public static extern long LDKCOption_CVec_NetAddressZZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_NetAddressZZ_Some_get_some")] public static extern long[] LDKCOption_CVec_NetAddressZZ_Some_get_some(long ptr); - // struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(long _owner); - // struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(long _owner); - // struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long _owner); - // struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_get_a")] public static extern byte[] C2Tuple_SignatureCVec_SignatureZZ_get_a(long _owner); - // struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_get_b")] public static extern byte[][] C2Tuple_SignatureCVec_SignatureZZ_get_b(long _owner); - // struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok")] public static extern long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long _owner); - // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err")] public static extern void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long _owner); - // struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_get_ok")] public static extern byte[] CResult_SignatureNoneZ_get_ok(long _owner); - // void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_get_err")] public static extern void CResult_SignatureNoneZ_get_err(long _owner); - // struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureSignatureZ_get_a")] public static extern byte[] C2Tuple_SignatureSignatureZ_get_a(long _owner); - // struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureSignatureZ_get_b")] public static extern byte[] C2Tuple_SignatureSignatureZ_get_b(long _owner); - // struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok")] public static extern long CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(long _owner); - // void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err")] public static extern void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(long _owner); - // struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_get_ok")] public static extern byte[] CResult_SecretKeyNoneZ_get_ok(long _owner); - // void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_get_err")] public static extern void CResult_SecretKeyNoneZ_get_err(long _owner); - // struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_get_ok")] public static extern byte[] CResult_PublicKeyNoneZ_get_ok(long _owner); - // void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_get_err")] public static extern void CResult_PublicKeyNoneZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ScalarZ_ty_from_ptr")] public static extern long LDKCOption_ScalarZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ScalarZ_Some_get_some")] public static extern long LDKCOption_ScalarZ_Some_get_some(long ptr); - // struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_get_ok")] public static extern byte[] CResult_SharedSecretNoneZ_get_ok(long _owner); - // void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_get_err")] public static extern void CResult_SharedSecretNoneZ_get_err(long _owner); - public interface LDKBaseSign { - byte[] get_per_commitment_point(long _idx); - byte[] release_commitment_secret(long _idx); - long validate_holder_commitment(long _holder_tx, byte[][] _preimages); - byte[] channel_keys_id(); - long sign_counterparty_commitment(long _commitment_tx, byte[][] _preimages); - long validate_counterparty_revocation(long _idx, byte[] _secret); - long sign_holder_commitment_and_htlcs(long _commitment_tx); - long sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key); - long sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, long _htlc); - long sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, long _htlc); - long sign_closing_transaction(long _closing_tx); - long sign_holder_anchor_input(byte[] _anchor_tx, long _input); - long sign_channel_announcement(long _msg); - void provide_channel_parameters(long _channel_parameters); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBaseSign_new")] public static extern long LDKBaseSign_new(LDKBaseSign impl, long pubkeys); - // LDKPublicKey BaseSign_get_per_commitment_point LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_get_per_commitment_point")] public static extern byte[] BaseSign_get_per_commitment_point(long _this_arg, long _idx); - // LDKThirtyTwoBytes BaseSign_release_commitment_secret LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_release_commitment_secret")] public static extern byte[] BaseSign_release_commitment_secret(long _this_arg, long _idx); - // LDKCResult_NoneNoneZ BaseSign_validate_holder_commitment LDKBaseSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_validate_holder_commitment")] public static extern long BaseSign_validate_holder_commitment(long _this_arg, long _holder_tx, byte[][] _preimages); - // LDKThirtyTwoBytes BaseSign_channel_keys_id LDKBaseSign *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_channel_keys_id")] public static extern byte[] BaseSign_channel_keys_id(long _this_arg); - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ BaseSign_sign_counterparty_commitment LDKBaseSign *NONNULL_PTR this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_counterparty_commitment")] public static extern long BaseSign_sign_counterparty_commitment(long _this_arg, long _commitment_tx, byte[][] _preimages); - // LDKCResult_NoneNoneZ BaseSign_validate_counterparty_revocation LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx, const uint8_t (*secret)[32] - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_validate_counterparty_revocation")] public static extern long BaseSign_validate_counterparty_revocation(long _this_arg, long _idx, byte[] _secret); - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ BaseSign_sign_holder_commitment_and_htlcs LDKBaseSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_holder_commitment_and_htlcs")] public static extern long BaseSign_sign_holder_commitment_and_htlcs(long _this_arg, long _commitment_tx); - // LDKCResult_SignatureNoneZ BaseSign_sign_justice_revoked_output LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32] - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_justice_revoked_output")] public static extern long BaseSign_sign_justice_revoked_output(long _this_arg, byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key); - // LDKCResult_SignatureNoneZ BaseSign_sign_justice_revoked_htlc LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_justice_revoked_htlc")] public static extern long BaseSign_sign_justice_revoked_htlc(long _this_arg, byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, long _htlc); - // LDKCResult_SignatureNoneZ BaseSign_sign_counterparty_htlc_transaction LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_counterparty_htlc_transaction")] public static extern long BaseSign_sign_counterparty_htlc_transaction(long _this_arg, byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, long _htlc); - // LDKCResult_SignatureNoneZ BaseSign_sign_closing_transaction LDKBaseSign *NONNULL_PTR this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_closing_transaction")] public static extern long BaseSign_sign_closing_transaction(long _this_arg, long _closing_tx); - // LDKCResult_SignatureNoneZ BaseSign_sign_holder_anchor_input LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction anchor_tx, uintptr_t input - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_holder_anchor_input")] public static extern long BaseSign_sign_holder_anchor_input(long _this_arg, byte[] _anchor_tx, long _input); - // LDKCResult_C2Tuple_SignatureSignatureZNoneZ BaseSign_sign_channel_announcement LDKBaseSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_sign_channel_announcement")] public static extern long BaseSign_sign_channel_announcement(long _this_arg, long _msg); - // void BaseSign_provide_channel_parameters LDKBaseSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_provide_channel_parameters")] public static extern void BaseSign_provide_channel_parameters(long _this_arg, long _channel_parameters); - // LDKChannelPublicKeys BaseSign_get_pubkeys LDKBaseSign *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_get_pubkeys")] public static extern long BaseSign_get_pubkeys(long _this_arg); - public interface LDKSign { - byte[] write(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSign_new")] public static extern long LDKSign_new(LDKSign impl, LDKBaseSign BaseSign, long pubkeys); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSign_get_BaseSign")] public static extern long LDKSign_get_BaseSign(long arg); - // LDKCVec_u8Z Sign_write LDKSign *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sign_write")] public static extern byte[] Sign_write(long _this_arg); - // struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_get_ok")] public static extern long CResult_SignDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_get_err")] public static extern long CResult_SignDecodeErrorZ_get_err(long _owner); - // struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_get_ok")] public static extern byte[] CResult_RecoverableSignatureNoneZ_get_ok(long _owner); - // void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_get_err")] public static extern void CResult_RecoverableSignatureNoneZ_get_err(long _owner); - // struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_get_ok")] public static extern byte[][] CResult_CVec_CVec_u8ZZNoneZ_get_ok(long _owner); - // void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_get_err")] public static extern void CResult_CVec_CVec_u8ZZNoneZ_get_err(long _owner); - // struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_ok")] public static extern long CResult_InMemorySignerDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_err")] public static extern long CResult_InMemorySignerDecodeErrorZ_get_err(long _owner); - // struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_ok")] public static extern byte[] CResult_TransactionNoneZ_get_ok(long _owner); - // void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_err")] public static extern void CResult_TransactionNoneZ_get_err(long _owner); - // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_get_a")] public static extern byte[] C2Tuple_BlockHashChannelMonitorZ_get_a(long _owner); - // struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_get_b")] public static extern long C2Tuple_BlockHashChannelMonitorZ_get_b(long _owner); - // struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok")] public static extern long[] CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(long _owner); - // enum LDKIOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err")] public static extern IOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentPreimageZ_ty_from_ptr")] public static extern long LDKCOption_PaymentPreimageZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentPreimageZ_Some_get_some")] public static extern byte[] LDKCOption_PaymentPreimageZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TxOutZ_ty_from_ptr")] public static extern long LDKCOption_TxOutZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TxOutZ_Some_get_some")] public static extern long LDKCOption_TxOutZ_Some_get_some(long ptr); + // struct LDKCoinSelection CResult_CoinSelectionNoneZ_get_ok(LDKCResult_CoinSelectionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_get_ok")] public static extern long CResult_CoinSelectionNoneZ_get_ok(long _owner); + // void CResult_CoinSelectionNoneZ_get_err(LDKCResult_CoinSelectionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_get_err")] public static extern void CResult_CoinSelectionNoneZ_get_err(long _owner); + // struct LDKCVec_UtxoZ CResult_CVec_UtxoZNoneZ_get_ok(LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_get_ok")] public static extern long[] CResult_CVec_UtxoZNoneZ_get_ok(long _owner); + // void CResult_CVec_UtxoZNoneZ_get_err(LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_get_err")] public static extern void CResult_CVec_UtxoZNoneZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u16Z_ty_from_ptr")] public static extern long LDKCOption_u16Z_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u16Z_Some_get_some")] public static extern short LDKCOption_u16Z_Some_get_some(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_ty_from_ptr")] public static extern long LDKAPIError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_APIMisuseError_get_err")] public static extern string LDKAPIError_APIMisuseError_get_err(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_FeeRateTooHigh_get_err")] public static extern string LDKAPIError_FeeRateTooHigh_get_err(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_FeeRateTooHigh_get_feerate")] public static extern int LDKAPIError_FeeRateTooHigh_get_feerate(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_InvalidRoute_get_err")] public static extern string LDKAPIError_InvalidRoute_get_err(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_ChannelUnavailable_get_err")] public static extern string LDKAPIError_ChannelUnavailable_get_err(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAPIError_IncompatibleShutdownScript_get_script")] public static extern long LDKAPIError_IncompatibleShutdownScript_get_script(long ptr); - // void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_get_ok")] public static extern void CResult_NoneAPIErrorZ_get_ok(long _owner); - // struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_get_err")] public static extern long CResult_NoneAPIErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr")] public static extern long LDKCOption_ChannelShutdownStateZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some")] public static extern ChannelShutdownState LDKCOption_ChannelShutdownStateZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentHashZ_ty_from_ptr")] public static extern long LDKCOption_PaymentHashZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentHashZ_Some_get_some")] public static extern byte[] LDKCOption_PaymentHashZ_Some_get_some(long ptr); // struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832APIErrorZ_get_ok")] public static extern byte[] CResult__u832APIErrorZ_get_ok(long _owner); // struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832APIErrorZ_get_err")] public static extern long CResult__u832APIErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_ty_from_ptr")] public static extern long LDKRecentPaymentDetails_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_Pending_get_payment_hash")] public static extern byte[] LDKRecentPaymentDetails_Pending_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_Pending_get_total_msat")] public static extern long LDKRecentPaymentDetails_Pending_get_total_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_Fulfilled_get_payment_hash")] public static extern long LDKRecentPaymentDetails_Fulfilled_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_Abandoned_get_payment_hash")] public static extern byte[] LDKRecentPaymentDetails_Abandoned_get_payment_hash(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentSendFailure_ty_from_ptr")] public static extern long LDKPaymentSendFailure_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentSendFailure_ParameterError_get_parameter_error")] public static extern long LDKPaymentSendFailure_ParameterError_get_parameter_error(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error")] public static extern long[] LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(long ptr); @@ -647,10 +618,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentSendFailureZ_get_ok")] public static extern void CResult_NonePaymentSendFailureZ_get_ok(long _owner); // struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentSendFailureZ_get_err")] public static extern long CResult_NonePaymentSendFailureZ_get_err(long _owner); + // void CResult_NoneRetryableSendFailureZ_get_ok(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_get_ok")] public static extern void CResult_NoneRetryableSendFailureZ_get_ok(long _owner); + // enum LDKRetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_get_err")] public static extern RetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(long _owner); // struct LDKThirtyTwoBytes CResult_PaymentHashPaymentSendFailureZ_get_ok(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashPaymentSendFailureZ_get_ok")] public static extern byte[] CResult_PaymentHashPaymentSendFailureZ_get_ok(long _owner); // struct LDKPaymentSendFailure CResult_PaymentHashPaymentSendFailureZ_get_err(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashPaymentSendFailureZ_get_err")] public static extern long CResult_PaymentHashPaymentSendFailureZ_get_err(long _owner); + // struct LDKThirtyTwoBytes CResult_PaymentHashRetryableSendFailureZ_get_ok(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_get_ok")] public static extern byte[] CResult_PaymentHashRetryableSendFailureZ_get_ok(long _owner); + // enum LDKRetryableSendFailure CResult_PaymentHashRetryableSendFailureZ_get_err(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_get_err")] public static extern RetryableSendFailure CResult_PaymentHashRetryableSendFailureZ_get_err(long _owner); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentIdZ_get_a")] public static extern byte[] C2Tuple_PaymentHashPaymentIdZ_get_a(long _owner); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner); @@ -667,22 +646,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(long _owner); // void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err")] public static extern void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(long _owner); - // struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(long _owner); - // struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(long _owner); // struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretNoneZ_get_ok")] public static extern byte[] CResult_PaymentSecretNoneZ_get_ok(long _owner); // void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretNoneZ_get_err")] public static extern void CResult_PaymentSecretNoneZ_get_err(long _owner); - // struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_get_ok")] public static extern byte[] CResult_PaymentSecretAPIErrorZ_get_ok(long _owner); - // struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_get_err")] public static extern long CResult_PaymentSecretAPIErrorZ_get_err(long _owner); // struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPreimageAPIErrorZ_get_ok")] public static extern byte[] CResult_PaymentPreimageAPIErrorZ_get_ok(long _owner); // struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPreimageAPIErrorZ_get_err")] public static extern long CResult_PaymentPreimageAPIErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_ChainHashZZ_ty_from_ptr")] public static extern long LDKCOption_CVec_ChainHashZZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_ChainHashZZ_Some_get_some")] public static extern byte[][] LDKCOption_CVec_ChainHashZZ_Some_get_some(long ptr); // struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner); @@ -699,6 +672,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_get_ok")] public static extern long CResult_PhantomRouteHintsDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_get_err")] public static extern long CResult_PhantomRouteHintsDecodeErrorZ_get_err(long _owner); + // enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_ok")] public static extern ChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_get_err")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_get_err(long _owner); public interface LDKWatch { ChannelMonitorUpdateStatus watch_channel(long _funding_txo, long _monitor); ChannelMonitorUpdateStatus update_channel(long _funding_txo, long _update); @@ -707,58 +684,77 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKWatch_new")] public static extern long LDKWatch_new(LDKWatch impl); // LDKChannelMonitorUpdateStatus Watch_watch_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Watch_watch_channel")] public static extern ChannelMonitorUpdateStatus Watch_watch_channel(long _this_arg, long _funding_txo, long _monitor); - // LDKChannelMonitorUpdateStatus Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update + // LDKChannelMonitorUpdateStatus Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Watch_update_channel")] public static extern ChannelMonitorUpdateStatus Watch_update_channel(long _this_arg, long _funding_txo, long _update); // LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Watch_release_pending_monitor_events")] public static extern long[] Watch_release_pending_monitor_events(long _this_arg); public interface LDKBroadcasterInterface { - void broadcast_transaction(byte[] _tx); + void broadcast_transactions(byte[][] _txs); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBroadcasterInterface_new")] public static extern long LDKBroadcasterInterface_new(LDKBroadcasterInterface impl); - // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface *NONNULL_PTR this_arg, struct LDKTransaction tx - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BroadcasterInterface_broadcast_transaction")] public static extern void BroadcasterInterface_broadcast_transaction(long _this_arg, byte[] _tx); - public interface LDKKeysInterface { - long get_node_secret(Recipient _recipient); + // void BroadcasterInterface_broadcast_transactions LDKBroadcasterInterface *NONNULL_PTR this_arg, struct LDKCVec_TransactionZ txs + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BroadcasterInterface_broadcast_transactions")] public static extern void BroadcasterInterface_broadcast_transactions(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _txs); + public interface LDKEntropySource { + byte[] get_secure_random_bytes(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEntropySource_new")] public static extern long LDKEntropySource_new(LDKEntropySource impl); + // LDKThirtyTwoBytes EntropySource_get_secure_random_bytes LDKEntropySource *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EntropySource_get_secure_random_bytes")] public static extern byte[] EntropySource_get_secure_random_bytes(long _this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUnsignedGossipMessage_ty_from_ptr")] public static extern long LDKUnsignedGossipMessage_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUnsignedGossipMessage_ChannelAnnouncement_get_channel_announcement")] public static extern long LDKUnsignedGossipMessage_ChannelAnnouncement_get_channel_announcement(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUnsignedGossipMessage_ChannelUpdate_get_channel_update")] public static extern long LDKUnsignedGossipMessage_ChannelUpdate_get_channel_update(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKUnsignedGossipMessage_NodeAnnouncement_get_node_announcement")] public static extern long LDKUnsignedGossipMessage_NodeAnnouncement_get_node_announcement(long ptr); + public interface LDKNodeSigner { + byte[] get_inbound_payment_key_material(); long get_node_id(Recipient _recipient); long ecdh(Recipient _recipient, byte[] _other_key, long _tweak); - byte[] get_destination_script(); - long get_shutdown_scriptpubkey(); + long sign_invoice(byte[] _hrp_bytes, byte[] _invoice_data, Recipient _recipient); + long sign_gossip_message(long _msg); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNodeSigner_new")] public static extern long LDKNodeSigner_new(LDKNodeSigner impl); + // LDKThirtyTwoBytes NodeSigner_get_inbound_payment_key_material LDKNodeSigner *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_get_inbound_payment_key_material")] public static extern byte[] NodeSigner_get_inbound_payment_key_material(long _this_arg); + // LDKCResult_PublicKeyNoneZ NodeSigner_get_node_id LDKNodeSigner *NONNULL_PTR this_arg, enum LDKRecipient recipient + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_get_node_id")] public static extern long NodeSigner_get_node_id(long _this_arg, Recipient _recipient); + // LDKCResult_SharedSecretNoneZ NodeSigner_ecdh LDKNodeSigner *NONNULL_PTR this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_ecdh")] public static extern long NodeSigner_ecdh(long _this_arg, Recipient _recipient, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _other_key, long _tweak); + // LDKCResult_RecoverableSignatureNoneZ NodeSigner_sign_invoice LDKNodeSigner *NONNULL_PTR this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_sign_invoice")] public static extern long NodeSigner_sign_invoice(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _hrp_bytes, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _invoice_data, Recipient _recipient); + // LDKCResult_SignatureNoneZ NodeSigner_sign_gossip_message LDKNodeSigner *NONNULL_PTR this_arg, struct LDKUnsignedGossipMessage msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_sign_gossip_message")] public static extern long NodeSigner_sign_gossip_message(long _this_arg, long _msg); + public interface LDKSignerProvider { byte[] generate_channel_keys_id(bool _inbound, long _channel_value_satoshis, byte[] _user_channel_id); long derive_channel_signer(long _channel_value_satoshis, byte[] _channel_keys_id); - byte[] get_secure_random_bytes(); long read_chan_signer(byte[] _reader); - long sign_invoice(byte[] _hrp_bytes, byte[] _invoice_data, Recipient _receipient); - byte[] get_inbound_payment_key_material(); + long get_destination_script(); + long get_shutdown_scriptpubkey(); } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKKeysInterface_new")] public static extern long LDKKeysInterface_new(LDKKeysInterface impl); - // LDKCResult_SecretKeyNoneZ KeysInterface_get_node_secret LDKKeysInterface *NONNULL_PTR this_arg, enum LDKRecipient recipient - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_get_node_secret")] public static extern long KeysInterface_get_node_secret(long _this_arg, Recipient _recipient); - // LDKCResult_PublicKeyNoneZ KeysInterface_get_node_id LDKKeysInterface *NONNULL_PTR this_arg, enum LDKRecipient recipient - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_get_node_id")] public static extern long KeysInterface_get_node_id(long _this_arg, Recipient _recipient); - // LDKCResult_SharedSecretNoneZ KeysInterface_ecdh LDKKeysInterface *NONNULL_PTR this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_ecdh")] public static extern long KeysInterface_ecdh(long _this_arg, Recipient _recipient, byte[] _other_key, long _tweak); - // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_get_destination_script")] public static extern byte[] KeysInterface_get_destination_script(long _this_arg); - // LDKShutdownScript KeysInterface_get_shutdown_scriptpubkey LDKKeysInterface *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_get_shutdown_scriptpubkey")] public static extern long KeysInterface_get_shutdown_scriptpubkey(long _this_arg); - // LDKThirtyTwoBytes KeysInterface_generate_channel_keys_id LDKKeysInterface *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_generate_channel_keys_id")] public static extern byte[] KeysInterface_generate_channel_keys_id(long _this_arg, bool _inbound, long _channel_value_satoshis, byte[] _user_channel_id); - // LDKSign KeysInterface_derive_channel_signer LDKKeysInterface *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_derive_channel_signer")] public static extern long KeysInterface_derive_channel_signer(long _this_arg, long _channel_value_satoshis, byte[] _channel_keys_id); - // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_get_secure_random_bytes")] public static extern byte[] KeysInterface_get_secure_random_bytes(long _this_arg); - // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface *NONNULL_PTR this_arg, struct LDKu8slice reader - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_read_chan_signer")] public static extern long KeysInterface_read_chan_signer(long _this_arg, byte[] _reader); - // LDKCResult_RecoverableSignatureNoneZ KeysInterface_sign_invoice LDKKeysInterface *NONNULL_PTR this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient receipient - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_sign_invoice")] public static extern long KeysInterface_sign_invoice(long _this_arg, byte[] _hrp_bytes, byte[] _invoice_data, Recipient _receipient); - // LDKThirtyTwoBytes KeysInterface_get_inbound_payment_key_material LDKKeysInterface *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_get_inbound_payment_key_material")] public static extern byte[] KeysInterface_get_inbound_payment_key_material(long _this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignerProvider_new")] public static extern long LDKSignerProvider_new(LDKSignerProvider impl); + // LDKThirtyTwoBytes SignerProvider_generate_channel_keys_id LDKSignerProvider *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_generate_channel_keys_id")] public static extern byte[] SignerProvider_generate_channel_keys_id(long _this_arg, bool _inbound, long _channel_value_satoshis, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id); + // LDKWriteableEcdsaChannelSigner SignerProvider_derive_channel_signer LDKSignerProvider *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_derive_channel_signer")] public static extern long SignerProvider_derive_channel_signer(long _this_arg, long _channel_value_satoshis, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_keys_id); + // LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ SignerProvider_read_chan_signer LDKSignerProvider *NONNULL_PTR this_arg, struct LDKu8slice reader + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_read_chan_signer")] public static extern long SignerProvider_read_chan_signer(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _reader); + // LDKCResult_ScriptNoneZ SignerProvider_get_destination_script LDKSignerProvider *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_get_destination_script")] public static extern long SignerProvider_get_destination_script(long _this_arg); + // LDKCResult_ShutdownScriptNoneZ SignerProvider_get_shutdown_scriptpubkey LDKSignerProvider *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_get_shutdown_scriptpubkey")] public static extern long SignerProvider_get_shutdown_scriptpubkey(long _this_arg); public interface LDKFeeEstimator { int get_est_sat_per_1000_weight(ConfirmationTarget _confirmation_target); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFeeEstimator_new")] public static extern long LDKFeeEstimator_new(LDKFeeEstimator impl); // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator *NONNULL_PTR this_arg, enum LDKConfirmationTarget confirmation_target [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FeeEstimator_get_est_sat_per_1000_weight")] public static extern int FeeEstimator_get_est_sat_per_1000_weight(long _this_arg, ConfirmationTarget _confirmation_target); + public interface LDKRouter { + long find_route(byte[] _payer, long _route_params, long[] _first_hops, long _inflight_htlcs); + long find_route_with_id(byte[] _payer, long _route_params, long[] _first_hops, long _inflight_htlcs, byte[] __payment_hash, byte[] __payment_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRouter_new")] public static extern long LDKRouter_new(LDKRouter impl); + // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_find_route")] public static extern long Router_find_route(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payer, long _route_params, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _first_hops, long _inflight_htlcs); + // LDKCResult_RouteLightningErrorZ Router_find_route_with_id LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_find_route_with_id")] public static extern long Router_find_route_with_id(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payer, long _route_params, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _first_hops, long _inflight_htlcs, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] __payment_hash, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] __payment_id); // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelManagerZ_get_a")] public static extern byte[] C2Tuple_BlockHashChannelManagerZ_get_a(long _owner); // struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner); @@ -767,52 +763,25 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok")] public static extern long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err")] public static extern long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMaxDustHTLCExposure_ty_from_ptr")] public static extern long LDKMaxDustHTLCExposure_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMaxDustHTLCExposure_FixedLimitMsat_get_fixed_limit_msat")] public static extern long LDKMaxDustHTLCExposure_FixedLimitMsat_get_fixed_limit_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMaxDustHTLCExposure_FeeRateMultiplier_get_fee_rate_multiplier")] public static extern long LDKMaxDustHTLCExposure_FeeRateMultiplier_get_fee_rate_multiplier(long ptr); + // struct LDKMaxDustHTLCExposure CResult_MaxDustHTLCExposureDecodeErrorZ_get_ok(LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_get_ok")] public static extern long CResult_MaxDustHTLCExposureDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_MaxDustHTLCExposureDecodeErrorZ_get_err(LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_get_err")] public static extern long CResult_MaxDustHTLCExposureDecodeErrorZ_get_err(long _owner); // struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelConfigDecodeErrorZ_get_ok")] public static extern long CResult_ChannelConfigDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelConfigDecodeErrorZ_get_err")] public static extern long CResult_ChannelConfigDecodeErrorZ_get_err(long _owner); - // struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_get_ok")] public static extern long CResult_OutPointDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_get_err")] public static extern long CResult_OutPointDecodeErrorZ_get_err(long _owner); - public interface LDKType { - short type_id(); - string debug_str(); - byte[] write(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKType_new")] public static extern long LDKType_new(LDKType impl); - // uint16_t Type_type_id LDKType *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_type_id")] public static extern short Type_type_id(long _this_arg); - // LDKStr Type_debug_str LDKType *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_debug_str")] public static extern string Type_debug_str(long _this_arg); - // LDKCVec_u8Z Type_write LDKType *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_write")] public static extern byte[] Type_write(long _this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TypeZ_ty_from_ptr")] public static extern long LDKCOption_TypeZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TypeZ_Some_get_some")] public static extern long LDKCOption_TypeZ_Some_get_some(long ptr); - // struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_get_ok")] public static extern long CResult_COption_TypeZDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_get_err")] public static extern long CResult_COption_TypeZDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentError_ty_from_ptr")] public static extern long LDKPaymentError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentError_Invoice_get_invoice")] public static extern string LDKPaymentError_Invoice_get_invoice(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentError_Routing_get_routing")] public static extern long LDKPaymentError_Routing_get_routing(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentError_Sending_get_sending")] public static extern long LDKPaymentError_Sending_get_sending(long ptr); - // struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_get_ok")] public static extern byte[] CResult_PaymentIdPaymentErrorZ_get_ok(long _owner); - // struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_get_err")] public static extern long CResult_PaymentIdPaymentErrorZ_get_err(long _owner); - // void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_get_ok")] public static extern void CResult_NonePaymentErrorZ_get_ok(long _owner); - // struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_get_err")] public static extern long CResult_NonePaymentErrorZ_get_err(long _owner); - // struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_get_ok")] public static extern string CResult_StringErrorZ_get_ok(long _owner); - // enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_get_err")] public static extern Secp256k1Error CResult_StringErrorZ_get_err(long _owner); - // struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_get_ok")] public static extern byte[] CResult_PublicKeyErrorZ_get_ok(long _owner); - // enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_get_err")] public static extern Secp256k1Error CResult_PublicKeyErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_MaxDustHTLCExposureZ_ty_from_ptr")] public static extern long LDKCOption_MaxDustHTLCExposureZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_MaxDustHTLCExposureZ_Some_get_some")] public static extern long LDKCOption_MaxDustHTLCExposureZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_APIErrorZ_ty_from_ptr")] public static extern long LDKCOption_APIErrorZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_APIErrorZ_Some_get_some")] public static extern long LDKCOption_APIErrorZ_Some_get_some(long ptr); + // struct LDKCOption_APIErrorZ CResult_COption_APIErrorZDecodeErrorZ_get_ok(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_get_ok")] public static extern long CResult_COption_APIErrorZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_APIErrorZDecodeErrorZ_get_err(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_get_err")] public static extern long CResult_COption_APIErrorZDecodeErrorZ_get_err(long _owner); // struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok")] public static extern long CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner); @@ -848,24 +817,50 @@ internal class bindings { // struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b")] public static extern long[] C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ty_from_ptr")] public static extern long LDKBalance_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis")] public static extern long LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis")] public static extern long LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableOnChannelClose_get_amount_satoshis")] public static extern long LDKBalance_ClaimableOnChannelClose_get_amount_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis")] public static extern long LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height")] public static extern int LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis")] public static extern long LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_amount_satoshis")] public static extern long LDKBalance_ContentiousClaimable_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_timeout_height")] public static extern int LDKBalance_ContentiousClaimable_get_timeout_height(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis")] public static extern long LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_payment_hash")] public static extern byte[] LDKBalance_ContentiousClaimable_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_ContentiousClaimable_get_payment_preimage")] public static extern byte[] LDKBalance_ContentiousClaimable_get_payment_preimage(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_amount_satoshis")] public static extern long LDKBalance_MaybeTimeoutClaimableHTLC_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height")] public static extern int LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis")] public static extern long LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash")] public static extern byte[] LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_amount_satoshis")] public static extern long LDKBalance_MaybePreimageClaimableHTLC_get_amount_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height")] public static extern int LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis")] public static extern long LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_MaybePreimageClaimableHTLC_get_payment_hash")] public static extern byte[] LDKBalance_MaybePreimageClaimableHTLC_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBalance_CounterpartyRevokedOutputClaimable_get_amount_satoshis")] public static extern long LDKBalance_CounterpartyRevokedOutputClaimable_get_amount_satoshis(long ptr); + // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_get_a")] public static extern byte[] C2Tuple_BlockHashChannelMonitorZ_get_a(long _owner); + // struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_get_b")] public static extern long C2Tuple_BlockHashChannelMonitorZ_get_b(long _owner); // struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok")] public static extern long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err")] public static extern long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long _owner); + public interface LDKType { + short type_id(); + string debug_str(); + byte[] write(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKType_new")] public static extern long LDKType_new(LDKType impl); + // uint16_t Type_type_id LDKType *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_type_id")] public static extern short Type_type_id(long _this_arg); + // LDKStr Type_debug_str LDKType *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_debug_str")] public static extern string Type_debug_str(long _this_arg); + // LDKCVec_u8Z Type_write LDKType *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_write")] public static extern byte[] Type_write(long _this_arg); // struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_get_a")] public static extern byte[] C2Tuple_PublicKeyTypeZ_get_a(long _owner); // struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_get_b")] public static extern long C2Tuple_PublicKeyTypeZ_get_b(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_ty_from_ptr")] public static extern long LDKOffersMessage_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_InvoiceRequest_get_invoice_request")] public static extern long LDKOffersMessage_InvoiceRequest_get_invoice_request(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_Invoice_get_invoice")] public static extern long LDKOffersMessage_Invoice_get_invoice(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_InvoiceError_get_invoice_error")] public static extern long LDKOffersMessage_InvoiceError_get_invoice_error(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OffersMessageZ_ty_from_ptr")] public static extern long LDKCOption_OffersMessageZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_OffersMessageZ_Some_get_some")] public static extern long LDKCOption_OffersMessageZ_Some_get_some(long ptr); public interface LDKCustomOnionMessageContents { long tlv_type(); byte[] write(); @@ -881,8 +876,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok")] public static extern long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err")] public static extern long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TypeZ_ty_from_ptr")] public static extern long LDKCOption_TypeZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TypeZ_Some_get_some")] public static extern long LDKCOption_TypeZ_Some_get_some(long ptr); + // struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_get_ok")] public static extern long CResult_COption_TypeZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_get_err")] public static extern long CResult_COption_TypeZDecodeErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_NetAddressZ_ty_from_ptr")] public static extern long LDKCOption_NetAddressZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_NetAddressZ_Some_get_some")] public static extern long LDKCOption_NetAddressZ_Some_get_some(long ptr); + // struct LDKPublicKey C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_NetAddressZZ_get_a")] public static extern byte[] C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(long _owner); + // struct LDKCOption_NetAddressZ C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_NetAddressZZ_get_b")] public static extern long C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(long _owner); // struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_get_ok")] public static extern byte[] CResult_CVec_u8ZPeerHandleErrorZ_get_ok(long _owner); // struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); @@ -895,63 +900,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolPeerHandleErrorZ_get_ok")] public static extern bool CResult_boolPeerHandleErrorZ_get_ok(long _owner); // struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolPeerHandleErrorZ_get_err")] public static extern long CResult_boolPeerHandleErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSendError_ty_from_ptr")] public static extern long LDKSendError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSendError_Secp256k1_get_secp256k1")] public static extern Secp256k1Error LDKSendError_Secp256k1_get_secp256k1(long ptr); - // void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_get_ok")] public static extern void CResult_NoneSendErrorZ_get_ok(long _owner); - // struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_get_err")] public static extern long CResult_NoneSendErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseError_ty_from_ptr")] public static extern long LDKParseError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseError_Bech32Error_get_bech32_error")] public static extern long LDKParseError_Bech32Error_get_bech32_error(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseError_ParseAmountError_get_parse_amount_error")] public static extern int LDKParseError_ParseAmountError_get_parse_amount_error(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseError_MalformedSignature_get_malformed_signature")] public static extern Secp256k1Error LDKParseError_MalformedSignature_get_malformed_signature(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseError_DescriptionDecodeError_get_description_decode_error")] public static extern int LDKParseError_DescriptionDecodeError_get_description_decode_error(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseError_InvalidSliceLength_get_invalid_slice_length")] public static extern string LDKParseError_InvalidSliceLength_get_invalid_slice_length(long ptr); - // enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_get_ok")] public static extern SiPrefix CResult_SiPrefixParseErrorZ_get_ok(long _owner); - // struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_get_err")] public static extern long CResult_SiPrefixParseErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseOrSemanticError_ty_from_ptr")] public static extern long LDKParseOrSemanticError_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseOrSemanticError_ParseError_get_parse_error")] public static extern long LDKParseOrSemanticError_ParseError_get_parse_error(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseOrSemanticError_SemanticError_get_semantic_error")] public static extern SemanticError LDKParseOrSemanticError_SemanticError_get_semantic_error(long ptr); - // struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_get_ok")] public static extern long CResult_InvoiceParseOrSemanticErrorZ_get_ok(long _owner); - // struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_get_err")] public static extern long CResult_InvoiceParseOrSemanticErrorZ_get_err(long _owner); - // struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_get_ok")] public static extern long CResult_SignedRawInvoiceParseErrorZ_get_ok(long _owner); - // struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_get_err")] public static extern long CResult_SignedRawInvoiceParseErrorZ_get_err(long _owner); - // struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a")] public static extern long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(long _owner); - // struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b")] public static extern byte[] C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(long _owner); - // struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c")] public static extern long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(long _owner); - // struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_get_ok")] public static extern long CResult_PayeePubKeyErrorZ_get_ok(long _owner); - // enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_get_err")] public static extern Secp256k1Error CResult_PayeePubKeyErrorZ_get_err(long _owner); - // struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_get_ok")] public static extern long CResult_PositiveTimestampCreationErrorZ_get_ok(long _owner); - // enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_get_err")] public static extern CreationError CResult_PositiveTimestampCreationErrorZ_get_err(long _owner); - // void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_get_ok")] public static extern void CResult_NoneSemanticErrorZ_get_ok(long _owner); - // enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_get_err")] public static extern SemanticError CResult_NoneSemanticErrorZ_get_err(long _owner); - // struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_get_ok")] public static extern long CResult_InvoiceSemanticErrorZ_get_ok(long _owner); - // enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_get_err")] public static extern SemanticError CResult_InvoiceSemanticErrorZ_get_err(long _owner); - // struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_get_ok")] public static extern long CResult_DescriptionCreationErrorZ_get_ok(long _owner); - // enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_get_err")] public static extern CreationError CResult_DescriptionCreationErrorZ_get_err(long _owner); - // struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_get_ok")] public static extern long CResult_PrivateRouteCreationErrorZ_get_ok(long _owner); - // enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_get_err")] public static extern CreationError CResult_PrivateRouteCreationErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKGraphSyncError_ty_from_ptr")] public static extern long LDKGraphSyncError_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKGraphSyncError_DecodeError_get_decode_error")] public static extern long LDKGraphSyncError_DecodeError_get_decode_error(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKGraphSyncError_LightningError_get_lightning_error")] public static extern long LDKGraphSyncError_LightningError_get_lightning_error(long ptr); @@ -959,6 +907,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u32GraphSyncErrorZ_get_ok")] public static extern int CResult_u32GraphSyncErrorZ_get_ok(long _owner); // struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u32GraphSyncErrorZ_get_err")] public static extern long CResult_u32GraphSyncErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_KeyPairZ_ty_from_ptr")] public static extern long LDKCOption_KeyPairZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_KeyPairZ_Some_get_some")] public static extern byte[] LDKCOption_KeyPairZ_Some_get_some(long ptr); + // struct LDKCOption_KeyPairZ CResult_COption_KeyPairZNoneZ_get_ok(LDKCResult_COption_KeyPairZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_get_ok")] public static extern long CResult_COption_KeyPairZNoneZ_get_ok(long _owner); + // void CResult_COption_KeyPairZNoneZ_get_err(LDKCResult_COption_KeyPairZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_get_err")] public static extern void CResult_COption_KeyPairZNoneZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ScriptZ_ty_from_ptr")] public static extern long LDKCOption_ScriptZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ScriptZ_Some_get_some")] public static extern byte[] LDKCOption_ScriptZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_i64Z_ty_from_ptr")] public static extern long LDKCOption_i64Z_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_i64Z_Some_get_some")] public static extern long LDKCOption_i64Z_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TxidZ_ty_from_ptr")] public static extern long LDKCOption_TxidZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_TxidZ_Some_get_some")] public static extern byte[] LDKCOption_TxidZ_Some_get_some(long ptr); // struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetAddressDecodeErrorZ_get_ok")] public static extern long CResult_NetAddressDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner); @@ -967,6 +927,46 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelDecodeErrorZ_get_ok")] public static extern long CResult_AcceptChannelDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelDecodeErrorZ_get_err")] public static extern long CResult_AcceptChannelDecodeErrorZ_get_err(long _owner); + // struct LDKAcceptChannelV2 CResult_AcceptChannelV2DecodeErrorZ_get_ok(LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_get_ok")] public static extern long CResult_AcceptChannelV2DecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_AcceptChannelV2DecodeErrorZ_get_err(LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_get_err")] public static extern long CResult_AcceptChannelV2DecodeErrorZ_get_err(long _owner); + // struct LDKTxAddInput CResult_TxAddInputDecodeErrorZ_get_ok(LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_get_ok")] public static extern long CResult_TxAddInputDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxAddInputDecodeErrorZ_get_err(LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_get_err")] public static extern long CResult_TxAddInputDecodeErrorZ_get_err(long _owner); + // struct LDKTxAddOutput CResult_TxAddOutputDecodeErrorZ_get_ok(LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_get_ok")] public static extern long CResult_TxAddOutputDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxAddOutputDecodeErrorZ_get_err(LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_get_err")] public static extern long CResult_TxAddOutputDecodeErrorZ_get_err(long _owner); + // struct LDKTxRemoveInput CResult_TxRemoveInputDecodeErrorZ_get_ok(LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_get_ok")] public static extern long CResult_TxRemoveInputDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxRemoveInputDecodeErrorZ_get_err(LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_get_err")] public static extern long CResult_TxRemoveInputDecodeErrorZ_get_err(long _owner); + // struct LDKTxRemoveOutput CResult_TxRemoveOutputDecodeErrorZ_get_ok(LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_get_ok")] public static extern long CResult_TxRemoveOutputDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxRemoveOutputDecodeErrorZ_get_err(LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_get_err")] public static extern long CResult_TxRemoveOutputDecodeErrorZ_get_err(long _owner); + // struct LDKTxComplete CResult_TxCompleteDecodeErrorZ_get_ok(LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_get_ok")] public static extern long CResult_TxCompleteDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxCompleteDecodeErrorZ_get_err(LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_get_err")] public static extern long CResult_TxCompleteDecodeErrorZ_get_err(long _owner); + // struct LDKTxSignatures CResult_TxSignaturesDecodeErrorZ_get_ok(LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_get_ok")] public static extern long CResult_TxSignaturesDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxSignaturesDecodeErrorZ_get_err(LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_get_err")] public static extern long CResult_TxSignaturesDecodeErrorZ_get_err(long _owner); + // struct LDKTxInitRbf CResult_TxInitRbfDecodeErrorZ_get_ok(LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_get_ok")] public static extern long CResult_TxInitRbfDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxInitRbfDecodeErrorZ_get_err(LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_get_err")] public static extern long CResult_TxInitRbfDecodeErrorZ_get_err(long _owner); + // struct LDKTxAckRbf CResult_TxAckRbfDecodeErrorZ_get_ok(LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_get_ok")] public static extern long CResult_TxAckRbfDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxAckRbfDecodeErrorZ_get_err(LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_get_err")] public static extern long CResult_TxAckRbfDecodeErrorZ_get_err(long _owner); + // struct LDKTxAbort CResult_TxAbortDecodeErrorZ_get_ok(LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_get_ok")] public static extern long CResult_TxAbortDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxAbortDecodeErrorZ_get_err(LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_get_err")] public static extern long CResult_TxAbortDecodeErrorZ_get_err(long _owner); // struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok")] public static extern long CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); @@ -1007,6 +1007,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelDecodeErrorZ_get_ok")] public static extern long CResult_OpenChannelDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelDecodeErrorZ_get_err")] public static extern long CResult_OpenChannelDecodeErrorZ_get_err(long _owner); + // struct LDKOpenChannelV2 CResult_OpenChannelV2DecodeErrorZ_get_ok(LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_get_ok")] public static extern long CResult_OpenChannelV2DecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OpenChannelV2DecodeErrorZ_get_err(LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_get_err")] public static extern long CResult_OpenChannelV2DecodeErrorZ_get_err(long _owner); // struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevokeAndACKDecodeErrorZ_get_ok")] public static extern long CResult_RevokeAndACKDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner); @@ -1101,305 +1105,697 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_get_err")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignOrCreationError_ty_from_ptr")] public static extern long LDKSignOrCreationError_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignOrCreationError_CreationError_get_creation_error")] public static extern CreationError LDKSignOrCreationError_CreationError_get_creation_error(long ptr); - // struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_get_ok")] public static extern long CResult_InvoiceSignOrCreationErrorZ_get_ok(long _owner); - // struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_get_err")] public static extern long CResult_InvoiceSignOrCreationErrorZ_get_err(long _owner); - public interface LDKFilter { - void register_tx(byte[] _txid, byte[] _script_pubkey); - void register_output(long _output); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFilter_new")] public static extern long LDKFilter_new(LDKFilter impl); - // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Filter_register_tx")] public static extern void Filter_register_tx(long _this_arg, byte[] _txid, byte[] _script_pubkey); - // void Filter_register_output LDKFilter *NONNULL_PTR this_arg, struct LDKWatchedOutput output - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Filter_register_output")] public static extern void Filter_register_output(long _this_arg, long _output); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_FilterZ_ty_from_ptr")] public static extern long LDKCOption_FilterZ_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_FilterZ_Some_get_some")] public static extern long LDKCOption_FilterZ_Some_get_some(long ptr); - // struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok")] public static extern long CResult_LockedChannelMonitorNoneZ_get_ok(long _owner); - // void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err")] public static extern void CResult_LockedChannelMonitorNoneZ_get_err(long _owner); - // struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(long _owner); - // struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b")] public static extern long[] C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(long _owner); - public interface LDKMessageSendEventsProvider { - long[] get_and_clear_pending_msg_events(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEventsProvider_new")] public static extern long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl); - // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEventsProvider_get_and_clear_pending_msg_events")] public static extern long[] MessageSendEventsProvider_get_and_clear_pending_msg_events(long _this_arg); - public interface LDKOnionMessageProvider { - long next_onion_message_for_peer(byte[] _peer_node_id); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageProvider_new")] public static extern long LDKOnionMessageProvider_new(LDKOnionMessageProvider impl); - // LDKOnionMessage OnionMessageProvider_next_onion_message_for_peer LDKOnionMessageProvider *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageProvider_next_onion_message_for_peer")] public static extern long OnionMessageProvider_next_onion_message_for_peer(long _this_arg, byte[] _peer_node_id); - public interface LDKEventHandler { - void handle_event(long _event); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEventHandler_new")] public static extern long LDKEventHandler_new(LDKEventHandler impl); - // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventHandler_handle_event")] public static extern void EventHandler_handle_event(long _this_arg, long _event); - public interface LDKEventsProvider { - void process_pending_events(long _handler); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEventsProvider_new")] public static extern long LDKEventsProvider_new(LDKEventsProvider impl); - // void EventsProvider_process_pending_events LDKEventsProvider *NONNULL_PTR this_arg, struct LDKEventHandler handler - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventsProvider_process_pending_events")] public static extern void EventsProvider_process_pending_events(long _this_arg, long _handler); - public interface LDKPersister { - long persist_manager(long _channel_manager); - long persist_graph(long _network_graph); - long persist_scorer(long _scorer); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPersister_new")] public static extern long LDKPersister_new(LDKPersister impl); - // LDKCResult_NoneErrorZ Persister_persist_manager LDKPersister *NONNULL_PTR this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_persist_manager")] public static extern long Persister_persist_manager(long _this_arg, long _channel_manager); - // LDKCResult_NoneErrorZ Persister_persist_graph LDKPersister *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_persist_graph")] public static extern long Persister_persist_graph(long _this_arg, long _network_graph); - // LDKCResult_NoneErrorZ Persister_persist_scorer LDKPersister *NONNULL_PTR this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_persist_scorer")] public static extern long Persister_persist_scorer(long _this_arg, long _scorer); - public interface LDKFutureCallback { - void call(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFutureCallback_new")] public static extern long LDKFutureCallback_new(LDKFutureCallback impl); - // void FutureCallback_call LDKFutureCallback *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FutureCallback_call")] public static extern void FutureCallback_call(long _this_arg); - public interface LDKListen { - void filtered_block_connected(byte[] _header, long[] _txdata, int _height); - void block_connected(byte[] _block, int _height); - void block_disconnected(byte[] _header, int _height); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKListen_new")] public static extern long LDKListen_new(LDKListen impl); - // void Listen_filtered_block_connected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_filtered_block_connected")] public static extern void Listen_filtered_block_connected(long _this_arg, byte[] _header, long[] _txdata, int _height); - // void Listen_block_connected LDKListen *NONNULL_PTR this_arg, struct LDKu8slice block, uint32_t height - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_block_connected")] public static extern void Listen_block_connected(long _this_arg, byte[] _block, int _height); - // void Listen_block_disconnected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_block_disconnected")] public static extern void Listen_block_disconnected(long _this_arg, byte[] _header, int _height); - public interface LDKConfirm { - void transactions_confirmed(byte[] _header, long[] _txdata, int _height); - void transaction_unconfirmed(byte[] _txid); - void best_block_updated(byte[] _header, int _height); - long[] get_relevant_txids(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKConfirm_new")] public static extern long LDKConfirm_new(LDKConfirm impl); - // void Confirm_transactions_confirmed LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_transactions_confirmed")] public static extern void Confirm_transactions_confirmed(long _this_arg, byte[] _header, long[] _txdata, int _height); - // void Confirm_transaction_unconfirmed LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*txid)[32] - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_transaction_unconfirmed")] public static extern void Confirm_transaction_unconfirmed(long _this_arg, byte[] _txid); - // void Confirm_best_block_updated LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_best_block_updated")] public static extern void Confirm_best_block_updated(long _this_arg, byte[] _header, int _height); - // LDKCVec_C2Tuple_TxidBlockHashZZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_get_relevant_txids")] public static extern long[] Confirm_get_relevant_txids(long _this_arg); - public interface LDKPersist { - ChannelMonitorUpdateStatus persist_new_channel(long _channel_id, long _data, long _update_id); - ChannelMonitorUpdateStatus update_persisted_channel(long _channel_id, long _update, long _data, long _update_id); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPersist_new")] public static extern long LDKPersist_new(LDKPersist impl); - // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_persist_new_channel")] public static extern ChannelMonitorUpdateStatus Persist_persist_new_channel(long _this_arg, long _channel_id, long _data, long _update_id); - // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_update_persisted_channel")] public static extern ChannelMonitorUpdateStatus Persist_update_persisted_channel(long _this_arg, long _channel_id, long _update, long _data, long _update_id); - public interface LDKChannelMessageHandler { - void handle_open_channel(byte[] _their_node_id, long _their_features, long _msg); - void handle_accept_channel(byte[] _their_node_id, long _their_features, long _msg); - void handle_funding_created(byte[] _their_node_id, long _msg); - void handle_funding_signed(byte[] _their_node_id, long _msg); - void handle_channel_ready(byte[] _their_node_id, long _msg); - void handle_shutdown(byte[] _their_node_id, long _their_features, long _msg); - void handle_closing_signed(byte[] _their_node_id, long _msg); - void handle_update_add_htlc(byte[] _their_node_id, long _msg); - void handle_update_fulfill_htlc(byte[] _their_node_id, long _msg); - void handle_update_fail_htlc(byte[] _their_node_id, long _msg); - void handle_update_fail_malformed_htlc(byte[] _their_node_id, long _msg); - void handle_commitment_signed(byte[] _their_node_id, long _msg); - void handle_revoke_and_ack(byte[] _their_node_id, long _msg); - void handle_update_fee(byte[] _their_node_id, long _msg); - void handle_announcement_signatures(byte[] _their_node_id, long _msg); - void peer_disconnected(byte[] _their_node_id, bool _no_connection_possible); - long peer_connected(byte[] _their_node_id, long _msg); - void handle_channel_reestablish(byte[] _their_node_id, long _msg); - void handle_channel_update(byte[] _their_node_id, long _msg); - void handle_error(byte[] _their_node_id, long _msg); - long provided_node_features(); - long provided_init_features(byte[] _their_node_id); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKChannelMessageHandler_new")] public static extern long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKChannelMessageHandler_get_MessageSendEventsProvider")] public static extern long LDKChannelMessageHandler_get_MessageSendEventsProvider(long arg); - // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_open_channel")] public static extern void ChannelMessageHandler_handle_open_channel(long _this_arg, byte[] _their_node_id, long _their_features, long _msg); - // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_accept_channel")] public static extern void ChannelMessageHandler_handle_accept_channel(long _this_arg, byte[] _their_node_id, long _their_features, long _msg); - // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_funding_created")] public static extern void ChannelMessageHandler_handle_funding_created(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_funding_signed")] public static extern void ChannelMessageHandler_handle_funding_signed(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_channel_ready LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_channel_ready")] public static extern void ChannelMessageHandler_handle_channel_ready(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_shutdown")] public static extern void ChannelMessageHandler_handle_shutdown(long _this_arg, byte[] _their_node_id, long _their_features, long _msg); - // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_closing_signed")] public static extern void ChannelMessageHandler_handle_closing_signed(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_add_htlc")] public static extern void ChannelMessageHandler_handle_update_add_htlc(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fulfill_htlc")] public static extern void ChannelMessageHandler_handle_update_fulfill_htlc(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fail_htlc")] public static extern void ChannelMessageHandler_handle_update_fail_htlc(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fail_malformed_htlc")] public static extern void ChannelMessageHandler_handle_update_fail_malformed_htlc(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_commitment_signed")] public static extern void ChannelMessageHandler_handle_commitment_signed(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_revoke_and_ack")] public static extern void ChannelMessageHandler_handle_revoke_and_ack(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fee")] public static extern void ChannelMessageHandler_handle_update_fee(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_announcement_signatures")] public static extern void ChannelMessageHandler_handle_announcement_signatures(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_peer_disconnected")] public static extern void ChannelMessageHandler_peer_disconnected(long _this_arg, byte[] _their_node_id, bool _no_connection_possible); - // LDKCResult_NoneNoneZ ChannelMessageHandler_peer_connected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_peer_connected")] public static extern long ChannelMessageHandler_peer_connected(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_channel_reestablish")] public static extern void ChannelMessageHandler_handle_channel_reestablish(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_channel_update")] public static extern void ChannelMessageHandler_handle_channel_update(long _this_arg, byte[] _their_node_id, long _msg); - // void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_error")] public static extern void ChannelMessageHandler_handle_error(long _this_arg, byte[] _their_node_id, long _msg); - // LDKNodeFeatures ChannelMessageHandler_provided_node_features LDKChannelMessageHandler *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_provided_node_features")] public static extern long ChannelMessageHandler_provided_node_features(long _this_arg); - // LDKInitFeatures ChannelMessageHandler_provided_init_features LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_provided_init_features")] public static extern long ChannelMessageHandler_provided_init_features(long _this_arg, byte[] _their_node_id); - public interface LDKRoutingMessageHandler { - long handle_node_announcement(long _msg); - long handle_channel_announcement(long _msg); - long handle_channel_update(long _msg); - long get_next_channel_announcement(long _starting_point); - long get_next_node_announcement(byte[] _starting_point); - long peer_connected(byte[] _their_node_id, long _init); - long handle_reply_channel_range(byte[] _their_node_id, long _msg); - long handle_reply_short_channel_ids_end(byte[] _their_node_id, long _msg); - long handle_query_channel_range(byte[] _their_node_id, long _msg); - long handle_query_short_channel_ids(byte[] _their_node_id, long _msg); - long provided_node_features(); - long provided_init_features(byte[] _their_node_id); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRoutingMessageHandler_new")] public static extern long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRoutingMessageHandler_get_MessageSendEventsProvider")] public static extern long LDKRoutingMessageHandler_get_MessageSendEventsProvider(long arg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_node_announcement")] public static extern long RoutingMessageHandler_handle_node_announcement(long _this_arg, long _msg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_channel_announcement")] public static extern long RoutingMessageHandler_handle_channel_announcement(long _this_arg, long _msg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_channel_update")] public static extern long RoutingMessageHandler_handle_channel_update(long _this_arg, long _msg); - // LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, uint64_t starting_point - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_get_next_channel_announcement")] public static extern long RoutingMessageHandler_get_next_channel_announcement(long _this_arg, long _starting_point); - // LDKNodeAnnouncement RoutingMessageHandler_get_next_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey starting_point - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_get_next_node_announcement")] public static extern long RoutingMessageHandler_get_next_node_announcement(long _this_arg, byte[] _starting_point); - // LDKCResult_NoneNoneZ RoutingMessageHandler_peer_connected LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_peer_connected")] public static extern long RoutingMessageHandler_peer_connected(long _this_arg, byte[] _their_node_id, long _init); - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_reply_channel_range")] public static extern long RoutingMessageHandler_handle_reply_channel_range(long _this_arg, byte[] _their_node_id, long _msg); - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_reply_short_channel_ids_end")] public static extern long RoutingMessageHandler_handle_reply_short_channel_ids_end(long _this_arg, byte[] _their_node_id, long _msg); - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_query_channel_range")] public static extern long RoutingMessageHandler_handle_query_channel_range(long _this_arg, byte[] _their_node_id, long _msg); - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_query_short_channel_ids")] public static extern long RoutingMessageHandler_handle_query_short_channel_ids(long _this_arg, byte[] _their_node_id, long _msg); - // LDKNodeFeatures RoutingMessageHandler_provided_node_features LDKRoutingMessageHandler *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_provided_node_features")] public static extern long RoutingMessageHandler_provided_node_features(long _this_arg); - // LDKInitFeatures RoutingMessageHandler_provided_init_features LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_provided_init_features")] public static extern long RoutingMessageHandler_provided_init_features(long _this_arg, byte[] _their_node_id); - public interface LDKOnionMessageHandler { - void handle_onion_message(byte[] _peer_node_id, long _msg); - long peer_connected(byte[] _their_node_id, long _init); - void peer_disconnected(byte[] _their_node_id, bool _no_connection_possible); - long provided_node_features(); - long provided_init_features(byte[] _their_node_id); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageHandler_new")] public static extern long LDKOnionMessageHandler_new(LDKOnionMessageHandler impl, LDKOnionMessageProvider OnionMessageProvider); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageHandler_get_OnionMessageProvider")] public static extern long LDKOnionMessageHandler_get_OnionMessageProvider(long arg); - // void OnionMessageHandler_handle_onion_message LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_handle_onion_message")] public static extern void OnionMessageHandler_handle_onion_message(long _this_arg, byte[] _peer_node_id, long _msg); - // LDKCResult_NoneNoneZ OnionMessageHandler_peer_connected LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_peer_connected")] public static extern long OnionMessageHandler_peer_connected(long _this_arg, byte[] _their_node_id, long _init); - // void OnionMessageHandler_peer_disconnected LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_peer_disconnected")] public static extern void OnionMessageHandler_peer_disconnected(long _this_arg, byte[] _their_node_id, bool _no_connection_possible); - // LDKNodeFeatures OnionMessageHandler_provided_node_features LDKOnionMessageHandler *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_provided_node_features")] public static extern long OnionMessageHandler_provided_node_features(long _this_arg); - // LDKInitFeatures OnionMessageHandler_provided_init_features LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_provided_init_features")] public static extern long OnionMessageHandler_provided_init_features(long _this_arg, byte[] _their_node_id); - public interface LDKCustomMessageReader { - long read(short _message_type, byte[] _buffer); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomMessageReader_new")] public static extern long LDKCustomMessageReader_new(LDKCustomMessageReader impl); - // LDKCResult_COption_TypeZDecodeErrorZ CustomMessageReader_read LDKCustomMessageReader *NONNULL_PTR this_arg, uint16_t message_type, struct LDKu8slice buffer - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageReader_read")] public static extern long CustomMessageReader_read(long _this_arg, short _message_type, byte[] _buffer); - public interface LDKCustomMessageHandler { - long handle_custom_message(long _msg, byte[] _sender_node_id); - long[] get_and_clear_pending_msg(); + // struct LDKBolt11Invoice CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(long _owner); + // struct LDKSignOrCreationError CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(long _owner); + // struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_get_ok")] public static extern long CResult_OffersMessageDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OffersMessageDecodeErrorZ_get_err(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_get_err")] public static extern long CResult_OffersMessageDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCClaimZ_ty_from_ptr")] public static extern long LDKCOption_HTLCClaimZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCClaimZ_Some_get_some")] public static extern HTLCClaim LDKCOption_HTLCClaimZ_Some_get_some(long ptr); + // struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(long _owner); + // struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_get_ok")] public static extern long CResult_TxCreationKeysDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_get_err")] public static extern long CResult_TxCreationKeysDecodeErrorZ_get_err(long _owner); + // struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_get_ok")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_get_err")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_get_err(long _owner); + // struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(long _owner); + // struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(long _owner); + // struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_get_err")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_get_err(long _owner); + // struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(long _owner); + // struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(long _owner); + // struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_get_ok")] public static extern long CResult_TrustedClosingTransactionNoneZ_get_ok(long _owner); + // void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_get_err")] public static extern void CResult_TrustedClosingTransactionNoneZ_get_err(long _owner); + // struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_get_ok")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_get_err")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_get_err(long _owner); + // struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_get_ok")] public static extern long CResult_TrustedCommitmentTransactionNoneZ_get_ok(long _owner); + // void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_get_err")] public static extern void CResult_TrustedCommitmentTransactionNoneZ_get_err(long _owner); + // struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_get_ok")] public static extern byte[][] CResult_CVec_SignatureZNoneZ_get_ok(long _owner); + // void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_get_err")] public static extern void CResult_CVec_SignatureZNoneZ_get_err(long _owner); + // struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_get_ok")] public static extern long CResult_ShutdownScriptDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_get_err")] public static extern long CResult_ShutdownScriptDecodeErrorZ_get_err(long _owner); + // struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long _owner); + // struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_ty_from_ptr")] public static extern long LDKPaymentPurpose_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_preimage")] public static extern long LDKPaymentPurpose_InvoicePayment_get_payment_preimage(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_secret")] public static extern byte[] LDKPaymentPurpose_InvoicePayment_get_payment_secret(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment")] public static extern byte[] LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(long ptr); + // struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_get_ok")] public static extern long CResult_PaymentPurposeDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_get_err")] public static extern long CResult_PaymentPurposeDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPathFailure_ty_from_ptr")] public static extern long LDKPathFailure_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPathFailure_InitialSend_get_err")] public static extern long LDKPathFailure_InitialSend_get_err(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPathFailure_OnPath_get_network_update")] public static extern long LDKPathFailure_OnPath_get_network_update(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PathFailureZ_ty_from_ptr")] public static extern long LDKCOption_PathFailureZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PathFailureZ_Some_get_some")] public static extern long LDKCOption_PathFailureZ_Some_get_some(long ptr); + // struct LDKCOption_PathFailureZ CResult_COption_PathFailureZDecodeErrorZ_get_ok(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_get_ok")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_PathFailureZDecodeErrorZ_get_err(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_get_err")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ty_from_ptr")] public static extern long LDKClosureReason_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg")] public static extern long LDKClosureReason_CounterpartyForceClosed_get_peer_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ProcessingError_get_err")] public static extern string LDKClosureReason_ProcessingError_get_err(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ClosureReasonZ_ty_from_ptr")] public static extern long LDKCOption_ClosureReasonZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ClosureReasonZ_Some_get_some")] public static extern long LDKCOption_ClosureReasonZ_Some_get_some(long ptr); + // struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_get_err")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_ty_from_ptr")] public static extern long LDKHTLCDestination_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_NextHopChannel_get_node_id")] public static extern byte[] LDKHTLCDestination_NextHopChannel_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id")] public static extern byte[] LDKHTLCDestination_NextHopChannel_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid")] public static extern long LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_InvalidForward_get_requested_forward_scid")] public static extern long LDKHTLCDestination_InvalidForward_get_requested_forward_scid(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKHTLCDestination_FailedPayment_get_payment_hash")] public static extern byte[] LDKHTLCDestination_FailedPayment_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCDestinationZ_ty_from_ptr")] public static extern long LDKCOption_HTLCDestinationZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_HTLCDestinationZ_Some_get_some")] public static extern long LDKCOption_HTLCDestinationZ_Some_get_some(long ptr); + // struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(long _owner); + // enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_ok")] public static extern PaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_get_err")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u128Z_ty_from_ptr")] public static extern long LDKCOption_u128Z_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u128Z_Some_get_some")] public static extern byte[] LDKCOption_u128Z_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentIdZ_ty_from_ptr")] public static extern long LDKCOption_PaymentIdZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentIdZ_Some_get_some")] public static extern byte[] LDKCOption_PaymentIdZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentFailureReasonZ_ty_from_ptr")] public static extern long LDKCOption_PaymentFailureReasonZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentFailureReasonZ_Some_get_some")] public static extern PaymentFailureReason LDKCOption_PaymentFailureReasonZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ty_from_ptr")] public static extern long LDKBumpTransactionEvent_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_claim_id")] public static extern byte[] LDKBumpTransactionEvent_ChannelClose_get_claim_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_package_target_feerate_sat_per_1000_weight")] public static extern int LDKBumpTransactionEvent_ChannelClose_get_package_target_feerate_sat_per_1000_weight(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_commitment_tx")] public static extern byte[] LDKBumpTransactionEvent_ChannelClose_get_commitment_tx(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_commitment_tx_fee_satoshis")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_commitment_tx_fee_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_anchor_descriptor")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_anchor_descriptor(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs")] public static extern long[] LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_claim_id")] public static extern byte[] LDKBumpTransactionEvent_HTLCResolution_get_claim_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_target_feerate_sat_per_1000_weight")] public static extern int LDKBumpTransactionEvent_HTLCResolution_get_target_feerate_sat_per_1000_weight(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_htlc_descriptors")] public static extern long[] LDKBumpTransactionEvent_HTLCResolution_get_htlc_descriptors(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_tx_lock_time")] public static extern int LDKBumpTransactionEvent_HTLCResolution_get_tx_lock_time(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ty_from_ptr")] public static extern long LDKEvent_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id")] public static extern byte[] LDKEvent_FundingGenerationReady_get_temporary_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_counterparty_node_id")] public static extern byte[] LDKEvent_FundingGenerationReady_get_counterparty_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_channel_value_satoshis")] public static extern long LDKEvent_FundingGenerationReady_get_channel_value_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_output_script")] public static extern byte[] LDKEvent_FundingGenerationReady_get_output_script(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_FundingGenerationReady_get_user_channel_id")] public static extern byte[] LDKEvent_FundingGenerationReady_get_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_receiver_node_id")] public static extern byte[] LDKEvent_PaymentClaimable_get_receiver_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_payment_hash")] public static extern byte[] LDKEvent_PaymentClaimable_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_onion_fields")] public static extern long LDKEvent_PaymentClaimable_get_onion_fields(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_amount_msat")] public static extern long LDKEvent_PaymentClaimable_get_amount_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_counterparty_skimmed_fee_msat")] public static extern long LDKEvent_PaymentClaimable_get_counterparty_skimmed_fee_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_purpose")] public static extern long LDKEvent_PaymentClaimable_get_purpose(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_via_channel_id")] public static extern byte[] LDKEvent_PaymentClaimable_get_via_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_via_user_channel_id")] public static extern long LDKEvent_PaymentClaimable_get_via_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimable_get_claim_deadline")] public static extern long LDKEvent_PaymentClaimable_get_claim_deadline(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_receiver_node_id")] public static extern byte[] LDKEvent_PaymentClaimed_get_receiver_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_payment_hash")] public static extern byte[] LDKEvent_PaymentClaimed_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_amount_msat")] public static extern long LDKEvent_PaymentClaimed_get_amount_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentClaimed_get_purpose")] public static extern long LDKEvent_PaymentClaimed_get_purpose(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_id")] public static extern long LDKEvent_PaymentSent_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_preimage")] public static extern byte[] LDKEvent_PaymentSent_get_payment_preimage(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_payment_hash")] public static extern byte[] LDKEvent_PaymentSent_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentSent_get_fee_paid_msat")] public static extern long LDKEvent_PaymentSent_get_fee_paid_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentFailed_get_payment_id")] public static extern byte[] LDKEvent_PaymentFailed_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentFailed_get_payment_hash")] public static extern byte[] LDKEvent_PaymentFailed_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentFailed_get_reason")] public static extern long LDKEvent_PaymentFailed_get_reason(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathSuccessful_get_payment_id")] public static extern byte[] LDKEvent_PaymentPathSuccessful_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathSuccessful_get_payment_hash")] public static extern long LDKEvent_PaymentPathSuccessful_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathSuccessful_get_path")] public static extern long LDKEvent_PaymentPathSuccessful_get_path(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_payment_id")] public static extern long LDKEvent_PaymentPathFailed_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_payment_hash")] public static extern byte[] LDKEvent_PaymentPathFailed_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_payment_failed_permanently")] public static extern bool LDKEvent_PaymentPathFailed_get_payment_failed_permanently(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_failure")] public static extern long LDKEvent_PaymentPathFailed_get_failure(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_path")] public static extern long LDKEvent_PaymentPathFailed_get_path(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentPathFailed_get_short_channel_id")] public static extern long LDKEvent_PaymentPathFailed_get_short_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeSuccessful_get_payment_id")] public static extern byte[] LDKEvent_ProbeSuccessful_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeSuccessful_get_payment_hash")] public static extern byte[] LDKEvent_ProbeSuccessful_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeSuccessful_get_path")] public static extern long LDKEvent_ProbeSuccessful_get_path(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_payment_id")] public static extern byte[] LDKEvent_ProbeFailed_get_payment_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_payment_hash")] public static extern byte[] LDKEvent_ProbeFailed_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_path")] public static extern long LDKEvent_ProbeFailed_get_path(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ProbeFailed_get_short_channel_id")] public static extern long LDKEvent_ProbeFailed_get_short_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PendingHTLCsForwardable_get_time_forwardable")] public static extern long LDKEvent_PendingHTLCsForwardable_get_time_forwardable(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_intercept_id")] public static extern byte[] LDKEvent_HTLCIntercepted_get_intercept_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_requested_next_hop_scid")] public static extern long LDKEvent_HTLCIntercepted_get_requested_next_hop_scid(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_payment_hash")] public static extern byte[] LDKEvent_HTLCIntercepted_get_payment_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_inbound_amount_msat")] public static extern long LDKEvent_HTLCIntercepted_get_inbound_amount_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat")] public static extern long LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_SpendableOutputs_get_outputs")] public static extern long[] LDKEvent_SpendableOutputs_get_outputs(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_prev_channel_id")] public static extern byte[] LDKEvent_PaymentForwarded_get_prev_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_next_channel_id")] public static extern byte[] LDKEvent_PaymentForwarded_get_next_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_fee_earned_msat")] public static extern long LDKEvent_PaymentForwarded_get_fee_earned_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx")] public static extern bool LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat")] public static extern long LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_channel_id")] public static extern byte[] LDKEvent_ChannelPending_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_user_channel_id")] public static extern byte[] LDKEvent_ChannelPending_get_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_former_temporary_channel_id")] public static extern byte[] LDKEvent_ChannelPending_get_former_temporary_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_counterparty_node_id")] public static extern byte[] LDKEvent_ChannelPending_get_counterparty_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_funding_txo")] public static extern long LDKEvent_ChannelPending_get_funding_txo(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_channel_id")] public static extern byte[] LDKEvent_ChannelReady_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_user_channel_id")] public static extern byte[] LDKEvent_ChannelReady_get_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_counterparty_node_id")] public static extern byte[] LDKEvent_ChannelReady_get_counterparty_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_channel_type")] public static extern long LDKEvent_ChannelReady_get_channel_type(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_channel_id")] public static extern byte[] LDKEvent_ChannelClosed_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_user_channel_id")] public static extern byte[] LDKEvent_ChannelClosed_get_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelClosed_get_reason")] public static extern long LDKEvent_ChannelClosed_get_reason(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_DiscardFunding_get_channel_id")] public static extern byte[] LDKEvent_DiscardFunding_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_DiscardFunding_get_transaction")] public static extern byte[] LDKEvent_DiscardFunding_get_transaction(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id")] public static extern byte[] LDKEvent_OpenChannelRequest_get_temporary_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_counterparty_node_id")] public static extern byte[] LDKEvent_OpenChannelRequest_get_counterparty_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_funding_satoshis")] public static extern long LDKEvent_OpenChannelRequest_get_funding_satoshis(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_push_msat")] public static extern long LDKEvent_OpenChannelRequest_get_push_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_OpenChannelRequest_get_channel_type")] public static extern long LDKEvent_OpenChannelRequest_get_channel_type(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id")] public static extern byte[] LDKEvent_HTLCHandlingFailed_get_prev_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_HTLCHandlingFailed_get_failed_next_destination")] public static extern long LDKEvent_HTLCHandlingFailed_get_failed_next_destination(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_BumpTransaction_get_bump_transaction")] public static extern long LDKEvent_BumpTransaction_get_bump_transaction(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_EventZ_ty_from_ptr")] public static extern long LDKCOption_EventZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_EventZ_Some_get_some")] public static extern long LDKCOption_EventZ_Some_get_some(long ptr); + // struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_get_ok")] public static extern long CResult_COption_EventZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_get_err")] public static extern long CResult_COption_EventZDecodeErrorZ_get_err(long _owner); + // struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok")] public static extern long[] CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(long _owner); + // enum LDKIOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err")] public static extern IOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_ty_from_ptr")] public static extern long LDKBolt11ParseError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_Bech32Error_get_bech32_error")] public static extern long LDKBolt11ParseError_Bech32Error_get_bech32_error(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_ParseAmountError_get_parse_amount_error")] public static extern int LDKBolt11ParseError_ParseAmountError_get_parse_amount_error(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_MalformedSignature_get_malformed_signature")] public static extern Secp256k1Error LDKBolt11ParseError_MalformedSignature_get_malformed_signature(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_DescriptionDecodeError_get_description_decode_error")] public static extern int LDKBolt11ParseError_DescriptionDecodeError_get_description_decode_error(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBolt11ParseError_InvalidSliceLength_get_invalid_slice_length")] public static extern string LDKBolt11ParseError_InvalidSliceLength_get_invalid_slice_length(long ptr); + // enum LDKSiPrefix CResult_SiPrefixBolt11ParseErrorZ_get_ok(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_get_ok")] public static extern SiPrefix CResult_SiPrefixBolt11ParseErrorZ_get_ok(long _owner); + // struct LDKBolt11ParseError CResult_SiPrefixBolt11ParseErrorZ_get_err(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_get_err")] public static extern long CResult_SiPrefixBolt11ParseErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseOrSemanticError_ty_from_ptr")] public static extern long LDKParseOrSemanticError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseOrSemanticError_ParseError_get_parse_error")] public static extern long LDKParseOrSemanticError_ParseError_get_parse_error(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParseOrSemanticError_SemanticError_get_semantic_error")] public static extern Bolt11SemanticError LDKParseOrSemanticError_SemanticError_get_semantic_error(long ptr); + // struct LDKBolt11Invoice CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_ok")] public static extern long CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_ok(long _owner); + // struct LDKParseOrSemanticError CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_err")] public static extern long CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_err(long _owner); + // struct LDKSignedRawBolt11Invoice CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_ok(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_ok")] public static extern long CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_ok(long _owner); + // struct LDKBolt11ParseError CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err")] public static extern long CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(long _owner); + // struct LDKRawBolt11Invoice C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_a(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_a")] public static extern long C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_a(long _owner); + // struct LDKThirtyTwoBytes C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_b(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_b")] public static extern byte[] C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_b(long _owner); + // struct LDKBolt11InvoiceSignature C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_c(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_c")] public static extern long C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_c(long _owner); + // struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_get_ok")] public static extern long CResult_PayeePubKeyErrorZ_get_ok(long _owner); + // enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_get_err")] public static extern Secp256k1Error CResult_PayeePubKeyErrorZ_get_err(long _owner); + // struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_get_ok")] public static extern long CResult_PositiveTimestampCreationErrorZ_get_ok(long _owner); + // enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_get_err")] public static extern CreationError CResult_PositiveTimestampCreationErrorZ_get_err(long _owner); + // void CResult_NoneBolt11SemanticErrorZ_get_ok(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_get_ok")] public static extern void CResult_NoneBolt11SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt11SemanticError CResult_NoneBolt11SemanticErrorZ_get_err(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_get_err")] public static extern Bolt11SemanticError CResult_NoneBolt11SemanticErrorZ_get_err(long _owner); + // struct LDKBolt11Invoice CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_ok(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_ok")] public static extern long CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt11SemanticError CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_err(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_err")] public static extern Bolt11SemanticError CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_err(long _owner); + // struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_get_ok")] public static extern long CResult_DescriptionCreationErrorZ_get_ok(long _owner); + // enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_get_err")] public static extern CreationError CResult_DescriptionCreationErrorZ_get_err(long _owner); + // struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_get_ok")] public static extern long CResult_PrivateRouteCreationErrorZ_get_ok(long _owner); + // enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_get_err")] public static extern CreationError CResult_PrivateRouteCreationErrorZ_get_err(long _owner); + // struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_get_ok")] public static extern long CResult_OutPointDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_get_err")] public static extern long CResult_OutPointDecodeErrorZ_get_err(long _owner); + // struct LDKBigSize CResult_BigSizeDecodeErrorZ_get_ok(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_get_ok")] public static extern long CResult_BigSizeDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BigSizeDecodeErrorZ_get_err(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_get_err")] public static extern long CResult_BigSizeDecodeErrorZ_get_err(long _owner); + // struct LDKHostname CResult_HostnameDecodeErrorZ_get_ok(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_get_ok")] public static extern long CResult_HostnameDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_HostnameDecodeErrorZ_get_err(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_get_err")] public static extern long CResult_HostnameDecodeErrorZ_get_err(long _owner); + // struct LDKTransactionU16LenLimited CResult_TransactionU16LenLimitedNoneZ_get_ok(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_get_ok")] public static extern long CResult_TransactionU16LenLimitedNoneZ_get_ok(long _owner); + // void CResult_TransactionU16LenLimitedNoneZ_get_err(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_get_err")] public static extern void CResult_TransactionU16LenLimitedNoneZ_get_err(long _owner); + // struct LDKTransactionU16LenLimited CResult_TransactionU16LenLimitedDecodeErrorZ_get_ok(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_get_ok")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_get_err")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(long _owner); + // struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_ok")] public static extern long CResult_UntrustedStringDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err")] public static extern long CResult_UntrustedStringDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentError_ty_from_ptr")] public static extern long LDKPaymentError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentError_Invoice_get_invoice")] public static extern string LDKPaymentError_Invoice_get_invoice(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentError_Sending_get_sending")] public static extern RetryableSendFailure LDKPaymentError_Sending_get_sending(long ptr); + // struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_get_ok")] public static extern byte[] CResult_PaymentIdPaymentErrorZ_get_ok(long _owner); + // struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_get_err")] public static extern long CResult_PaymentIdPaymentErrorZ_get_err(long _owner); + // void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_get_ok")] public static extern void CResult_NonePaymentErrorZ_get_ok(long _owner); + // struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_get_err")] public static extern long CResult_NonePaymentErrorZ_get_err(long _owner); + // struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_get_ok")] public static extern string CResult_StringErrorZ_get_ok(long _owner); + // enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_get_err")] public static extern Secp256k1Error CResult_StringErrorZ_get_err(long _owner); + // struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_get_ok")] public static extern long CResult_OnionMessagePathNoneZ_get_ok(long _owner); + // void CResult_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_get_err")] public static extern void CResult_OnionMessagePathNoneZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSendError_ty_from_ptr")] public static extern long LDKSendError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSendError_Secp256k1_get_secp256k1")] public static extern Secp256k1Error LDKSendError_Secp256k1_get_secp256k1(long ptr); + // void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_get_ok")] public static extern void CResult_NoneSendErrorZ_get_ok(long _owner); + // struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_get_err")] public static extern long CResult_NoneSendErrorZ_get_err(long _owner); + // struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_get_ok")] public static extern long CResult_BlindedPathNoneZ_get_ok(long _owner); + // void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_get_err")] public static extern void CResult_BlindedPathNoneZ_get_err(long _owner); + // struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_get_ok")] public static extern long CResult_BlindedPathDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_get_err")] public static extern long CResult_BlindedPathDecodeErrorZ_get_err(long _owner); + // struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_get_ok")] public static extern long CResult_BlindedHopDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_get_err")] public static extern long CResult_BlindedHopDecodeErrorZ_get_err(long _owner); + // struct LDKInvoiceError CResult_InvoiceErrorDecodeErrorZ_get_ok(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_get_ok")] public static extern long CResult_InvoiceErrorDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_InvoiceErrorDecodeErrorZ_get_err(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_get_err")] public static extern long CResult_InvoiceErrorDecodeErrorZ_get_err(long _owner); + public interface LDKFilter { + void register_tx(byte[] _txid, byte[] _script_pubkey); + void register_output(long _output); } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomMessageHandler_new")] public static extern long LDKCustomMessageHandler_new(LDKCustomMessageHandler impl, LDKCustomMessageReader CustomMessageReader); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomMessageHandler_get_CustomMessageReader")] public static extern long LDKCustomMessageHandler_get_CustomMessageReader(long arg); - // LDKCResult_NoneLightningErrorZ CustomMessageHandler_handle_custom_message LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_handle_custom_message")] public static extern long CustomMessageHandler_handle_custom_message(long _this_arg, long _msg, byte[] _sender_node_id); - // LDKCVec_C2Tuple_PublicKeyTypeZZ CustomMessageHandler_get_and_clear_pending_msg LDKCustomMessageHandler *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_get_and_clear_pending_msg")] public static extern long[] CustomMessageHandler_get_and_clear_pending_msg(long _this_arg); - public interface LDKCustomOnionMessageHandler { - void handle_custom_message(long _msg); - long read_custom_message(long _message_type, byte[] _buffer); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFilter_new")] public static extern long LDKFilter_new(LDKFilter impl); + // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Filter_register_tx")] public static extern void Filter_register_tx(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _txid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _script_pubkey); + // void Filter_register_output LDKFilter *NONNULL_PTR this_arg, struct LDKWatchedOutput output + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Filter_register_output")] public static extern void Filter_register_output(long _this_arg, long _output); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_FilterZ_ty_from_ptr")] public static extern long LDKCOption_FilterZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_FilterZ_Some_get_some")] public static extern long LDKCOption_FilterZ_Some_get_some(long ptr); + // struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok")] public static extern long CResult_LockedChannelMonitorNoneZ_get_ok(long _owner); + // void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err")] public static extern void CResult_LockedChannelMonitorNoneZ_get_err(long _owner); + // struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(long _owner); + // struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b")] public static extern long[] C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(long _owner); + public interface LDKPersister { + long persist_manager(long _channel_manager); + long persist_graph(long _network_graph); + long persist_scorer(long _scorer); } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomOnionMessageHandler_new")] public static extern long LDKCustomOnionMessageHandler_new(LDKCustomOnionMessageHandler impl); - // void CustomOnionMessageHandler_handle_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, struct LDKCustomOnionMessageContents msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_handle_custom_message")] public static extern void CustomOnionMessageHandler_handle_custom_message(long _this_arg, long _msg); - // LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CustomOnionMessageHandler_read_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, uint64_t message_type, struct LDKu8slice buffer - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_read_custom_message")] public static extern long CustomOnionMessageHandler_read_custom_message(long _this_arg, long _message_type, byte[] _buffer); - public interface LDKSocketDescriptor { - long send_data(byte[] _data, bool _resume_read); - void disconnect_socket(); - bool eq(long _other_arg); - long hash(); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPersister_new")] public static extern long LDKPersister_new(LDKPersister impl); + // LDKCResult_NoneErrorZ Persister_persist_manager LDKPersister *NONNULL_PTR this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_persist_manager")] public static extern long Persister_persist_manager(long _this_arg, long _channel_manager); + // LDKCResult_NoneErrorZ Persister_persist_graph LDKPersister *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_persist_graph")] public static extern long Persister_persist_graph(long _this_arg, long _network_graph); + // LDKCResult_NoneErrorZ Persister_persist_scorer LDKPersister *NONNULL_PTR this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_persist_scorer")] public static extern long Persister_persist_scorer(long _this_arg, long _scorer); + public interface LDKFutureCallback { + void call(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFutureCallback_new")] public static extern long LDKFutureCallback_new(LDKFutureCallback impl); + // void FutureCallback_call LDKFutureCallback *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FutureCallback_call")] public static extern void FutureCallback_call(long _this_arg); + public interface LDKListen { + void filtered_block_connected(byte[] _header, long[] _txdata, int _height); + void block_connected(byte[] _block, int _height); + void block_disconnected(byte[] _header, int _height); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKListen_new")] public static extern long LDKListen_new(LDKListen impl); + // void Listen_filtered_block_connected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_filtered_block_connected")] public static extern void Listen_filtered_block_connected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _txdata, int _height); + // void Listen_block_connected LDKListen *NONNULL_PTR this_arg, struct LDKu8slice block, uint32_t height + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_block_connected")] public static extern void Listen_block_connected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _block, int _height); + // void Listen_block_disconnected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_block_disconnected")] public static extern void Listen_block_disconnected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, int _height); + public interface LDKConfirm { + void transactions_confirmed(byte[] _header, long[] _txdata, int _height); + void transaction_unconfirmed(byte[] _txid); + void best_block_updated(byte[] _header, int _height); + long[] get_relevant_txids(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKConfirm_new")] public static extern long LDKConfirm_new(LDKConfirm impl); + // void Confirm_transactions_confirmed LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_transactions_confirmed")] public static extern void Confirm_transactions_confirmed(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _txdata, int _height); + // void Confirm_transaction_unconfirmed LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*txid)[32] + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_transaction_unconfirmed")] public static extern void Confirm_transaction_unconfirmed(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _txid); + // void Confirm_best_block_updated LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_best_block_updated")] public static extern void Confirm_best_block_updated(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, int _height); + // LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_get_relevant_txids")] public static extern long[] Confirm_get_relevant_txids(long _this_arg); + public interface LDKPersist { + ChannelMonitorUpdateStatus persist_new_channel(long _channel_id, long _data, long _update_id); + ChannelMonitorUpdateStatus update_persisted_channel(long _channel_id, long _update, long _data, long _update_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPersist_new")] public static extern long LDKPersist_new(LDKPersist impl); + // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_persist_new_channel")] public static extern ChannelMonitorUpdateStatus Persist_persist_new_channel(long _this_arg, long _channel_id, long _data, long _update_id); + // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_update_persisted_channel")] public static extern ChannelMonitorUpdateStatus Persist_update_persisted_channel(long _this_arg, long _channel_id, long _update, long _data, long _update_id); + public interface LDKEventHandler { + void handle_event(long _event); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEventHandler_new")] public static extern long LDKEventHandler_new(LDKEventHandler impl); + // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventHandler_handle_event")] public static extern void EventHandler_handle_event(long _this_arg, long _event); + public interface LDKEventsProvider { + void process_pending_events(long _handler); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEventsProvider_new")] public static extern long LDKEventsProvider_new(LDKEventsProvider impl); + // void EventsProvider_process_pending_events LDKEventsProvider *NONNULL_PTR this_arg, struct LDKEventHandler handler + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventsProvider_process_pending_events")] public static extern void EventsProvider_process_pending_events(long _this_arg, long _handler); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_ty_from_ptr")] public static extern long LDKRetry_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_Attempts_get_attempts")] public static extern long LDKRetry_Attempts_get_attempts(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_Timeout_get_timeout")] public static extern long LDKRetry_Timeout_get_timeout(long ptr); + public interface LDKMessageSendEventsProvider { + long[] get_and_clear_pending_msg_events(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageSendEventsProvider_new")] public static extern long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl); + // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEventsProvider_get_and_clear_pending_msg_events")] public static extern long[] MessageSendEventsProvider_get_and_clear_pending_msg_events(long _this_arg); + public interface LDKChannelMessageHandler { + void handle_open_channel(byte[] _their_node_id, long _msg); + void handle_open_channel_v2(byte[] _their_node_id, long _msg); + void handle_accept_channel(byte[] _their_node_id, long _msg); + void handle_accept_channel_v2(byte[] _their_node_id, long _msg); + void handle_funding_created(byte[] _their_node_id, long _msg); + void handle_funding_signed(byte[] _their_node_id, long _msg); + void handle_channel_ready(byte[] _their_node_id, long _msg); + void handle_shutdown(byte[] _their_node_id, long _msg); + void handle_closing_signed(byte[] _their_node_id, long _msg); + void handle_tx_add_input(byte[] _their_node_id, long _msg); + void handle_tx_add_output(byte[] _their_node_id, long _msg); + void handle_tx_remove_input(byte[] _their_node_id, long _msg); + void handle_tx_remove_output(byte[] _their_node_id, long _msg); + void handle_tx_complete(byte[] _their_node_id, long _msg); + void handle_tx_signatures(byte[] _their_node_id, long _msg); + void handle_tx_init_rbf(byte[] _their_node_id, long _msg); + void handle_tx_ack_rbf(byte[] _their_node_id, long _msg); + void handle_tx_abort(byte[] _their_node_id, long _msg); + void handle_update_add_htlc(byte[] _their_node_id, long _msg); + void handle_update_fulfill_htlc(byte[] _their_node_id, long _msg); + void handle_update_fail_htlc(byte[] _their_node_id, long _msg); + void handle_update_fail_malformed_htlc(byte[] _their_node_id, long _msg); + void handle_commitment_signed(byte[] _their_node_id, long _msg); + void handle_revoke_and_ack(byte[] _their_node_id, long _msg); + void handle_update_fee(byte[] _their_node_id, long _msg); + void handle_announcement_signatures(byte[] _their_node_id, long _msg); + void peer_disconnected(byte[] _their_node_id); + long peer_connected(byte[] _their_node_id, long _msg, bool _inbound); + void handle_channel_reestablish(byte[] _their_node_id, long _msg); + void handle_channel_update(byte[] _their_node_id, long _msg); + void handle_error(byte[] _their_node_id, long _msg); + long provided_node_features(); + long provided_init_features(byte[] _their_node_id); + long get_genesis_hashes(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKChannelMessageHandler_new")] public static extern long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKChannelMessageHandler_get_MessageSendEventsProvider")] public static extern long LDKChannelMessageHandler_get_MessageSendEventsProvider(long arg); + // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_open_channel")] public static extern void ChannelMessageHandler_handle_open_channel(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_open_channel_v2 LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_open_channel_v2")] public static extern void ChannelMessageHandler_handle_open_channel_v2(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_accept_channel")] public static extern void ChannelMessageHandler_handle_accept_channel(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_accept_channel_v2 LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_accept_channel_v2")] public static extern void ChannelMessageHandler_handle_accept_channel_v2(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_funding_created")] public static extern void ChannelMessageHandler_handle_funding_created(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_funding_signed")] public static extern void ChannelMessageHandler_handle_funding_signed(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_channel_ready LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_channel_ready")] public static extern void ChannelMessageHandler_handle_channel_ready(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_shutdown")] public static extern void ChannelMessageHandler_handle_shutdown(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_closing_signed")] public static extern void ChannelMessageHandler_handle_closing_signed(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_add_input LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_add_input")] public static extern void ChannelMessageHandler_handle_tx_add_input(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_add_output LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_add_output")] public static extern void ChannelMessageHandler_handle_tx_add_output(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_remove_input LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_remove_input")] public static extern void ChannelMessageHandler_handle_tx_remove_input(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_remove_output LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_remove_output")] public static extern void ChannelMessageHandler_handle_tx_remove_output(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_complete LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_complete")] public static extern void ChannelMessageHandler_handle_tx_complete(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_signatures LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_signatures")] public static extern void ChannelMessageHandler_handle_tx_signatures(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_init_rbf LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_init_rbf")] public static extern void ChannelMessageHandler_handle_tx_init_rbf(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_ack_rbf LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_ack_rbf")] public static extern void ChannelMessageHandler_handle_tx_ack_rbf(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_tx_abort LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_abort")] public static extern void ChannelMessageHandler_handle_tx_abort(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_add_htlc")] public static extern void ChannelMessageHandler_handle_update_add_htlc(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fulfill_htlc")] public static extern void ChannelMessageHandler_handle_update_fulfill_htlc(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fail_htlc")] public static extern void ChannelMessageHandler_handle_update_fail_htlc(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fail_malformed_htlc")] public static extern void ChannelMessageHandler_handle_update_fail_malformed_htlc(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_commitment_signed")] public static extern void ChannelMessageHandler_handle_commitment_signed(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_revoke_and_ack")] public static extern void ChannelMessageHandler_handle_revoke_and_ack(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_update_fee")] public static extern void ChannelMessageHandler_handle_update_fee(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_announcement_signatures")] public static extern void ChannelMessageHandler_handle_announcement_signatures(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_peer_disconnected")] public static extern void ChannelMessageHandler_peer_disconnected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id); + // LDKCResult_NoneNoneZ ChannelMessageHandler_peer_connected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_peer_connected")] public static extern long ChannelMessageHandler_peer_connected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg, bool _inbound); + // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_channel_reestablish")] public static extern void ChannelMessageHandler_handle_channel_reestablish(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_channel_update")] public static extern void ChannelMessageHandler_handle_channel_update(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_error")] public static extern void ChannelMessageHandler_handle_error(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // LDKNodeFeatures ChannelMessageHandler_provided_node_features LDKChannelMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_provided_node_features")] public static extern long ChannelMessageHandler_provided_node_features(long _this_arg); + // LDKInitFeatures ChannelMessageHandler_provided_init_features LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_provided_init_features")] public static extern long ChannelMessageHandler_provided_init_features(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id); + // LDKCOption_CVec_ChainHashZZ ChannelMessageHandler_get_genesis_hashes LDKChannelMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_get_genesis_hashes")] public static extern long ChannelMessageHandler_get_genesis_hashes(long _this_arg); + public interface LDKRoutingMessageHandler { + long handle_node_announcement(long _msg); + long handle_channel_announcement(long _msg); + long handle_channel_update(long _msg); + long get_next_channel_announcement(long _starting_point); + long get_next_node_announcement(long _starting_point); + long peer_connected(byte[] _their_node_id, long _init, bool _inbound); + long handle_reply_channel_range(byte[] _their_node_id, long _msg); + long handle_reply_short_channel_ids_end(byte[] _their_node_id, long _msg); + long handle_query_channel_range(byte[] _their_node_id, long _msg); + long handle_query_short_channel_ids(byte[] _their_node_id, long _msg); + bool processing_queue_high(); + long provided_node_features(); + long provided_init_features(byte[] _their_node_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRoutingMessageHandler_new")] public static extern long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRoutingMessageHandler_get_MessageSendEventsProvider")] public static extern long LDKRoutingMessageHandler_get_MessageSendEventsProvider(long arg); + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_node_announcement")] public static extern long RoutingMessageHandler_handle_node_announcement(long _this_arg, long _msg); + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_channel_announcement")] public static extern long RoutingMessageHandler_handle_channel_announcement(long _this_arg, long _msg); + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_channel_update")] public static extern long RoutingMessageHandler_handle_channel_update(long _this_arg, long _msg); + // LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, uint64_t starting_point + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_get_next_channel_announcement")] public static extern long RoutingMessageHandler_get_next_channel_announcement(long _this_arg, long _starting_point); + // LDKNodeAnnouncement RoutingMessageHandler_get_next_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKNodeId starting_point + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_get_next_node_announcement")] public static extern long RoutingMessageHandler_get_next_node_announcement(long _this_arg, long _starting_point); + // LDKCResult_NoneNoneZ RoutingMessageHandler_peer_connected LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_peer_connected")] public static extern long RoutingMessageHandler_peer_connected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _init, bool _inbound); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_reply_channel_range")] public static extern long RoutingMessageHandler_handle_reply_channel_range(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_reply_short_channel_ids_end")] public static extern long RoutingMessageHandler_handle_reply_short_channel_ids_end(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_query_channel_range")] public static extern long RoutingMessageHandler_handle_query_channel_range(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_handle_query_short_channel_ids")] public static extern long RoutingMessageHandler_handle_query_short_channel_ids(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _msg); + // bool RoutingMessageHandler_processing_queue_high LDKRoutingMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_processing_queue_high")] public static extern bool RoutingMessageHandler_processing_queue_high(long _this_arg); + // LDKNodeFeatures RoutingMessageHandler_provided_node_features LDKRoutingMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_provided_node_features")] public static extern long RoutingMessageHandler_provided_node_features(long _this_arg); + // LDKInitFeatures RoutingMessageHandler_provided_init_features LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingMessageHandler_provided_init_features")] public static extern long RoutingMessageHandler_provided_init_features(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id); + public interface LDKOnionMessageProvider { + long next_onion_message_for_peer(byte[] _peer_node_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageProvider_new")] public static extern long LDKOnionMessageProvider_new(LDKOnionMessageProvider impl); + // LDKOnionMessage OnionMessageProvider_next_onion_message_for_peer LDKOnionMessageProvider *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageProvider_next_onion_message_for_peer")] public static extern long OnionMessageProvider_next_onion_message_for_peer(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _peer_node_id); + public interface LDKOnionMessageHandler { + void handle_onion_message(byte[] _peer_node_id, long _msg); + long peer_connected(byte[] _their_node_id, long _init, bool _inbound); + void peer_disconnected(byte[] _their_node_id); + long provided_node_features(); + long provided_init_features(byte[] _their_node_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageHandler_new")] public static extern long LDKOnionMessageHandler_new(LDKOnionMessageHandler impl, LDKOnionMessageProvider OnionMessageProvider); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageHandler_get_OnionMessageProvider")] public static extern long LDKOnionMessageHandler_get_OnionMessageProvider(long arg); + // void OnionMessageHandler_handle_onion_message LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_handle_onion_message")] public static extern void OnionMessageHandler_handle_onion_message(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _peer_node_id, long _msg); + // LDKCResult_NoneNoneZ OnionMessageHandler_peer_connected LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_peer_connected")] public static extern long OnionMessageHandler_peer_connected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _init, bool _inbound); + // void OnionMessageHandler_peer_disconnected LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_peer_disconnected")] public static extern void OnionMessageHandler_peer_disconnected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id); + // LDKNodeFeatures OnionMessageHandler_provided_node_features LDKOnionMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_provided_node_features")] public static extern long OnionMessageHandler_provided_node_features(long _this_arg); + // LDKInitFeatures OnionMessageHandler_provided_init_features LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageHandler_provided_init_features")] public static extern long OnionMessageHandler_provided_init_features(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id); + public interface LDKCustomMessageReader { + long read(short _message_type, byte[] _buffer); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomMessageReader_new")] public static extern long LDKCustomMessageReader_new(LDKCustomMessageReader impl); + // LDKCResult_COption_TypeZDecodeErrorZ CustomMessageReader_read LDKCustomMessageReader *NONNULL_PTR this_arg, uint16_t message_type, struct LDKu8slice buffer + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageReader_read")] public static extern long CustomMessageReader_read(long _this_arg, short _message_type, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _buffer); + public interface LDKCustomMessageHandler { + long handle_custom_message(long _msg, byte[] _sender_node_id); + long[] get_and_clear_pending_msg(); + long provided_node_features(); + long provided_init_features(byte[] _their_node_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomMessageHandler_new")] public static extern long LDKCustomMessageHandler_new(LDKCustomMessageHandler impl, LDKCustomMessageReader CustomMessageReader); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomMessageHandler_get_CustomMessageReader")] public static extern long LDKCustomMessageHandler_get_CustomMessageReader(long arg); + // LDKCResult_NoneLightningErrorZ CustomMessageHandler_handle_custom_message LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_handle_custom_message")] public static extern long CustomMessageHandler_handle_custom_message(long _this_arg, long _msg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _sender_node_id); + // LDKCVec_C2Tuple_PublicKeyTypeZZ CustomMessageHandler_get_and_clear_pending_msg LDKCustomMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_get_and_clear_pending_msg")] public static extern long[] CustomMessageHandler_get_and_clear_pending_msg(long _this_arg); + // LDKNodeFeatures CustomMessageHandler_provided_node_features LDKCustomMessageHandler *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_provided_node_features")] public static extern long CustomMessageHandler_provided_node_features(long _this_arg); + // LDKInitFeatures CustomMessageHandler_provided_init_features LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_provided_init_features")] public static extern long CustomMessageHandler_provided_init_features(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id); + public interface LDKOffersMessageHandler { + long handle_message(long _message); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessageHandler_new")] public static extern long LDKOffersMessageHandler_new(LDKOffersMessageHandler impl); + // LDKCOption_OffersMessageZ OffersMessageHandler_handle_message LDKOffersMessageHandler *NONNULL_PTR this_arg, struct LDKOffersMessage message + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageHandler_handle_message")] public static extern long OffersMessageHandler_handle_message(long _this_arg, long _message); + public interface LDKCustomOnionMessageHandler { + long handle_custom_message(long _msg); + long read_custom_message(long _message_type, byte[] _buffer); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCustomOnionMessageHandler_new")] public static extern long LDKCustomOnionMessageHandler_new(LDKCustomOnionMessageHandler impl); + // LDKCOption_CustomOnionMessageContentsZ CustomOnionMessageHandler_handle_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, struct LDKCustomOnionMessageContents msg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_handle_custom_message")] public static extern long CustomOnionMessageHandler_handle_custom_message(long _this_arg, long _msg); + // LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CustomOnionMessageHandler_read_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, uint64_t message_type, struct LDKu8slice buffer + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_read_custom_message")] public static extern long CustomOnionMessageHandler_read_custom_message(long _this_arg, long _message_type, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _buffer); + public interface LDKSocketDescriptor { + long send_data(byte[] _data, bool _resume_read); + void disconnect_socket(); + bool eq(long _other_arg); + long hash(); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSocketDescriptor_new")] public static extern long LDKSocketDescriptor_new(LDKSocketDescriptor impl); // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor *NONNULL_PTR this_arg, struct LDKu8slice data, bool resume_read - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_send_data")] public static extern long SocketDescriptor_send_data(long _this_arg, byte[] _data, bool _resume_read); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_send_data")] public static extern long SocketDescriptor_send_data(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _data, bool _resume_read); // void SocketDescriptor_disconnect_socket LDKSocketDescriptor *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_disconnect_socket")] public static extern void SocketDescriptor_disconnect_socket(long _this_arg); // uint64_t SocketDescriptor_hash LDKSocketDescriptor *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_hash")] public static extern long SocketDescriptor_hash(long _this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_ty_from_ptr")] public static extern long LDKEffectiveCapacity_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat")] public static extern long LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat")] public static extern long LDKEffectiveCapacity_MaximumHTLC_get_amount_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_AdvertisedMaxHTLC_get_amount_msat")] public static extern long LDKEffectiveCapacity_AdvertisedMaxHTLC_get_amount_msat(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_Total_get_capacity_msat")] public static extern long LDKEffectiveCapacity_Total_get_capacity_msat(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_Total_get_htlc_maximum_msat")] public static extern long LDKEffectiveCapacity_Total_get_htlc_maximum_msat(long ptr); - public interface LDKRouter { - long find_route(byte[] _payer, long _route_params, long[] _first_hops, long _inflight_htlcs); - long find_route_with_id(byte[] _payer, long _route_params, long[] _first_hops, long _inflight_htlcs, byte[] __payment_hash, byte[] __payment_id); - void notify_payment_path_failed(long[] _path, long _short_channel_id); - void notify_payment_path_successful(long[] _path); - void notify_payment_probe_successful(long[] _path); - void notify_payment_probe_failed(long[] _path, long _short_channel_id); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRouter_new")] public static extern long LDKRouter_new(LDKRouter impl); - // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_find_route")] public static extern long Router_find_route(long _this_arg, byte[] _payer, long _route_params, long[] _first_hops, long _inflight_htlcs); - // LDKCResult_RouteLightningErrorZ Router_find_route_with_id LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_find_route_with_id")] public static extern long Router_find_route_with_id(long _this_arg, byte[] _payer, long _route_params, long[] _first_hops, long _inflight_htlcs, byte[] __payment_hash, byte[] __payment_id); - // void Router_notify_payment_path_failed LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_notify_payment_path_failed")] public static extern void Router_notify_payment_path_failed(long _this_arg, long[] _path, long _short_channel_id); - // void Router_notify_payment_path_successful LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_notify_payment_path_successful")] public static extern void Router_notify_payment_path_successful(long _this_arg, long[] _path); - // void Router_notify_payment_probe_successful LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_notify_payment_probe_successful")] public static extern void Router_notify_payment_probe_successful(long _this_arg, long[] _path); - // void Router_notify_payment_probe_failed LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_notify_payment_probe_failed")] public static extern void Router_notify_payment_probe_failed(long _this_arg, long[] _path, long _short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_HintMaxHTLC_get_amount_msat")] public static extern long LDKEffectiveCapacity_HintMaxHTLC_get_amount_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayee_ty_from_ptr")] public static extern long LDKPayee_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayee_Blinded_get_route_hints")] public static extern long[] LDKPayee_Blinded_get_route_hints(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayee_Blinded_get_features")] public static extern long LDKPayee_Blinded_get_features(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayee_Clear_get_node_id")] public static extern byte[] LDKPayee_Clear_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayee_Clear_get_route_hints")] public static extern long[] LDKPayee_Clear_get_route_hints(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayee_Clear_get_features")] public static extern long LDKPayee_Clear_get_features(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayee_Clear_get_final_cltv_expiry_delta")] public static extern int LDKPayee_Clear_get_final_cltv_expiry_delta(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDestination_ty_from_ptr")] public static extern long LDKDestination_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDestination_Node_get_node")] public static extern byte[] LDKDestination_Node_get_node(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKDestination_BlindedPath_get_blinded_path")] public static extern long LDKDestination_BlindedPath_get_blinded_path(long ptr); + public interface LDKMessageRouter { + long find_path(byte[] _sender, byte[][] _peers, long _destination); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMessageRouter_new")] public static extern long LDKMessageRouter_new(LDKMessageRouter impl); + // LDKCResult_OnionMessagePathNoneZ MessageRouter_find_path LDKMessageRouter *NONNULL_PTR this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageRouter_find_path")] public static extern long MessageRouter_find_path(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _sender, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _peers, long _destination); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageContents_ty_from_ptr")] public static extern long LDKOnionMessageContents_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageContents_Offers_get_offers")] public static extern long LDKOnionMessageContents_Offers_get_offers(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOnionMessageContents_Custom_get_custom")] public static extern long LDKOnionMessageContents_Custom_get_custom(long ptr); + public interface LDKCoinSelectionSource { + long select_confirmed_utxos(byte[] _claim_id, long[] _must_spend, long[] _must_pay_to, int _target_feerate_sat_per_1000_weight); + long sign_tx(byte[] _tx); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCoinSelectionSource_new")] public static extern long LDKCoinSelectionSource_new(LDKCoinSelectionSource impl); + // LDKCResult_CoinSelectionNoneZ CoinSelectionSource_select_confirmed_utxos LDKCoinSelectionSource *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes claim_id, struct LDKCVec_InputZ must_spend, struct LDKCVec_TxOutZ must_pay_to, uint32_t target_feerate_sat_per_1000_weight + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelectionSource_select_confirmed_utxos")] public static extern long CoinSelectionSource_select_confirmed_utxos(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _claim_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _must_spend, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _must_pay_to, int _target_feerate_sat_per_1000_weight); + // LDKCResult_TransactionNoneZ CoinSelectionSource_sign_tx LDKCoinSelectionSource *NONNULL_PTR this_arg, struct LDKTransaction tx + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelectionSource_sign_tx")] public static extern long CoinSelectionSource_sign_tx(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _tx); + public interface LDKWalletSource { + long list_confirmed_utxos(); + long get_change_script(); + long sign_tx(byte[] _tx); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKWalletSource_new")] public static extern long LDKWalletSource_new(LDKWalletSource impl); + // LDKCResult_CVec_UtxoZNoneZ WalletSource_list_confirmed_utxos LDKWalletSource *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WalletSource_list_confirmed_utxos")] public static extern long WalletSource_list_confirmed_utxos(long _this_arg); + // LDKCResult_ScriptNoneZ WalletSource_get_change_script LDKWalletSource *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WalletSource_get_change_script")] public static extern long WalletSource_get_change_script(long _this_arg); + // LDKCResult_TransactionNoneZ WalletSource_sign_tx LDKWalletSource *NONNULL_PTR this_arg, struct LDKTransaction tx + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WalletSource_sign_tx")] public static extern long WalletSource_sign_tx(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _tx); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKGossipSync_ty_from_ptr")] public static extern long LDKGossipSync_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKGossipSync_P2P_get_p2p")] public static extern long LDKGossipSync_P2P_get_p2p(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKGossipSync_Rapid_get_rapid")] public static extern long LDKGossipSync_Rapid_get_rapid(long ptr); @@ -1408,43 +1804,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFallback_SegWitProgram_get_program")] public static extern byte[] LDKFallback_SegWitProgram_get_program(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFallback_PubKeyHash_get_pub_key_hash")] public static extern byte[] LDKFallback_PubKeyHash_get_pub_key_hash(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFallback_ScriptHash_get_script_hash")] public static extern byte[] LDKFallback_ScriptHash_get_script_hash(long ptr); - public interface LDKPayer { - byte[] node_id(); - long[] first_hops(); - long send_payment(long _route, byte[] _payment_hash, byte[] _payment_secret, byte[] _payment_id); - long send_spontaneous_payment(long _route, byte[] _payment_preimage, byte[] _payment_id); - long retry_payment(long _route, byte[] _payment_id); - void abandon_payment(byte[] _payment_id); - long inflight_htlcs(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPayer_new")] public static extern long LDKPayer_new(LDKPayer impl); - // LDKPublicKey Payer_node_id LDKPayer *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_node_id")] public static extern byte[] Payer_node_id(long _this_arg); - // LDKCVec_ChannelDetailsZ Payer_first_hops LDKPayer *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_first_hops")] public static extern long[] Payer_first_hops(long _this_arg); - // LDKCResult_NonePaymentSendFailureZ Payer_send_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_send_payment")] public static extern long Payer_send_payment(long _this_arg, long _route, byte[] _payment_hash, byte[] _payment_secret, byte[] _payment_id); - // LDKCResult_NonePaymentSendFailureZ Payer_send_spontaneous_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_send_spontaneous_payment")] public static extern long Payer_send_spontaneous_payment(long _this_arg, long _route, byte[] _payment_preimage, byte[] _payment_id); - // LDKCResult_NonePaymentSendFailureZ Payer_retry_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_retry_payment")] public static extern long Payer_retry_payment(long _this_arg, long _route, byte[] _payment_id); - // void Payer_abandon_payment LDKPayer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_abandon_payment")] public static extern void Payer_abandon_payment(long _this_arg, byte[] _payment_id); - // LDKInFlightHtlcs Payer_inflight_htlcs LDKPayer *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_inflight_htlcs")] public static extern long Payer_inflight_htlcs(long _this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_ty_from_ptr")] public static extern long LDKRetry_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_Attempts_get_attempts")] public static extern long LDKRetry_Attempts_get_attempts(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRetry_Timeout_get_timeout")] public static extern long LDKRetry_Timeout_get_timeout(long ptr); // struct LDKStr _ldk_get_compiled_version(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK__ldk_get_compiled_version")] public static extern string _ldk_get_compiled_version(); // struct LDKStr _ldk_c_bindings_get_compiled_version(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK__ldk_c_bindings_get_compiled_version")] public static extern string _ldk_c_bindings_get_compiled_version(); // struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_U128_le_bytes")] public static extern byte[] U128_le_bytes(byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_U128_le_bytes")] public static extern byte[] U128_le_bytes([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_U128_new")] public static extern byte[] U128_new(byte[] _le_bytes); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_U128_new")] public static extern byte[] U128_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _le_bytes); // struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigEndianScalar_new")] public static extern long BigEndianScalar_new(byte[] _big_endian_bytes); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigEndianScalar_new")] public static extern long BigEndianScalar_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _big_endian_bytes); // uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bech32Error_clone_ptr")] public static extern long Bech32Error_clone_ptr(long _arg); // struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig); @@ -1452,11 +1821,15 @@ internal class bindings { // void Bech32Error_free(struct LDKBech32Error o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bech32Error_free")] public static extern void Bech32Error_free(long _o); // void Transaction_free(struct LDKTransaction _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Transaction_free")] public static extern void Transaction_free(byte[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Transaction_free")] public static extern void Transaction_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] __res); // void Witness_free(struct LDKWitness _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Witness_free")] public static extern void Witness_free(byte[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Witness_free")] public static extern void Witness_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] __res); + // void TxIn_free(struct LDKTxIn _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxIn_free")] public static extern void TxIn_free(long __res); + // struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxIn_new")] public static extern long TxIn_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _witness, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _script_sig, int _sequence, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _previous_txid, int _previous_vout); // struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxOut_new")] public static extern long TxOut_new(byte[] _script_pubkey, long _value); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxOut_new")] public static extern long TxOut_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _script_pubkey, long _value); // void TxOut_free(struct LDKTxOut _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxOut_free")] public static extern void TxOut_free(long __res); // uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg); @@ -1465,274 +1838,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxOut_clone")] public static extern long TxOut_clone(long _orig); // void Str_free(struct LDKStr _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Str_free")] public static extern void Str_free(string __res); - // struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCClaimZ_some")] public static extern long COption_HTLCClaimZ_some(HTLCClaim _o); - // struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCClaimZ_none")] public static extern long COption_HTLCClaimZ_none(); - // void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCClaimZ_free")] public static extern void COption_HTLCClaimZ_free(long __res); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_ok")] public static extern long CResult_NoneNoneZ_ok(); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_err")] public static extern long CResult_NoneNoneZ_err(); - // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_is_ok")] public static extern bool CResult_NoneNoneZ_is_ok(long _o); - // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_free")] public static extern void CResult_NoneNoneZ_free(long __res); - // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone_ptr")] public static extern long CResult_NoneNoneZ_clone_ptr(long _arg); - // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone")] public static extern long CResult_NoneNoneZ_clone(long _orig); - // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(long _o); - // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(long _e); - // bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok")] public static extern bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(long _o); - // void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free")] public static extern void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(long __res); - // uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(long _orig); - // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_ok")] public static extern long CResult_TxCreationKeysDecodeErrorZ_ok(long _o); - // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_err")] public static extern long CResult_TxCreationKeysDecodeErrorZ_err(long _e); - // bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_is_ok")] public static extern bool CResult_TxCreationKeysDecodeErrorZ_is_ok(long _o); - // void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_free")] public static extern void CResult_TxCreationKeysDecodeErrorZ_free(long __res); - // uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone_ptr")] public static extern long CResult_TxCreationKeysDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone")] public static extern long CResult_TxCreationKeysDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_ok")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_err")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_err(long _e); - // bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_free")] public static extern void CResult_ChannelPublicKeysDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_clone(long _orig); - // struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_some")] public static extern long COption_u32Z_some(int _o); - // struct LDKCOption_u32Z COption_u32Z_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_none")] public static extern long COption_u32Z_none(); - // void COption_u32Z_free(struct LDKCOption_u32Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_free")] public static extern void COption_u32Z_free(long __res); - // uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_clone_ptr")] public static extern long COption_u32Z_clone_ptr(long _arg); - // struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_clone")] public static extern long COption_u32Z_clone(long _orig); - // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(long _o); - // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_err")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_err(long _e); - // bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok")] public static extern bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(long _o); - // void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_free")] public static extern void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(long __res); - // uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(long _orig); - // enum LDKCOption_NoneZ COption_NoneZ_some(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_some")] public static extern COption_NoneZ COption_NoneZ_some(); - // enum LDKCOption_NoneZ COption_NoneZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_none")] public static extern COption_NoneZ COption_NoneZ_none(); - // void COption_NoneZ_free(enum LDKCOption_NoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_free")] public static extern void COption_NoneZ_free(COption_NoneZ __res); - // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(long _o); - // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(long _e); - // bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok")] public static extern bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(long _o); - // void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free")] public static extern void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(long __res); - // uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_ok")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_err")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_err(long _e); - // bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_free")] public static extern void CResult_ChannelTransactionParametersDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_clone(long _orig); - // void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_SignatureZ_free")] public static extern void CVec_SignatureZ_free(byte[][] __res); - // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_ok")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_ok(long _o); - // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_err")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_err(long _e); - // bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok")] public static extern bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(long _o); - // void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_free")] public static extern void CResult_HolderCommitmentTransactionDecodeErrorZ_free(long __res); - // uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_clone(long _orig); - // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(long _o); - // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_err")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_err(long _e); - // bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok")] public static extern bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(long _o); - // void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_free")] public static extern void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(long __res); - // uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(long _orig); - // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_ok")] public static extern long CResult_TrustedClosingTransactionNoneZ_ok(long _o); - // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_err")] public static extern long CResult_TrustedClosingTransactionNoneZ_err(); - // bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_is_ok")] public static extern bool CResult_TrustedClosingTransactionNoneZ_is_ok(long _o); - // void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_free")] public static extern void CResult_TrustedClosingTransactionNoneZ_free(long __res); - // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_ok")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_ok(long _o); - // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_err")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_err(long _e); - // bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_is_ok")] public static extern bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(long _o); - // void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_free")] public static extern void CResult_CommitmentTransactionDecodeErrorZ_free(long __res); - // uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_clone(long _orig); - // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_ok")] public static extern long CResult_TrustedCommitmentTransactionNoneZ_ok(long _o); - // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_err")] public static extern long CResult_TrustedCommitmentTransactionNoneZ_err(); - // bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_is_ok")] public static extern bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(long _o); - // void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_free")] public static extern void CResult_TrustedCommitmentTransactionNoneZ_free(long __res); - // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_ok")] public static extern long CResult_CVec_SignatureZNoneZ_ok(byte[][] _o); - // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_err")] public static extern long CResult_CVec_SignatureZNoneZ_err(); - // bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_is_ok")] public static extern bool CResult_CVec_SignatureZNoneZ_is_ok(long _o); - // void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_free")] public static extern void CResult_CVec_SignatureZNoneZ_free(long __res); - // uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_clone_ptr")] public static extern long CResult_CVec_SignatureZNoneZ_clone_ptr(long _arg); - // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_clone")] public static extern long CResult_CVec_SignatureZNoneZ_clone(long _orig); - // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_ok")] public static extern long CResult_ShutdownScriptDecodeErrorZ_ok(long _o); - // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_err")] public static extern long CResult_ShutdownScriptDecodeErrorZ_err(long _e); - // bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_is_ok")] public static extern bool CResult_ShutdownScriptDecodeErrorZ_is_ok(long _o); - // void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_free")] public static extern void CResult_ShutdownScriptDecodeErrorZ_free(long __res); - // uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone_ptr")] public static extern long CResult_ShutdownScriptDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone")] public static extern long CResult_ShutdownScriptDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_ok")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_ok(long _o); - // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_err")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_err(long _e); - // bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok")] public static extern bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(long _o); - // void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_free")] public static extern void CResult_ShutdownScriptInvalidShutdownScriptZ_free(long __res); - // uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(long _arg); - // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_clone(long _orig); - // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PublicKeyZ_free")] public static extern void CVec_PublicKeyZ_free(byte[][] __res); - // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_ok")] public static extern long CResult_BlindedPathNoneZ_ok(long _o); - // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_err")] public static extern long CResult_BlindedPathNoneZ_err(); - // bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_is_ok")] public static extern bool CResult_BlindedPathNoneZ_is_ok(long _o); - // void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_free")] public static extern void CResult_BlindedPathNoneZ_free(long __res); - // uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_clone_ptr")] public static extern long CResult_BlindedPathNoneZ_clone_ptr(long _arg); - // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_clone")] public static extern long CResult_BlindedPathNoneZ_clone(long _orig); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_ok")] public static extern long CResult_BlindedPathDecodeErrorZ_ok(long _o); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_err")] public static extern long CResult_BlindedPathDecodeErrorZ_err(long _e); - // bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedPathDecodeErrorZ_is_ok(long _o); - // void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_free")] public static extern void CResult_BlindedPathDecodeErrorZ_free(long __res); - // uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedPathDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_clone")] public static extern long CResult_BlindedPathDecodeErrorZ_clone(long _orig); - // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_ok")] public static extern long CResult_BlindedHopDecodeErrorZ_ok(long _o); - // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_err")] public static extern long CResult_BlindedHopDecodeErrorZ_err(long _e); - // bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedHopDecodeErrorZ_is_ok(long _o); - // void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_free")] public static extern void CResult_BlindedHopDecodeErrorZ_free(long __res); - // uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedHopDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_clone")] public static extern long CResult_BlindedHopDecodeErrorZ_clone(long _orig); - // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_WriteableScoreZ_some")] public static extern long COption_WriteableScoreZ_some(long _o); - // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_WriteableScoreZ_none")] public static extern long COption_WriteableScoreZ_none(); - // void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_WriteableScoreZ_free")] public static extern void COption_WriteableScoreZ_free(long __res); - // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_ok")] public static extern long CResult_NoneErrorZ_ok(); - // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_err")] public static extern long CResult_NoneErrorZ_err(IOError _e); - // bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_is_ok")] public static extern bool CResult_NoneErrorZ_is_ok(long _o); - // void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_free")] public static extern void CResult_NoneErrorZ_free(long __res); - // uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_clone_ptr")] public static extern long CResult_NoneErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_clone")] public static extern long CResult_NoneErrorZ_clone(long _orig); - // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChannelDetailsZ_free")] public static extern void CVec_ChannelDetailsZ_free(long[] __res); - // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_ok")] public static extern long CResult_RouteLightningErrorZ_ok(long _o); - // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_err")] public static extern long CResult_RouteLightningErrorZ_err(long _e); - // bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_is_ok")] public static extern bool CResult_RouteLightningErrorZ_is_ok(long _o); - // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_free")] public static extern void CResult_RouteLightningErrorZ_free(long __res); - // uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_clone_ptr")] public static extern long CResult_RouteLightningErrorZ_clone_ptr(long _arg); - // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_clone")] public static extern long CResult_RouteLightningErrorZ_clone(long _orig); - // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHopZ_free")] public static extern void CVec_RouteHopZ_free(long[] __res); + // struct LDKCOption_DurationZ COption_DurationZ_some(uint64_t o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_DurationZ_some")] public static extern long COption_DurationZ_some(long _o); + // struct LDKCOption_DurationZ COption_DurationZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_DurationZ_none")] public static extern long COption_DurationZ_none(); + // void COption_DurationZ_free(struct LDKCOption_DurationZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_DurationZ_free")] public static extern void COption_DurationZ_free(long __res); + // uint64_t COption_DurationZ_clone_ptr(LDKCOption_DurationZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_DurationZ_clone_ptr")] public static extern long COption_DurationZ_clone_ptr(long _arg); + // struct LDKCOption_DurationZ COption_DurationZ_clone(const struct LDKCOption_DurationZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_DurationZ_clone")] public static extern long COption_DurationZ_clone(long _orig); + // void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_BlindedPathZ_free")] public static extern void CVec_BlindedPathZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u64Z_some")] public static extern long COption_u64Z_some(long _o); // struct LDKCOption_u64Z COption_u64Z_none(void); @@ -1743,576 +1860,172 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u64Z_clone_ptr")] public static extern long COption_u64Z_clone_ptr(long _arg); // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u64Z_clone")] public static extern long COption_u64Z_clone(long _orig); - // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_ok")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_ok(long _o); - // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_err")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_err(long _e); - // bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_is_ok")] public static extern bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(long _o); - // void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_free")] public static extern void CResult_InFlightHtlcsDecodeErrorZ_free(long __res); - // uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_clone_ptr")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_clone")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_clone(long _orig); - // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_ok")] public static extern long CResult_RouteHopDecodeErrorZ_ok(long _o); - // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_err")] public static extern long CResult_RouteHopDecodeErrorZ_err(long _e); - // bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_is_ok")] public static extern bool CResult_RouteHopDecodeErrorZ_is_ok(long _o); - // void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_free")] public static extern void CResult_RouteHopDecodeErrorZ_free(long __res); - // uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteHopDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_clone")] public static extern long CResult_RouteHopDecodeErrorZ_clone(long _orig); - // void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_CVec_RouteHopZZ_free")] public static extern void CVec_CVec_RouteHopZZ_free(long[][] __res); - // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_ok")] public static extern long CResult_RouteDecodeErrorZ_ok(long _o); - // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_err")] public static extern long CResult_RouteDecodeErrorZ_err(long _e); - // bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_is_ok")] public static extern bool CResult_RouteDecodeErrorZ_is_ok(long _o); - // void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_free")] public static extern void CResult_RouteDecodeErrorZ_free(long __res); - // uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_clone")] public static extern long CResult_RouteDecodeErrorZ_clone(long _orig); - // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_ok")] public static extern long CResult_RouteParametersDecodeErrorZ_ok(long _o); - // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_err")] public static extern long CResult_RouteParametersDecodeErrorZ_err(long _e); - // bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_is_ok")] public static extern bool CResult_RouteParametersDecodeErrorZ_is_ok(long _o); - // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_free")] public static extern void CResult_RouteParametersDecodeErrorZ_free(long __res); - // uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteParametersDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_clone")] public static extern long CResult_RouteParametersDecodeErrorZ_clone(long _orig); - // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHintZ_free")] public static extern void CVec_RouteHintZ_free(long[] __res); - // void CVec_u64Z_free(struct LDKCVec_u64Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_u64Z_free")] public static extern void CVec_u64Z_free(long[] __res); - // struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_ok")] public static extern long CResult_PaymentParametersDecodeErrorZ_ok(long _o); - // struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_err")] public static extern long CResult_PaymentParametersDecodeErrorZ_err(long _e); - // bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_is_ok")] public static extern bool CResult_PaymentParametersDecodeErrorZ_is_ok(long _o); - // void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_free")] public static extern void CResult_PaymentParametersDecodeErrorZ_free(long __res); - // uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentParametersDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_clone")] public static extern long CResult_PaymentParametersDecodeErrorZ_clone(long _orig); - // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHintHopZ_free")] public static extern void CVec_RouteHintHopZ_free(long[] __res); - // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_ok")] public static extern long CResult_RouteHintDecodeErrorZ_ok(long _o); - // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_err")] public static extern long CResult_RouteHintDecodeErrorZ_err(long _e); - // bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_is_ok")] public static extern bool CResult_RouteHintDecodeErrorZ_is_ok(long _o); - // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_free")] public static extern void CResult_RouteHintDecodeErrorZ_free(long __res); - // uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteHintDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_clone")] public static extern long CResult_RouteHintDecodeErrorZ_clone(long _orig); - // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_ok")] public static extern long CResult_RouteHintHopDecodeErrorZ_ok(long _o); - // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_err")] public static extern long CResult_RouteHintHopDecodeErrorZ_err(long _e); - // bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_is_ok")] public static extern bool CResult_RouteHintHopDecodeErrorZ_is_ok(long _o); - // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_free")] public static extern void CResult_RouteHintHopDecodeErrorZ_free(long __res); - // uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteHintHopDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_clone")] public static extern long CResult_RouteHintHopDecodeErrorZ_clone(long _orig); - // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok")] public static extern long CResult_PaymentPurposeDecodeErrorZ_ok(long _o); - // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_err")] public static extern long CResult_PaymentPurposeDecodeErrorZ_err(long _e); - // bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_is_ok")] public static extern bool CResult_PaymentPurposeDecodeErrorZ_is_ok(long _o); - // void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_free")] public static extern void CResult_PaymentPurposeDecodeErrorZ_free(long __res); - // uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentPurposeDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone")] public static extern long CResult_PaymentPurposeDecodeErrorZ_clone(long _orig); - // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_some")] public static extern long COption_ClosureReasonZ_some(long _o); - // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_none")] public static extern long COption_ClosureReasonZ_none(); - // void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_free")] public static extern void COption_ClosureReasonZ_free(long __res); - // uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_clone_ptr")] public static extern long COption_ClosureReasonZ_clone_ptr(long _arg); - // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_clone")] public static extern long COption_ClosureReasonZ_clone(long _orig); - // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_ok")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_ok(long _o); - // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_err")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_err(long _e); - // bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(long _o); - // void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_free")] public static extern void CResult_COption_ClosureReasonZDecodeErrorZ_free(long __res); - // uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_clone(long _orig); - // struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_some")] public static extern long COption_HTLCDestinationZ_some(long _o); - // struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_none")] public static extern long COption_HTLCDestinationZ_none(); - // void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_free")] public static extern void COption_HTLCDestinationZ_free(long __res); - // uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_clone_ptr")] public static extern long COption_HTLCDestinationZ_clone_ptr(long _arg); - // struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_clone")] public static extern long COption_HTLCDestinationZ_clone(long _orig); - // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_ok")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_ok(long _o); - // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_err")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_err(long _e); - // bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(long _o); - // void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_free")] public static extern void CResult_COption_HTLCDestinationZDecodeErrorZ_free(long __res); - // uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_clone(long _orig); - // struct LDKCOption_u128Z COption_u128Z_some(struct LDKU128 o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_some")] public static extern long COption_u128Z_some(byte[] _o); - // struct LDKCOption_u128Z COption_u128Z_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_none")] public static extern long COption_u128Z_none(); - // void COption_u128Z_free(struct LDKCOption_u128Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_free")] public static extern void COption_u128Z_free(long __res); - // uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_clone_ptr")] public static extern long COption_u128Z_clone_ptr(long _arg); - // struct LDKCOption_u128Z COption_u128Z_clone(const struct LDKCOption_u128Z *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_clone")] public static extern long COption_u128Z_clone(long _orig); - // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_some")] public static extern long COption_NetworkUpdateZ_some(long _o); - // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_none")] public static extern long COption_NetworkUpdateZ_none(); - // void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_free")] public static extern void COption_NetworkUpdateZ_free(long __res); - // uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_clone_ptr")] public static extern long COption_NetworkUpdateZ_clone_ptr(long _arg); - // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_clone")] public static extern long COption_NetworkUpdateZ_clone(long _orig); + // struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_ok")] public static extern long CResult_RefundBolt12ParseErrorZ_ok(long _o); + // struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_err")] public static extern long CResult_RefundBolt12ParseErrorZ_err(long _e); + // bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_is_ok")] public static extern bool CResult_RefundBolt12ParseErrorZ_is_ok(long _o); + // void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_free")] public static extern void CResult_RefundBolt12ParseErrorZ_free(long __res); + // uint64_t CResult_RefundBolt12ParseErrorZ_clone_ptr(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_clone_ptr")] public static extern long CResult_RefundBolt12ParseErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12ParseErrorZ_clone")] public static extern long CResult_RefundBolt12ParseErrorZ_clone(long _orig); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_ok")] public static extern long CResult_NoneAPIErrorZ_ok(); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_err")] public static extern long CResult_NoneAPIErrorZ_err(long _e); + // bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_is_ok")] public static extern bool CResult_NoneAPIErrorZ_is_ok(long _o); + // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_free")] public static extern void CResult_NoneAPIErrorZ_free(long __res); + // uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_clone_ptr")] public static extern long CResult_NoneAPIErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_clone")] public static extern long CResult_NoneAPIErrorZ_clone(long _orig); + // void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_CResult_NoneAPIErrorZZ_free")] public static extern void CVec_CResult_NoneAPIErrorZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_APIErrorZ_free")] public static extern void CVec_APIErrorZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCOption_PaymentSecretZ COption_PaymentSecretZ_some(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentSecretZ_some")] public static extern long COption_PaymentSecretZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_PaymentSecretZ COption_PaymentSecretZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentSecretZ_none")] public static extern long COption_PaymentSecretZ_none(); + // void COption_PaymentSecretZ_free(struct LDKCOption_PaymentSecretZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentSecretZ_free")] public static extern void COption_PaymentSecretZ_free(long __res); + // uint64_t COption_PaymentSecretZ_clone_ptr(LDKCOption_PaymentSecretZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentSecretZ_clone_ptr")] public static extern long COption_PaymentSecretZ_clone_ptr(long _arg); + // struct LDKCOption_PaymentSecretZ COption_PaymentSecretZ_clone(const struct LDKCOption_PaymentSecretZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentSecretZ_clone")] public static extern long COption_PaymentSecretZ_clone(long _orig); + // void CVec_u8Z_free(struct LDKCVec_u8Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_u8Z_free")] public static extern void CVec_u8Z_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] __res); + // struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_u8ZZ_some")] public static extern long COption_CVec_u8ZZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_u8ZZ_none")] public static extern long COption_CVec_u8ZZ_none(); + // void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_u8ZZ_free")] public static extern void COption_CVec_u8ZZ_free(long __res); + // uint64_t COption_CVec_u8ZZ_clone_ptr(LDKCOption_CVec_u8ZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_u8ZZ_clone_ptr")] public static extern long COption_CVec_u8ZZ_clone_ptr(long _arg); + // struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_u8ZZ_clone")] public static extern long COption_CVec_u8ZZ_clone(long _orig); + // struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_ok")] public static extern long CResult_RecipientOnionFieldsDecodeErrorZ_ok(long _o); + // struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_err")] public static extern long CResult_RecipientOnionFieldsDecodeErrorZ_err(long _e); + // bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_is_ok")] public static extern bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(long _o); + // void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_free")] public static extern void CResult_RecipientOnionFieldsDecodeErrorZ_free(long __res); + // uint64_t CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr")] public static extern long CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsDecodeErrorZ_clone")] public static extern long CResult_RecipientOnionFieldsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_ok")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_err")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_err(long _e); + // bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(long _o); + // void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_free")] public static extern void CResult_BlindedPayInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPayInfoDecodeErrorZ_clone")] public static extern long CResult_BlindedPayInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(long _o); + // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(long _e); + // bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok")] public static extern bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(long _o); + // void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free")] public static extern void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(long __res); + // uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(long _orig); + // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(long _o); + // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(long _e); + // bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok")] public static extern bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(long _o); + // void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free")] public static extern void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(long __res); + // uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(long _orig); + // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_ok")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_ok(long _o); + // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_err")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_err(long _e); + // bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok")] public static extern bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(long _o); + // void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_free")] public static extern void CResult_SpendableOutputDescriptorDecodeErrorZ_free(long __res); + // uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_clone")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_clone(long _orig); // void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_SpendableOutputDescriptorZ_free")] public static extern void CVec_SpendableOutputDescriptorZ_free(long[] __res); - // struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_some")] public static extern long COption_EventZ_some(long _o); - // struct LDKCOption_EventZ COption_EventZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_none")] public static extern long COption_EventZ_none(); - // void COption_EventZ_free(struct LDKCOption_EventZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_free")] public static extern void COption_EventZ_free(long __res); - // uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_clone_ptr")] public static extern long COption_EventZ_clone_ptr(long _arg); - // struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_clone")] public static extern long COption_EventZ_clone(long _orig); - // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_ok")] public static extern long CResult_COption_EventZDecodeErrorZ_ok(long _o); - // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_err")] public static extern long CResult_COption_EventZDecodeErrorZ_err(long _e); - // bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_EventZDecodeErrorZ_is_ok(long _o); - // void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_free")] public static extern void CResult_COption_EventZDecodeErrorZ_free(long __res); - // uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_EventZDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_clone")] public static extern long CResult_COption_EventZDecodeErrorZ_clone(long _orig); - // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MessageSendEventZ_free")] public static extern void CVec_MessageSendEventZ_free(long[] __res); - // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_ok")] public static extern long CResult_TxOutAccessErrorZ_ok(long _o); - // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_err")] public static extern long CResult_TxOutAccessErrorZ_err(AccessError _e); - // bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_is_ok")] public static extern bool CResult_TxOutAccessErrorZ_is_ok(long _o); - // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_free")] public static extern void CResult_TxOutAccessErrorZ_free(long __res); - // uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_clone_ptr")] public static extern long CResult_TxOutAccessErrorZ_clone_ptr(long _arg); - // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutAccessErrorZ_clone")] public static extern long CResult_TxOutAccessErrorZ_clone(long _orig); - // uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_clone_ptr")] public static extern long C2Tuple_usizeTransactionZ_clone_ptr(long _arg); - // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_clone")] public static extern long C2Tuple_usizeTransactionZ_clone(long _orig); - // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_new")] public static extern long C2Tuple_usizeTransactionZ_new(long _a, byte[] _b); - // void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_free")] public static extern void C2Tuple_usizeTransactionZ_free(long __res); - // void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_usizeTransactionZZ_free")] public static extern void CVec_C2Tuple_usizeTransactionZZ_free(long[] __res); - // uint64_t C2Tuple_TxidBlockHashZ_clone_ptr(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidBlockHashZ_clone_ptr")] public static extern long C2Tuple_TxidBlockHashZ_clone_ptr(long _arg); - // struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_clone(const struct LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidBlockHashZ_clone")] public static extern long C2Tuple_TxidBlockHashZ_clone(long _orig); - // struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidBlockHashZ_new")] public static extern long C2Tuple_TxidBlockHashZ_new(byte[] _a, byte[] _b); - // void C2Tuple_TxidBlockHashZ_free(struct LDKC2Tuple_TxidBlockHashZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidBlockHashZ_free")] public static extern void C2Tuple_TxidBlockHashZ_free(long __res); - // void CVec_C2Tuple_TxidBlockHashZZ_free(struct LDKCVec_C2Tuple_TxidBlockHashZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_TxidBlockHashZZ_free")] public static extern void CVec_C2Tuple_TxidBlockHashZZ_free(long[] __res); - // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MonitorEventZ_free")] public static extern void CVec_MonitorEventZ_free(long[] __res); - // uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(long _arg); - // struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(long _orig); - // struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(long _a, long[] _b, byte[] _c); - // void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free")] public static extern void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(long __res); - // void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free")] public static extern void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(long[] __res); - // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_ok")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_ok(long _o); - // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_err")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_err(long _e); - // bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok")] public static extern bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(long _o); - // void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_free")] public static extern void CResult_FixedPenaltyScorerDecodeErrorZ_free(long __res); - // uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_clone")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_clone(long _orig); - // uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_clone_ptr")] public static extern long C2Tuple_u64u64Z_clone_ptr(long _arg); - // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_clone")] public static extern long C2Tuple_u64u64Z_clone(long _orig); - // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_new")] public static extern long C2Tuple_u64u64Z_new(long _a, long _b); - // void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_free")] public static extern void C2Tuple_u64u64Z_free(long __res); - // struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_some")] public static extern long COption_C2Tuple_u64u64ZZ_some(long _o); - // struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_none")] public static extern long COption_C2Tuple_u64u64ZZ_none(); - // void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_free")] public static extern void COption_C2Tuple_u64u64ZZ_free(long __res); - // uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_clone_ptr")] public static extern long COption_C2Tuple_u64u64ZZ_clone_ptr(long _arg); - // struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_clone")] public static extern long COption_C2Tuple_u64u64ZZ_clone(long _orig); - // void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_NodeIdZ_free")] public static extern void CVec_NodeIdZ_free(long[] __res); - // struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_ok")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_ok(long _o); - // struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_err")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_err(long _e); - // bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_is_ok")] public static extern bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(long _o); - // void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_free")] public static extern void CResult_ProbabilisticScorerDecodeErrorZ_free(long __res); - // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_ok")] public static extern long CResult_InitFeaturesDecodeErrorZ_ok(long _o); - // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_err")] public static extern long CResult_InitFeaturesDecodeErrorZ_err(long _e); - // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_InitFeaturesDecodeErrorZ_is_ok(long _o); - // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_free")] public static extern void CResult_InitFeaturesDecodeErrorZ_free(long __res); - // uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_InitFeaturesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_clone")] public static extern long CResult_InitFeaturesDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_ok")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_err")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_err(long _e); - // bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_free")] public static extern void CResult_ChannelFeaturesDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_clone")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_clone(long _orig); - // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_ok")] public static extern long CResult_NodeFeaturesDecodeErrorZ_ok(long _o); - // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_err")] public static extern long CResult_NodeFeaturesDecodeErrorZ_err(long _e); - // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_NodeFeaturesDecodeErrorZ_is_ok(long _o); - // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_free")] public static extern void CResult_NodeFeaturesDecodeErrorZ_free(long __res); - // uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeFeaturesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_clone")] public static extern long CResult_NodeFeaturesDecodeErrorZ_clone(long _orig); - // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_ok")] public static extern long CResult_InvoiceFeaturesDecodeErrorZ_ok(long _o); - // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_err")] public static extern long CResult_InvoiceFeaturesDecodeErrorZ_err(long _e); - // bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(long _o); - // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_free")] public static extern void CResult_InvoiceFeaturesDecodeErrorZ_free(long __res); - // uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceFeaturesDecodeErrorZ_clone")] public static extern long CResult_InvoiceFeaturesDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_ok")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_err")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_err(long _e); - // bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_free")] public static extern void CResult_ChannelTypeFeaturesDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_clone(long _orig); - // struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_ok(struct LDKOfferFeatures o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_ok")] public static extern long CResult_OfferFeaturesDecodeErrorZ_ok(long _o); - // struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_err")] public static extern long CResult_OfferFeaturesDecodeErrorZ_err(long _e); - // bool CResult_OfferFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_OfferFeaturesDecodeErrorZ_is_ok(long _o); - // void CResult_OfferFeaturesDecodeErrorZ_free(struct LDKCResult_OfferFeaturesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_free")] public static extern void CResult_OfferFeaturesDecodeErrorZ_free(long __res); - // uint64_t CResult_OfferFeaturesDecodeErrorZ_clone_ptr(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_OfferFeaturesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_clone(const struct LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferFeaturesDecodeErrorZ_clone")] public static extern long CResult_OfferFeaturesDecodeErrorZ_clone(long _orig); - // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(struct LDKInvoiceRequestFeatures o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_ok")] public static extern long CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(long _o); - // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_err")] public static extern long CResult_InvoiceRequestFeaturesDecodeErrorZ_err(long _e); - // bool CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(long _o); - // void CResult_InvoiceRequestFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_free")] public static extern void CResult_InvoiceRequestFeaturesDecodeErrorZ_free(long __res); - // uint64_t CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFeaturesDecodeErrorZ_clone")] public static extern long CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(long _orig); - // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_ok")] public static extern long CResult_NodeIdDecodeErrorZ_ok(long _o); - // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_err")] public static extern long CResult_NodeIdDecodeErrorZ_err(long _e); - // bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_is_ok")] public static extern bool CResult_NodeIdDecodeErrorZ_is_ok(long _o); - // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_free")] public static extern void CResult_NodeIdDecodeErrorZ_free(long __res); - // uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeIdDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_clone")] public static extern long CResult_NodeIdDecodeErrorZ_clone(long _orig); - // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_ok")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_ok(long _o); - // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_err")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_err(long _e); - // bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(long _o); - // void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_free")] public static extern void CResult_COption_NetworkUpdateZDecodeErrorZ_free(long __res); - // uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_clone")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_clone(long _orig); - // struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AccessZ_some")] public static extern long COption_AccessZ_some(long _o); - // struct LDKCOption_AccessZ COption_AccessZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AccessZ_none")] public static extern long COption_AccessZ_none(); - // void COption_AccessZ_free(struct LDKCOption_AccessZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AccessZ_free")] public static extern void COption_AccessZ_free(long __res); - // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_ok")] public static extern long CResult_boolLightningErrorZ_ok(bool _o); - // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_err")] public static extern long CResult_boolLightningErrorZ_err(long _e); - // bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_is_ok")] public static extern bool CResult_boolLightningErrorZ_is_ok(long _o); - // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_free")] public static extern void CResult_boolLightningErrorZ_free(long __res); - // uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_clone_ptr")] public static extern long CResult_boolLightningErrorZ_clone_ptr(long _arg); - // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_clone")] public static extern long CResult_boolLightningErrorZ_clone(long _orig); - // uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(long _arg); - // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(long _orig); - // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(long _a, long _b, long _c); - // void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free")] public static extern void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(long __res); - // struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(long _o); - // struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(); - // void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free")] public static extern void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(long __res); - // uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(long _arg); - // struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(long _orig); - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_ok")] public static extern long CResult_NoneLightningErrorZ_ok(); - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_err")] public static extern long CResult_NoneLightningErrorZ_err(long _e); - // bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_is_ok")] public static extern bool CResult_NoneLightningErrorZ_is_ok(long _o); - // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_free")] public static extern void CResult_NoneLightningErrorZ_free(long __res); - // uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_clone_ptr")] public static extern long CResult_NoneLightningErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_clone")] public static extern long CResult_NoneLightningErrorZ_clone(long _orig); - // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_ok")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_err")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_err(long _e); - // bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_free")] public static extern void CResult_ChannelUpdateInfoDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_clone")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_ok")] public static extern long CResult_ChannelInfoDecodeErrorZ_ok(long _o); - // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_err")] public static extern long CResult_ChannelInfoDecodeErrorZ_err(long _e); - // bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelInfoDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_free")] public static extern void CResult_ChannelInfoDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelInfoDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_clone")] public static extern long CResult_ChannelInfoDecodeErrorZ_clone(long _orig); - // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_ok")] public static extern long CResult_RoutingFeesDecodeErrorZ_ok(long _o); - // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_err")] public static extern long CResult_RoutingFeesDecodeErrorZ_err(long _e); - // bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_is_ok")] public static extern bool CResult_RoutingFeesDecodeErrorZ_is_ok(long _o); - // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_free")] public static extern void CResult_RoutingFeesDecodeErrorZ_free(long __res); - // uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_clone_ptr")] public static extern long CResult_RoutingFeesDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_clone")] public static extern long CResult_RoutingFeesDecodeErrorZ_clone(long _orig); - // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_NetAddressZ_free")] public static extern void CVec_NetAddressZ_free(long[] __res); - // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_ok")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_ok(long _o); - // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_err")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_err(long _e); - // bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok")] public static extern bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(long _o); - // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_free")] public static extern void CResult_NodeAnnouncementInfoDecodeErrorZ_free(long __res); - // uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_clone")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_clone(long _orig); - // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_ok")] public static extern long CResult_NodeAliasDecodeErrorZ_ok(long _o); - // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_err")] public static extern long CResult_NodeAliasDecodeErrorZ_err(long _e); - // bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_is_ok")] public static extern bool CResult_NodeAliasDecodeErrorZ_is_ok(long _o); - // void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_free")] public static extern void CResult_NodeAliasDecodeErrorZ_free(long __res); - // uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeAliasDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_clone")] public static extern long CResult_NodeAliasDecodeErrorZ_clone(long _orig); - // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_ok")] public static extern long CResult_NodeInfoDecodeErrorZ_ok(long _o); - // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_err")] public static extern long CResult_NodeInfoDecodeErrorZ_err(long _e); - // bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_is_ok")] public static extern bool CResult_NodeInfoDecodeErrorZ_is_ok(long _o); - // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_free")] public static extern void CResult_NodeInfoDecodeErrorZ_free(long __res); - // uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeInfoDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_clone")] public static extern long CResult_NodeInfoDecodeErrorZ_clone(long _orig); - // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_ok")] public static extern long CResult_NetworkGraphDecodeErrorZ_ok(long _o); - // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_err")] public static extern long CResult_NetworkGraphDecodeErrorZ_err(long _e); - // bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_is_ok")] public static extern bool CResult_NetworkGraphDecodeErrorZ_is_ok(long _o); - // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_free")] public static extern void CResult_NetworkGraphDecodeErrorZ_free(long __res); - // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_some")] public static extern long COption_CVec_NetAddressZZ_some(long[] _o); - // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_none")] public static extern long COption_CVec_NetAddressZZ_none(); - // void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_free")] public static extern void COption_CVec_NetAddressZZ_free(long __res); - // uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_clone_ptr")] public static extern long COption_CVec_NetAddressZZ_clone_ptr(long _arg); - // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_clone")] public static extern long COption_CVec_NetAddressZZ_clone(long _orig); - // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(long _o); - // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(long _e); - // bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok")] public static extern bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(long _o); - // void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free")] public static extern void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(long __res); - // uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone")] public static extern long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(long _orig); - // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(long _o); - // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(long _e); - // bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok")] public static extern bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(long _o); - // void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free")] public static extern void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(long __res); - // uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone")] public static extern long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(long _orig); - // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_ok")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_ok(long _o); - // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_err")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_err(long _e); - // bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok")] public static extern bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(long _o); - // void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_free")] public static extern void CResult_SpendableOutputDescriptorDecodeErrorZ_free(long __res); - // uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SpendableOutputDescriptorDecodeErrorZ_clone")] public static extern long CResult_SpendableOutputDescriptorDecodeErrorZ_clone(long _orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_SpendableOutputDescriptorZ_free")] public static extern void CVec_SpendableOutputDescriptorZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_TxOutZ_free")] public static extern void CVec_TxOutZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCOption_PackedLockTimeZ COption_PackedLockTimeZ_some(uint32_t o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PackedLockTimeZ_some")] public static extern long COption_PackedLockTimeZ_some(int _o); + // struct LDKCOption_PackedLockTimeZ COption_PackedLockTimeZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PackedLockTimeZ_none")] public static extern long COption_PackedLockTimeZ_none(); + // void COption_PackedLockTimeZ_free(struct LDKCOption_PackedLockTimeZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PackedLockTimeZ_free")] public static extern void COption_PackedLockTimeZ_free(long __res); + // uint64_t COption_PackedLockTimeZ_clone_ptr(LDKCOption_PackedLockTimeZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PackedLockTimeZ_clone_ptr")] public static extern long COption_PackedLockTimeZ_clone_ptr(long _arg); + // struct LDKCOption_PackedLockTimeZ COption_PackedLockTimeZ_clone(const struct LDKCOption_PackedLockTimeZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PackedLockTimeZ_clone")] public static extern long COption_PackedLockTimeZ_clone(long _orig); + // uint64_t C2Tuple_PartiallySignedTransactionusizeZ_clone_ptr(LDKC2Tuple_PartiallySignedTransactionusizeZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PartiallySignedTransactionusizeZ_clone_ptr")] public static extern long C2Tuple_PartiallySignedTransactionusizeZ_clone_ptr(long _arg); + // struct LDKC2Tuple_PartiallySignedTransactionusizeZ C2Tuple_PartiallySignedTransactionusizeZ_clone(const struct LDKC2Tuple_PartiallySignedTransactionusizeZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PartiallySignedTransactionusizeZ_clone")] public static extern long C2Tuple_PartiallySignedTransactionusizeZ_clone(long _orig); + // struct LDKC2Tuple_PartiallySignedTransactionusizeZ C2Tuple_PartiallySignedTransactionusizeZ_new(struct LDKCVec_u8Z a, uintptr_t b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PartiallySignedTransactionusizeZ_new")] public static extern long C2Tuple_PartiallySignedTransactionusizeZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, long _b); + // void C2Tuple_PartiallySignedTransactionusizeZ_free(struct LDKC2Tuple_PartiallySignedTransactionusizeZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PartiallySignedTransactionusizeZ_free")] public static extern void C2Tuple_PartiallySignedTransactionusizeZ_free(long __res); + // struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_ok(struct LDKC2Tuple_PartiallySignedTransactionusizeZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_ok")] public static extern long CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_ok(long _o); + // struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_err")] public static extern long CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_err(); + // bool CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_is_ok")] public static extern bool CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_is_ok(long _o); + // void CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_free(struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_free")] public static extern void CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_free(long __res); + // uint64_t CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone_ptr(LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone_ptr")] public static extern long CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone_ptr(long _arg); + // struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone(const struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone")] public static extern long CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone(long _orig); // void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PaymentPreimageZ_free")] public static extern void CVec_PaymentPreimageZ_free(byte[][] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PaymentPreimageZ_free")] public static extern void CVec_PaymentPreimageZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_ok")] public static extern long CResult_NoneNoneZ_ok(); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_err")] public static extern long CResult_NoneNoneZ_err(); + // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_is_ok")] public static extern bool CResult_NoneNoneZ_is_ok(long _o); + // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_free")] public static extern void CResult_NoneNoneZ_free(long __res); + // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone_ptr")] public static extern long CResult_NoneNoneZ_clone_ptr(long _arg); + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneNoneZ_clone")] public static extern long CResult_NoneNoneZ_clone(long _orig); + // void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_SignatureZ_free")] public static extern void CVec_SignatureZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); // uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr")] public static extern long C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(long _arg); // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_clone")] public static extern long C2Tuple_SignatureCVec_SignatureZZ_clone(long _orig); // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_new")] public static extern long C2Tuple_SignatureCVec_SignatureZZ_new(byte[] _a, byte[][] _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_new")] public static extern long C2Tuple_SignatureCVec_SignatureZZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _b); // void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureCVec_SignatureZZ_free")] public static extern void C2Tuple_SignatureCVec_SignatureZZ_free(long __res); // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o); @@ -2328,7 +2041,7 @@ internal class bindings { // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone")] public static extern long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(long _orig); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_ok")] public static extern long CResult_SignatureNoneZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_ok")] public static extern long CResult_SignatureNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_err")] public static extern long CResult_SignatureNoneZ_err(); // bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o); @@ -2339,40 +2052,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_clone_ptr")] public static extern long CResult_SignatureNoneZ_clone_ptr(long _arg); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignatureNoneZ_clone")] public static extern long CResult_SignatureNoneZ_clone(long _orig); - // uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureSignatureZ_clone_ptr")] public static extern long C2Tuple_SignatureSignatureZ_clone_ptr(long _arg); - // struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureSignatureZ_clone")] public static extern long C2Tuple_SignatureSignatureZ_clone(long _orig); - // struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureSignatureZ_new")] public static extern long C2Tuple_SignatureSignatureZ_new(byte[] _a, byte[] _b); - // void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_SignatureSignatureZ_free")] public static extern void C2Tuple_SignatureSignatureZ_free(long __res); - // struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_ok")] public static extern long CResult_C2Tuple_SignatureSignatureZNoneZ_ok(long _o); - // struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_err")] public static extern long CResult_C2Tuple_SignatureSignatureZNoneZ_err(); - // bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok")] public static extern bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(long _o); - // void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_free")] public static extern void CResult_C2Tuple_SignatureSignatureZNoneZ_free(long __res); - // uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr")] public static extern long CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(long _arg); - // struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_SignatureSignatureZNoneZ_clone")] public static extern long CResult_C2Tuple_SignatureSignatureZNoneZ_clone(long _orig); - // struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_ok")] public static extern long CResult_SecretKeyNoneZ_ok(byte[] _o); - // struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_err")] public static extern long CResult_SecretKeyNoneZ_err(); - // bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_is_ok")] public static extern bool CResult_SecretKeyNoneZ_is_ok(long _o); - // void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_free")] public static extern void CResult_SecretKeyNoneZ_free(long __res); - // uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_clone_ptr")] public static extern long CResult_SecretKeyNoneZ_clone_ptr(long _arg); - // struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SecretKeyNoneZ_clone")] public static extern long CResult_SecretKeyNoneZ_clone(long _orig); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_ok")] public static extern long CResult_PublicKeyNoneZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_ok")] public static extern long CResult_PublicKeyNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyNoneZ_err")] public static extern long CResult_PublicKeyNoneZ_err(); // bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o); @@ -2389,8 +2070,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScalarZ_none")] public static extern long COption_ScalarZ_none(); // void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScalarZ_free")] public static extern void COption_ScalarZ_free(long __res); + // uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScalarZ_clone_ptr")] public static extern long COption_ScalarZ_clone_ptr(long _arg); + // struct LDKCOption_ScalarZ COption_ScalarZ_clone(const struct LDKCOption_ScalarZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScalarZ_clone")] public static extern long COption_ScalarZ_clone(long _orig); // struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_ok")] public static extern long CResult_SharedSecretNoneZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_ok")] public static extern long CResult_SharedSecretNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_err")] public static extern long CResult_SharedSecretNoneZ_err(); // bool CResult_SharedSecretNoneZ_is_ok(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR o); @@ -2401,22 +2086,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_clone_ptr")] public static extern long CResult_SharedSecretNoneZ_clone_ptr(long _arg); // struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_clone(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SharedSecretNoneZ_clone")] public static extern long CResult_SharedSecretNoneZ_clone(long _orig); - // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_ok")] public static extern long CResult_SignDecodeErrorZ_ok(long _o); - // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_err")] public static extern long CResult_SignDecodeErrorZ_err(long _e); - // bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_is_ok")] public static extern bool CResult_SignDecodeErrorZ_is_ok(long _o); - // void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_free")] public static extern void CResult_SignDecodeErrorZ_free(long __res); - // uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_clone_ptr")] public static extern long CResult_SignDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignDecodeErrorZ_clone")] public static extern long CResult_SignDecodeErrorZ_clone(long _orig); // void CVec_U5Z_free(struct LDKCVec_U5Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_U5Z_free")] public static extern void CVec_U5Z_free(byte[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_U5Z_free")] public static extern void CVec_U5Z_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] __res); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_ok")] public static extern long CResult_RecoverableSignatureNoneZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_ok")] public static extern long CResult_RecoverableSignatureNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_err")] public static extern long CResult_RecoverableSignatureNoneZ_err(); // bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o); @@ -2427,12 +2100,46 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_clone_ptr")] public static extern long CResult_RecoverableSignatureNoneZ_clone_ptr(long _arg); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_clone")] public static extern long CResult_RecoverableSignatureNoneZ_clone(long _orig); - // void CVec_u8Z_free(struct LDKCVec_u8Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_u8Z_free")] public static extern void CVec_u8Z_free(byte[] __res); + // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(long _o); + // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(long _e); + // bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok")] public static extern bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(long _o); + // void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free")] public static extern void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(long __res); + // uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ScriptNoneZ CResult_ScriptNoneZ_ok(struct LDKCVec_u8Z o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_ok")] public static extern long CResult_ScriptNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCResult_ScriptNoneZ CResult_ScriptNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_err")] public static extern long CResult_ScriptNoneZ_err(); + // bool CResult_ScriptNoneZ_is_ok(const struct LDKCResult_ScriptNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_is_ok")] public static extern bool CResult_ScriptNoneZ_is_ok(long _o); + // void CResult_ScriptNoneZ_free(struct LDKCResult_ScriptNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_free")] public static extern void CResult_ScriptNoneZ_free(long __res); + // uint64_t CResult_ScriptNoneZ_clone_ptr(LDKCResult_ScriptNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_clone_ptr")] public static extern long CResult_ScriptNoneZ_clone_ptr(long _arg); + // struct LDKCResult_ScriptNoneZ CResult_ScriptNoneZ_clone(const struct LDKCResult_ScriptNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ScriptNoneZ_clone")] public static extern long CResult_ScriptNoneZ_clone(long _orig); + // struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_ok")] public static extern long CResult_ShutdownScriptNoneZ_ok(long _o); + // struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_err")] public static extern long CResult_ShutdownScriptNoneZ_err(); + // bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_is_ok")] public static extern bool CResult_ShutdownScriptNoneZ_is_ok(long _o); + // void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_free")] public static extern void CResult_ShutdownScriptNoneZ_free(long __res); + // uint64_t CResult_ShutdownScriptNoneZ_clone_ptr(LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_clone_ptr")] public static extern long CResult_ShutdownScriptNoneZ_clone_ptr(long _arg); + // struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptNoneZ_clone")] public static extern long CResult_ShutdownScriptNoneZ_clone(long _orig); // void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_CVec_u8ZZ_free")] public static extern void CVec_CVec_u8ZZ_free(byte[][] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_CVec_u8ZZ_free")] public static extern void CVec_CVec_u8ZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_ok")] public static extern long CResult_CVec_CVec_u8ZZNoneZ_ok(byte[][] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_ok")] public static extern long CResult_CVec_CVec_u8ZZNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _o); // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_err")] public static extern long CResult_CVec_CVec_u8ZZNoneZ_err(); // bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o); @@ -2455,10 +2162,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_clone_ptr")] public static extern long CResult_InMemorySignerDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_clone")] public static extern long CResult_InMemorySignerDecodeErrorZ_clone(long _orig); - // void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_TxOutZ_free")] public static extern void CVec_TxOutZ_free(long[] __res); + // struct LDKCResult_PartiallySignedTransactionNoneZ CResult_PartiallySignedTransactionNoneZ_ok(struct LDKCVec_u8Z o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_ok")] public static extern long CResult_PartiallySignedTransactionNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCResult_PartiallySignedTransactionNoneZ CResult_PartiallySignedTransactionNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_err")] public static extern long CResult_PartiallySignedTransactionNoneZ_err(); + // bool CResult_PartiallySignedTransactionNoneZ_is_ok(const struct LDKCResult_PartiallySignedTransactionNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_is_ok")] public static extern bool CResult_PartiallySignedTransactionNoneZ_is_ok(long _o); + // void CResult_PartiallySignedTransactionNoneZ_free(struct LDKCResult_PartiallySignedTransactionNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_free")] public static extern void CResult_PartiallySignedTransactionNoneZ_free(long __res); + // uint64_t CResult_PartiallySignedTransactionNoneZ_clone_ptr(LDKCResult_PartiallySignedTransactionNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_clone_ptr")] public static extern long CResult_PartiallySignedTransactionNoneZ_clone_ptr(long _arg); + // struct LDKCResult_PartiallySignedTransactionNoneZ CResult_PartiallySignedTransactionNoneZ_clone(const struct LDKCResult_PartiallySignedTransactionNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PartiallySignedTransactionNoneZ_clone")] public static extern long CResult_PartiallySignedTransactionNoneZ_clone(long _orig); // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_ok")] public static extern long CResult_TransactionNoneZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_ok")] public static extern long CResult_TransactionNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_err")] public static extern long CResult_TransactionNoneZ_err(); // bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o); @@ -2469,56 +2186,646 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_clone_ptr")] public static extern long CResult_TransactionNoneZ_clone_ptr(long _arg); // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_clone")] public static extern long CResult_TransactionNoneZ_clone(long _orig); - // uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_clone_ptr")] public static extern long C2Tuple_BlockHashChannelMonitorZ_clone_ptr(long _arg); - // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_clone(const struct LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_clone")] public static extern long C2Tuple_BlockHashChannelMonitorZ_clone(long _orig); - // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_new")] public static extern long C2Tuple_BlockHashChannelMonitorZ_new(byte[] _a, long _b); - // void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_free")] public static extern void C2Tuple_BlockHashChannelMonitorZ_free(long __res); - // void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_BlockHashChannelMonitorZZ_free")] public static extern void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(long[] __res); - // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(long[] _o); - // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(IOError _e); - // bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok")] public static extern bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(long _o); - // void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free")] public static extern void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(long __res); - // uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(long _arg); - // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(long _orig); - // struct LDKCOption_u16Z COption_u16Z_some(uint16_t o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_some")] public static extern long COption_u16Z_some(short _o); - // struct LDKCOption_u16Z COption_u16Z_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_none")] public static extern long COption_u16Z_none(); - // void COption_u16Z_free(struct LDKCOption_u16Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_free")] public static extern void COption_u16Z_free(long __res); - // uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg); + // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_WriteableScoreZ_some")] public static extern long COption_WriteableScoreZ_some(long _o); + // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_WriteableScoreZ_none")] public static extern long COption_WriteableScoreZ_none(); + // void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_WriteableScoreZ_free")] public static extern void COption_WriteableScoreZ_free(long __res); + // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_ok")] public static extern long CResult_NoneErrorZ_ok(); + // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_err")] public static extern long CResult_NoneErrorZ_err(IOError _e); + // bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_is_ok")] public static extern bool CResult_NoneErrorZ_is_ok(long _o); + // void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_free")] public static extern void CResult_NoneErrorZ_free(long __res); + // uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_clone_ptr")] public static extern long CResult_NoneErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneErrorZ_clone")] public static extern long CResult_NoneErrorZ_clone(long _orig); + // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChannelDetailsZ_free")] public static extern void CVec_ChannelDetailsZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_ok")] public static extern long CResult_RouteLightningErrorZ_ok(long _o); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_err")] public static extern long CResult_RouteLightningErrorZ_err(long _e); + // bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_is_ok")] public static extern bool CResult_RouteLightningErrorZ_is_ok(long _o); + // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_free")] public static extern void CResult_RouteLightningErrorZ_free(long __res); + // uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_clone_ptr")] public static extern long CResult_RouteLightningErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteLightningErrorZ_clone")] public static extern long CResult_RouteLightningErrorZ_clone(long _orig); + // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_ok")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_ok(long _o); + // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_err")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_err(long _e); + // bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_is_ok")] public static extern bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(long _o); + // void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_free")] public static extern void CResult_InFlightHtlcsDecodeErrorZ_free(long __res); + // uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_clone_ptr")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_clone")] public static extern long CResult_InFlightHtlcsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_ok")] public static extern long CResult_RouteHopDecodeErrorZ_ok(long _o); + // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_err")] public static extern long CResult_RouteHopDecodeErrorZ_err(long _e); + // bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_is_ok")] public static extern bool CResult_RouteHopDecodeErrorZ_is_ok(long _o); + // void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_free")] public static extern void CResult_RouteHopDecodeErrorZ_free(long __res); + // uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteHopDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHopDecodeErrorZ_clone")] public static extern long CResult_RouteHopDecodeErrorZ_clone(long _orig); + // void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_BlindedHopZ_free")] public static extern void CVec_BlindedHopZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_ok")] public static extern long CResult_BlindedTailDecodeErrorZ_ok(long _o); + // struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_err")] public static extern long CResult_BlindedTailDecodeErrorZ_err(long _e); + // bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedTailDecodeErrorZ_is_ok(long _o); + // void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_free")] public static extern void CResult_BlindedTailDecodeErrorZ_free(long __res); + // uint64_t CResult_BlindedTailDecodeErrorZ_clone_ptr(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedTailDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedTailDecodeErrorZ_clone")] public static extern long CResult_BlindedTailDecodeErrorZ_clone(long _orig); + // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHopZ_free")] public static extern void CVec_RouteHopZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_some")] public static extern long COption_u32Z_some(int _o); + // struct LDKCOption_u32Z COption_u32Z_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_none")] public static extern long COption_u32Z_none(); + // void COption_u32Z_free(struct LDKCOption_u32Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_free")] public static extern void COption_u32Z_free(long __res); + // uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_clone_ptr")] public static extern long COption_u32Z_clone_ptr(long _arg); + // struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u32Z_clone")] public static extern long COption_u32Z_clone(long _orig); + // void CVec_PathZ_free(struct LDKCVec_PathZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PathZ_free")] public static extern void CVec_PathZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_ok")] public static extern long CResult_RouteDecodeErrorZ_ok(long _o); + // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_err")] public static extern long CResult_RouteDecodeErrorZ_err(long _e); + // bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_is_ok")] public static extern bool CResult_RouteDecodeErrorZ_is_ok(long _o); + // void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_free")] public static extern void CResult_RouteDecodeErrorZ_free(long __res); + // uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteDecodeErrorZ_clone")] public static extern long CResult_RouteDecodeErrorZ_clone(long _orig); + // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_ok")] public static extern long CResult_RouteParametersDecodeErrorZ_ok(long _o); + // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_err")] public static extern long CResult_RouteParametersDecodeErrorZ_err(long _e); + // bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_is_ok")] public static extern bool CResult_RouteParametersDecodeErrorZ_is_ok(long _o); + // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_free")] public static extern void CResult_RouteParametersDecodeErrorZ_free(long __res); + // uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteParametersDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteParametersDecodeErrorZ_clone")] public static extern long CResult_RouteParametersDecodeErrorZ_clone(long _orig); + // void CVec_u64Z_free(struct LDKCVec_u64Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_u64Z_free")] public static extern void CVec_u64Z_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_ok")] public static extern long CResult_PaymentParametersDecodeErrorZ_ok(long _o); + // struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_err")] public static extern long CResult_PaymentParametersDecodeErrorZ_err(long _e); + // bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_is_ok")] public static extern bool CResult_PaymentParametersDecodeErrorZ_is_ok(long _o); + // void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_free")] public static extern void CResult_PaymentParametersDecodeErrorZ_free(long __res); + // uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentParametersDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentParametersDecodeErrorZ_clone")] public static extern long CResult_PaymentParametersDecodeErrorZ_clone(long _orig); + // uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(long _arg); + // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_clone(long _orig); + // struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_new")] public static extern long C2Tuple_BlindedPayInfoBlindedPathZ_new(long _a, long _b); + // void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_free")] public static extern void C2Tuple_BlindedPayInfoBlindedPathZ_free(long __res); + // void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free")] public static extern void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHintZ_free")] public static extern void CVec_RouteHintZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RouteHintHopZ_free")] public static extern void CVec_RouteHintHopZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_ok")] public static extern long CResult_RouteHintDecodeErrorZ_ok(long _o); + // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_err")] public static extern long CResult_RouteHintDecodeErrorZ_err(long _e); + // bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_is_ok")] public static extern bool CResult_RouteHintDecodeErrorZ_is_ok(long _o); + // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_free")] public static extern void CResult_RouteHintDecodeErrorZ_free(long __res); + // uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteHintDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintDecodeErrorZ_clone")] public static extern long CResult_RouteHintDecodeErrorZ_clone(long _orig); + // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_ok")] public static extern long CResult_RouteHintHopDecodeErrorZ_ok(long _o); + // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_err")] public static extern long CResult_RouteHintHopDecodeErrorZ_err(long _e); + // bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_is_ok")] public static extern bool CResult_RouteHintHopDecodeErrorZ_is_ok(long _o); + // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_free")] public static extern void CResult_RouteHintHopDecodeErrorZ_free(long __res); + // uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_clone_ptr")] public static extern long CResult_RouteHintHopDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RouteHintHopDecodeErrorZ_clone")] public static extern long CResult_RouteHintHopDecodeErrorZ_clone(long _orig); + // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PublicKeyZ_free")] public static extern void CVec_PublicKeyZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); + // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_ok")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_ok(long _o); + // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_err")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_err(long _e); + // bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok")] public static extern bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(long _o); + // void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_free")] public static extern void CResult_FixedPenaltyScorerDecodeErrorZ_free(long __res); + // uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_clone")] public static extern long CResult_FixedPenaltyScorerDecodeErrorZ_clone(long _orig); + // void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_NodeIdZ_free")] public static extern void CVec_NodeIdZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_clone_ptr")] public static extern long C2Tuple_u64u64Z_clone_ptr(long _arg); + // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_clone")] public static extern long C2Tuple_u64u64Z_clone(long _orig); + // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_new")] public static extern long C2Tuple_u64u64Z_new(long _a, long _b); + // void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u64Z_free")] public static extern void C2Tuple_u64u64Z_free(long __res); + // struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_some")] public static extern long COption_C2Tuple_u64u64ZZ_some(long _o); + // struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_none")] public static extern long COption_C2Tuple_u64u64ZZ_none(); + // void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_free")] public static extern void COption_C2Tuple_u64u64ZZ_free(long __res); + // uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_clone_ptr")] public static extern long COption_C2Tuple_u64u64ZZ_clone_ptr(long _arg); + // struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_u64u64ZZ_clone")] public static extern long COption_C2Tuple_u64u64ZZ_clone(long _orig); + // uint64_t C2Tuple_Z_clone_ptr(LDKC2Tuple_Z *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_Z_clone_ptr")] public static extern long C2Tuple_Z_clone_ptr(long _arg); + // struct LDKC2Tuple_Z C2Tuple_Z_clone(const struct LDKC2Tuple_Z *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_Z_clone")] public static extern long C2Tuple_Z_clone(long _orig); + // struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKEightU16s a, struct LDKEightU16s b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_Z_new")] public static extern long C2Tuple_Z_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] short[] _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] short[] _b); + // void C2Tuple_Z_free(struct LDKC2Tuple_Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_Z_free")] public static extern void C2Tuple_Z_free(long __res); + // uint64_t C2Tuple__u168_u168Z_clone_ptr(LDKC2Tuple__u168_u168Z *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u168_u168Z_clone_ptr")] public static extern long C2Tuple__u168_u168Z_clone_ptr(long _arg); + // struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_clone(const struct LDKC2Tuple__u168_u168Z *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u168_u168Z_clone")] public static extern long C2Tuple__u168_u168Z_clone(long _orig); + // struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_new(struct LDKEightU16s a, struct LDKEightU16s b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u168_u168Z_new")] public static extern long C2Tuple__u168_u168Z_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] short[] _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] short[] _b); + // void C2Tuple__u168_u168Z_free(struct LDKC2Tuple__u168_u168Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u168_u168Z_free")] public static extern void C2Tuple__u168_u168Z_free(long __res); + // struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_some(struct LDKC2Tuple__u168_u168Z o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_EightU16sEightU16sZZ_some")] public static extern long COption_C2Tuple_EightU16sEightU16sZZ_some(long _o); + // struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_EightU16sEightU16sZZ_none")] public static extern long COption_C2Tuple_EightU16sEightU16sZZ_none(); + // void COption_C2Tuple_EightU16sEightU16sZZ_free(struct LDKCOption_C2Tuple_EightU16sEightU16sZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_EightU16sEightU16sZZ_free")] public static extern void COption_C2Tuple_EightU16sEightU16sZZ_free(long __res); + // uint64_t COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr")] public static extern long COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(long _arg); + // struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_clone(const struct LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C2Tuple_EightU16sEightU16sZZ_clone")] public static extern long COption_C2Tuple_EightU16sEightU16sZZ_clone(long _orig); + // struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_ok")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_ok(long _o); + // struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_err")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_err(long _e); + // bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_is_ok")] public static extern bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(long _o); + // void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_free")] public static extern void CResult_ProbabilisticScorerDecodeErrorZ_free(long __res); + // uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_clone_ptr")] public static extern long C2Tuple_usizeTransactionZ_clone_ptr(long _arg); + // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_clone")] public static extern long C2Tuple_usizeTransactionZ_clone(long _orig); + // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_new")] public static extern long C2Tuple_usizeTransactionZ_new(long _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _b); + // void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_free")] public static extern void C2Tuple_usizeTransactionZ_free(long __res); + // void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_usizeTransactionZZ_free")] public static extern void CVec_C2Tuple_usizeTransactionZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCOption_BlockHashZ COption_BlockHashZ_some(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BlockHashZ_some")] public static extern long COption_BlockHashZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_BlockHashZ COption_BlockHashZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BlockHashZ_none")] public static extern long COption_BlockHashZ_none(); + // void COption_BlockHashZ_free(struct LDKCOption_BlockHashZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BlockHashZ_free")] public static extern void COption_BlockHashZ_free(long __res); + // uint64_t COption_BlockHashZ_clone_ptr(LDKCOption_BlockHashZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BlockHashZ_clone_ptr")] public static extern long COption_BlockHashZ_clone_ptr(long _arg); + // struct LDKCOption_BlockHashZ COption_BlockHashZ_clone(const struct LDKCOption_BlockHashZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_BlockHashZ_clone")] public static extern long COption_BlockHashZ_clone(long _orig); + // uint64_t C2Tuple_TxidCOption_BlockHashZZ_clone_ptr(LDKC2Tuple_TxidCOption_BlockHashZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCOption_BlockHashZZ_clone_ptr")] public static extern long C2Tuple_TxidCOption_BlockHashZZ_clone_ptr(long _arg); + // struct LDKC2Tuple_TxidCOption_BlockHashZZ C2Tuple_TxidCOption_BlockHashZZ_clone(const struct LDKC2Tuple_TxidCOption_BlockHashZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCOption_BlockHashZZ_clone")] public static extern long C2Tuple_TxidCOption_BlockHashZZ_clone(long _orig); + // struct LDKC2Tuple_TxidCOption_BlockHashZZ C2Tuple_TxidCOption_BlockHashZZ_new(struct LDKThirtyTwoBytes a, struct LDKCOption_BlockHashZ b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCOption_BlockHashZZ_new")] public static extern long C2Tuple_TxidCOption_BlockHashZZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, long _b); + // void C2Tuple_TxidCOption_BlockHashZZ_free(struct LDKC2Tuple_TxidCOption_BlockHashZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCOption_BlockHashZZ_free")] public static extern void C2Tuple_TxidCOption_BlockHashZZ_free(long __res); + // void CVec_C2Tuple_TxidCOption_BlockHashZZZ_free(struct LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_TxidCOption_BlockHashZZZ_free")] public static extern void CVec_C2Tuple_TxidCOption_BlockHashZZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MonitorEventZ_free")] public static extern void CVec_MonitorEventZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(long _arg); + // struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(long _orig); + // struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(long _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _b, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _c); + // void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free")] public static extern void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(long __res); + // void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free")] public static extern void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_ok")] public static extern long CResult_InitFeaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_err")] public static extern long CResult_InitFeaturesDecodeErrorZ_err(long _e); + // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_InitFeaturesDecodeErrorZ_is_ok(long _o); + // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_free")] public static extern void CResult_InitFeaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_InitFeaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_clone")] public static extern long CResult_InitFeaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_ok")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_err")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_err(long _e); + // bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_free")] public static extern void CResult_ChannelFeaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelFeaturesDecodeErrorZ_clone")] public static extern long CResult_ChannelFeaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_ok")] public static extern long CResult_NodeFeaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_err")] public static extern long CResult_NodeFeaturesDecodeErrorZ_err(long _e); + // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_NodeFeaturesDecodeErrorZ_is_ok(long _o); + // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_free")] public static extern void CResult_NodeFeaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeFeaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeFeaturesDecodeErrorZ_clone")] public static extern long CResult_NodeFeaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok")] public static extern long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err")] public static extern long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(long _e); + // bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(long _o); + // void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free")] public static extern void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone")] public static extern long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok")] public static extern long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err")] public static extern long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(long _e); + // bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(long _o); + // void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free")] public static extern void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone")] public static extern long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_ok")] public static extern long CResult_BlindedHopFeaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_err")] public static extern long CResult_BlindedHopFeaturesDecodeErrorZ_err(long _e); + // bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(long _o); + // void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_free")] public static extern void CResult_BlindedHopFeaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopFeaturesDecodeErrorZ_clone")] public static extern long CResult_BlindedHopFeaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_ok")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_err")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_err(long _e); + // bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_free")] public static extern void CResult_ChannelTypeFeaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_clone(long _orig); + // void CVec_ChainHashZ_free(struct LDKCVec_ChainHashZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChainHashZ_free")] public static extern void CVec_ChainHashZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); + // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_ok")] public static extern long CResult_OfferBolt12ParseErrorZ_ok(long _o); + // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_err")] public static extern long CResult_OfferBolt12ParseErrorZ_err(long _e); + // bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_is_ok")] public static extern bool CResult_OfferBolt12ParseErrorZ_is_ok(long _o); + // void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_free")] public static extern void CResult_OfferBolt12ParseErrorZ_free(long __res); + // uint64_t CResult_OfferBolt12ParseErrorZ_clone_ptr(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_clone_ptr")] public static extern long CResult_OfferBolt12ParseErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_clone")] public static extern long CResult_OfferBolt12ParseErrorZ_clone(long _orig); + // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_ok")] public static extern long CResult_PublicKeyErrorZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_err")] public static extern long CResult_PublicKeyErrorZ_err(Secp256k1Error _e); + // bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_is_ok")] public static extern bool CResult_PublicKeyErrorZ_is_ok(long _o); + // void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_free")] public static extern void CResult_PublicKeyErrorZ_free(long __res); + // uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_clone_ptr")] public static extern long CResult_PublicKeyErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_clone")] public static extern long CResult_PublicKeyErrorZ_clone(long _orig); + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_ok")] public static extern long CResult_NodeIdDecodeErrorZ_ok(long _o); + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_err")] public static extern long CResult_NodeIdDecodeErrorZ_err(long _e); + // bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_is_ok")] public static extern bool CResult_NodeIdDecodeErrorZ_is_ok(long _o); + // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_free")] public static extern void CResult_NodeIdDecodeErrorZ_free(long __res); + // uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeIdDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_clone")] public static extern long CResult_NodeIdDecodeErrorZ_clone(long _orig); + // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_some")] public static extern long COption_NetworkUpdateZ_some(long _o); + // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_none")] public static extern long COption_NetworkUpdateZ_none(); + // void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_free")] public static extern void COption_NetworkUpdateZ_free(long __res); + // uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_clone_ptr")] public static extern long COption_NetworkUpdateZ_clone_ptr(long _arg); + // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_clone")] public static extern long COption_NetworkUpdateZ_clone(long _orig); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_ok")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_err")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_err(long _e); + // bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_free")] public static extern void CResult_COption_NetworkUpdateZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_NetworkUpdateZDecodeErrorZ_clone")] public static extern long CResult_COption_NetworkUpdateZDecodeErrorZ_clone(long _orig); + // struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_UtxoLookupZ_some")] public static extern long COption_UtxoLookupZ_some(long _o); + // struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_UtxoLookupZ_none")] public static extern long COption_UtxoLookupZ_none(); + // void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_UtxoLookupZ_free")] public static extern void COption_UtxoLookupZ_free(long __res); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_ok")] public static extern long CResult_NoneLightningErrorZ_ok(); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_err")] public static extern long CResult_NoneLightningErrorZ_err(long _e); + // bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_is_ok")] public static extern bool CResult_NoneLightningErrorZ_is_ok(long _o); + // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_free")] public static extern void CResult_NoneLightningErrorZ_free(long __res); + // uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_clone_ptr")] public static extern long CResult_NoneLightningErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneLightningErrorZ_clone")] public static extern long CResult_NoneLightningErrorZ_clone(long _orig); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_ok")] public static extern long CResult_boolLightningErrorZ_ok(bool _o); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_err")] public static extern long CResult_boolLightningErrorZ_err(long _e); + // bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_is_ok")] public static extern bool CResult_boolLightningErrorZ_is_ok(long _o); + // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_free")] public static extern void CResult_boolLightningErrorZ_free(long __res); + // uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_clone_ptr")] public static extern long CResult_boolLightningErrorZ_clone_ptr(long _arg); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolLightningErrorZ_clone")] public static extern long CResult_boolLightningErrorZ_clone(long _orig); + // uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(long _arg); + // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(long _orig); + // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new")] public static extern long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(long _a, long _b, long _c); + // void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free")] public static extern void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(long __res); + // struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(long _o); + // struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(); + // void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free")] public static extern void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(long __res); + // uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(long _arg); + // struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone")] public static extern long COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(long _orig); + // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MessageSendEventZ_free")] public static extern void CVec_MessageSendEventZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_ok")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_err")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_err(long _e); + // bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_free")] public static extern void CResult_ChannelUpdateInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateInfoDecodeErrorZ_clone")] public static extern long CResult_ChannelUpdateInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_ok")] public static extern long CResult_ChannelInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_err")] public static extern long CResult_ChannelInfoDecodeErrorZ_err(long _e); + // bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelInfoDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_free")] public static extern void CResult_ChannelInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelInfoDecodeErrorZ_clone")] public static extern long CResult_ChannelInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_ok")] public static extern long CResult_RoutingFeesDecodeErrorZ_ok(long _o); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_err")] public static extern long CResult_RoutingFeesDecodeErrorZ_err(long _e); + // bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_is_ok")] public static extern bool CResult_RoutingFeesDecodeErrorZ_is_ok(long _o); + // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_free")] public static extern void CResult_RoutingFeesDecodeErrorZ_free(long __res); + // uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_clone_ptr")] public static extern long CResult_RoutingFeesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RoutingFeesDecodeErrorZ_clone")] public static extern long CResult_RoutingFeesDecodeErrorZ_clone(long _orig); + // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_NetAddressZ_free")] public static extern void CVec_NetAddressZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_ok")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_err")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_err(long _e); + // bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok")] public static extern bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(long _o); + // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_free")] public static extern void CResult_NodeAnnouncementInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementInfoDecodeErrorZ_clone")] public static extern long CResult_NodeAnnouncementInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_ok")] public static extern long CResult_NodeAliasDecodeErrorZ_ok(long _o); + // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_err")] public static extern long CResult_NodeAliasDecodeErrorZ_err(long _e); + // bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_is_ok")] public static extern bool CResult_NodeAliasDecodeErrorZ_is_ok(long _o); + // void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_free")] public static extern void CResult_NodeAliasDecodeErrorZ_free(long __res); + // uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeAliasDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAliasDecodeErrorZ_clone")] public static extern long CResult_NodeAliasDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_ok")] public static extern long CResult_NodeInfoDecodeErrorZ_ok(long _o); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_err")] public static extern long CResult_NodeInfoDecodeErrorZ_err(long _e); + // bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_is_ok")] public static extern bool CResult_NodeInfoDecodeErrorZ_is_ok(long _o); + // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_free")] public static extern void CResult_NodeInfoDecodeErrorZ_free(long __res); + // uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeInfoDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeInfoDecodeErrorZ_clone")] public static extern long CResult_NodeInfoDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_ok")] public static extern long CResult_NetworkGraphDecodeErrorZ_ok(long _o); + // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_err")] public static extern long CResult_NetworkGraphDecodeErrorZ_err(long _e); + // bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_is_ok")] public static extern bool CResult_NetworkGraphDecodeErrorZ_is_ok(long _o); + // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_free")] public static extern void CResult_NetworkGraphDecodeErrorZ_free(long __res); + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_some")] public static extern long COption_CVec_NetAddressZZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _o); + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_none")] public static extern long COption_CVec_NetAddressZZ_none(); + // void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_free")] public static extern void COption_CVec_NetAddressZZ_free(long __res); + // uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_clone_ptr")] public static extern long COption_CVec_NetAddressZZ_clone_ptr(long _arg); + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_NetAddressZZ_clone")] public static extern long COption_CVec_NetAddressZZ_clone(long _orig); + // struct LDKCOption_PaymentPreimageZ COption_PaymentPreimageZ_some(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentPreimageZ_some")] public static extern long COption_PaymentPreimageZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_PaymentPreimageZ COption_PaymentPreimageZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentPreimageZ_none")] public static extern long COption_PaymentPreimageZ_none(); + // void COption_PaymentPreimageZ_free(struct LDKCOption_PaymentPreimageZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentPreimageZ_free")] public static extern void COption_PaymentPreimageZ_free(long __res); + // uint64_t COption_PaymentPreimageZ_clone_ptr(LDKCOption_PaymentPreimageZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentPreimageZ_clone_ptr")] public static extern long COption_PaymentPreimageZ_clone_ptr(long _arg); + // struct LDKCOption_PaymentPreimageZ COption_PaymentPreimageZ_clone(const struct LDKCOption_PaymentPreimageZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentPreimageZ_clone")] public static extern long COption_PaymentPreimageZ_clone(long _orig); + // void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_HTLCOutputInCommitmentZ_free")] public static extern void CVec_HTLCOutputInCommitmentZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_HTLCDescriptorZ_free")] public static extern void CVec_HTLCDescriptorZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UtxoZ_free")] public static extern void CVec_UtxoZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxOutZ_some")] public static extern long COption_TxOutZ_some(long _o); + // struct LDKCOption_TxOutZ COption_TxOutZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxOutZ_none")] public static extern long COption_TxOutZ_none(); + // void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxOutZ_free")] public static extern void COption_TxOutZ_free(long __res); + // uint64_t COption_TxOutZ_clone_ptr(LDKCOption_TxOutZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxOutZ_clone_ptr")] public static extern long COption_TxOutZ_clone_ptr(long _arg); + // struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxOutZ_clone")] public static extern long COption_TxOutZ_clone(long _orig); + // void CVec_InputZ_free(struct LDKCVec_InputZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_InputZ_free")] public static extern void CVec_InputZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_ok")] public static extern long CResult_CoinSelectionNoneZ_ok(long _o); + // struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_err")] public static extern long CResult_CoinSelectionNoneZ_err(); + // bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_is_ok")] public static extern bool CResult_CoinSelectionNoneZ_is_ok(long _o); + // void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_free")] public static extern void CResult_CoinSelectionNoneZ_free(long __res); + // uint64_t CResult_CoinSelectionNoneZ_clone_ptr(LDKCResult_CoinSelectionNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_clone_ptr")] public static extern long CResult_CoinSelectionNoneZ_clone_ptr(long _arg); + // struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CoinSelectionNoneZ_clone")] public static extern long CResult_CoinSelectionNoneZ_clone(long _orig); + // struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_ok")] public static extern long CResult_CVec_UtxoZNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _o); + // struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_err")] public static extern long CResult_CVec_UtxoZNoneZ_err(); + // bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_is_ok")] public static extern bool CResult_CVec_UtxoZNoneZ_is_ok(long _o); + // void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_free")] public static extern void CResult_CVec_UtxoZNoneZ_free(long __res); + // uint64_t CResult_CVec_UtxoZNoneZ_clone_ptr(LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_clone_ptr")] public static extern long CResult_CVec_UtxoZNoneZ_clone_ptr(long _arg); + // struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_clone")] public static extern long CResult_CVec_UtxoZNoneZ_clone(long _orig); + // struct LDKCOption_u16Z COption_u16Z_some(uint16_t o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_some")] public static extern long COption_u16Z_some(short _o); + // struct LDKCOption_u16Z COption_u16Z_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_none")] public static extern long COption_u16Z_none(); + // void COption_u16Z_free(struct LDKCOption_u16Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_free")] public static extern void COption_u16Z_free(long __res); + // uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_clone_ptr")] public static extern long COption_u16Z_clone_ptr(long _arg); // struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u16Z_clone")] public static extern long COption_u16Z_clone(long _orig); - // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_ok")] public static extern long CResult_NoneAPIErrorZ_ok(); - // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_err")] public static extern long CResult_NoneAPIErrorZ_err(long _e); - // bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_is_ok")] public static extern bool CResult_NoneAPIErrorZ_is_ok(long _o); - // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_free")] public static extern void CResult_NoneAPIErrorZ_free(long __res); - // uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_clone_ptr")] public static extern long CResult_NoneAPIErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneAPIErrorZ_clone")] public static extern long CResult_NoneAPIErrorZ_clone(long _orig); - // void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_CResult_NoneAPIErrorZZ_free")] public static extern void CVec_CResult_NoneAPIErrorZZ_free(long[] __res); - // void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_APIErrorZ_free")] public static extern void CVec_APIErrorZ_free(long[] __res); + // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_some")] public static extern long COption_ChannelShutdownStateZ_some(ChannelShutdownState _o); + // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_none")] public static extern long COption_ChannelShutdownStateZ_none(); + // void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_free")] public static extern void COption_ChannelShutdownStateZ_free(long __res); + // uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone_ptr")] public static extern long COption_ChannelShutdownStateZ_clone_ptr(long _arg); + // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone")] public static extern long COption_ChannelShutdownStateZ_clone(long _orig); + // struct LDKCOption_PaymentHashZ COption_PaymentHashZ_some(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentHashZ_some")] public static extern long COption_PaymentHashZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_PaymentHashZ COption_PaymentHashZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentHashZ_none")] public static extern long COption_PaymentHashZ_none(); + // void COption_PaymentHashZ_free(struct LDKCOption_PaymentHashZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentHashZ_free")] public static extern void COption_PaymentHashZ_free(long __res); + // uint64_t COption_PaymentHashZ_clone_ptr(LDKCOption_PaymentHashZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentHashZ_clone_ptr")] public static extern long COption_PaymentHashZ_clone_ptr(long _arg); + // struct LDKCOption_PaymentHashZ COption_PaymentHashZ_clone(const struct LDKCOption_PaymentHashZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentHashZ_clone")] public static extern long COption_PaymentHashZ_clone(long _orig); // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832APIErrorZ_ok")] public static extern long CResult__u832APIErrorZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832APIErrorZ_ok")] public static extern long CResult__u832APIErrorZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832APIErrorZ_err")] public static extern long CResult__u832APIErrorZ_err(long _e); // bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o); @@ -2529,6 +2836,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832APIErrorZ_clone_ptr")] public static extern long CResult__u832APIErrorZ_clone_ptr(long _arg); // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult__u832APIErrorZ_clone")] public static extern long CResult__u832APIErrorZ_clone(long _orig); + // void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RecentPaymentDetailsZ_free")] public static extern void CVec_RecentPaymentDetailsZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentSendFailureZ_ok")] public static extern long CResult_NonePaymentSendFailureZ_ok(); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); @@ -2541,8 +2850,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentSendFailureZ_clone_ptr")] public static extern long CResult_NonePaymentSendFailureZ_clone_ptr(long _arg); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentSendFailureZ_clone")] public static extern long CResult_NonePaymentSendFailureZ_clone(long _orig); + // struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_ok")] public static extern long CResult_NoneRetryableSendFailureZ_ok(); + // struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_err")] public static extern long CResult_NoneRetryableSendFailureZ_err(RetryableSendFailure _e); + // bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_is_ok")] public static extern bool CResult_NoneRetryableSendFailureZ_is_ok(long _o); + // void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_free")] public static extern void CResult_NoneRetryableSendFailureZ_free(long __res); + // uint64_t CResult_NoneRetryableSendFailureZ_clone_ptr(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_clone_ptr")] public static extern long CResult_NoneRetryableSendFailureZ_clone_ptr(long _arg); + // struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneRetryableSendFailureZ_clone")] public static extern long CResult_NoneRetryableSendFailureZ_clone(long _orig); // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashPaymentSendFailureZ_ok")] public static extern long CResult_PaymentHashPaymentSendFailureZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashPaymentSendFailureZ_ok")] public static extern long CResult_PaymentHashPaymentSendFailureZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashPaymentSendFailureZ_err")] public static extern long CResult_PaymentHashPaymentSendFailureZ_err(long _e); // bool CResult_PaymentHashPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR o); @@ -2553,12 +2874,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashPaymentSendFailureZ_clone_ptr")] public static extern long CResult_PaymentHashPaymentSendFailureZ_clone_ptr(long _arg); // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashPaymentSendFailureZ_clone")] public static extern long CResult_PaymentHashPaymentSendFailureZ_clone(long _orig); + // struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_ok")] public static extern long CResult_PaymentHashRetryableSendFailureZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_err(enum LDKRetryableSendFailure e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_err")] public static extern long CResult_PaymentHashRetryableSendFailureZ_err(RetryableSendFailure _e); + // bool CResult_PaymentHashRetryableSendFailureZ_is_ok(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_is_ok")] public static extern bool CResult_PaymentHashRetryableSendFailureZ_is_ok(long _o); + // void CResult_PaymentHashRetryableSendFailureZ_free(struct LDKCResult_PaymentHashRetryableSendFailureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_free")] public static extern void CResult_PaymentHashRetryableSendFailureZ_free(long __res); + // uint64_t CResult_PaymentHashRetryableSendFailureZ_clone_ptr(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_clone_ptr")] public static extern long CResult_PaymentHashRetryableSendFailureZ_clone_ptr(long _arg); + // struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_clone(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentHashRetryableSendFailureZ_clone")] public static extern long CResult_PaymentHashRetryableSendFailureZ_clone(long _orig); // uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentIdZ_clone_ptr")] public static extern long C2Tuple_PaymentHashPaymentIdZ_clone_ptr(long _arg); // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentIdZ_clone")] public static extern long C2Tuple_PaymentHashPaymentIdZ_clone(long _orig); // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentIdZ_new")] public static extern long C2Tuple_PaymentHashPaymentIdZ_new(byte[] _a, byte[] _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentIdZ_new")] public static extern long C2Tuple_PaymentHashPaymentIdZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _b); // void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentIdZ_free")] public static extern void C2Tuple_PaymentHashPaymentIdZ_free(long __res); // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o); @@ -2574,13 +2907,13 @@ internal class bindings { // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone")] public static extern long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(long _orig); // void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ThirtyTwoBytesZ_free")] public static extern void CVec_ThirtyTwoBytesZ_free(byte[][] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ThirtyTwoBytesZ_free")] public static extern void CVec_ThirtyTwoBytesZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); // uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr")] public static extern long C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(long _arg); // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentSecretZ_clone")] public static extern long C2Tuple_PaymentHashPaymentSecretZ_clone(long _orig); // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentSecretZ_new")] public static extern long C2Tuple_PaymentHashPaymentSecretZ_new(byte[] _a, byte[] _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentSecretZ_new")] public static extern long C2Tuple_PaymentHashPaymentSecretZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _b); // void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PaymentHashPaymentSecretZ_free")] public static extern void C2Tuple_PaymentHashPaymentSecretZ_free(long __res); // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o); @@ -2595,20 +2928,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(long _arg); // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(long _orig); - // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(long _o); - // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(long _e); - // bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok")] public static extern bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(long _o); - // void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free")] public static extern void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(long __res); - // uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(long _arg); - // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone")] public static extern long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(long _orig); // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretNoneZ_ok")] public static extern long CResult_PaymentSecretNoneZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretNoneZ_ok")] public static extern long CResult_PaymentSecretNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretNoneZ_err")] public static extern long CResult_PaymentSecretNoneZ_err(); // bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o); @@ -2619,20 +2940,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretNoneZ_clone_ptr")] public static extern long CResult_PaymentSecretNoneZ_clone_ptr(long _arg); // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretNoneZ_clone")] public static extern long CResult_PaymentSecretNoneZ_clone(long _orig); - // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_ok")] public static extern long CResult_PaymentSecretAPIErrorZ_ok(byte[] _o); - // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_err")] public static extern long CResult_PaymentSecretAPIErrorZ_err(long _e); - // bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_is_ok")] public static extern bool CResult_PaymentSecretAPIErrorZ_is_ok(long _o); - // void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_free")] public static extern void CResult_PaymentSecretAPIErrorZ_free(long __res); - // uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_clone_ptr")] public static extern long CResult_PaymentSecretAPIErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentSecretAPIErrorZ_clone")] public static extern long CResult_PaymentSecretAPIErrorZ_clone(long _orig); // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPreimageAPIErrorZ_ok")] public static extern long CResult_PaymentPreimageAPIErrorZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPreimageAPIErrorZ_ok")] public static extern long CResult_PaymentPreimageAPIErrorZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPreimageAPIErrorZ_err")] public static extern long CResult_PaymentPreimageAPIErrorZ_err(long _e); // bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o); @@ -2643,6 +2952,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPreimageAPIErrorZ_clone_ptr")] public static extern long CResult_PaymentPreimageAPIErrorZ_clone_ptr(long _arg); // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPreimageAPIErrorZ_clone")] public static extern long CResult_PaymentPreimageAPIErrorZ_clone(long _orig); + // struct LDKCOption_CVec_ChainHashZZ COption_CVec_ChainHashZZ_some(struct LDKCVec_ChainHashZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_ChainHashZZ_some")] public static extern long COption_CVec_ChainHashZZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _o); + // struct LDKCOption_CVec_ChainHashZZ COption_CVec_ChainHashZZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_ChainHashZZ_none")] public static extern long COption_CVec_ChainHashZZ_none(); + // void COption_CVec_ChainHashZZ_free(struct LDKCOption_CVec_ChainHashZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_ChainHashZZ_free")] public static extern void COption_CVec_ChainHashZZ_free(long __res); + // uint64_t COption_CVec_ChainHashZZ_clone_ptr(LDKCOption_CVec_ChainHashZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_ChainHashZZ_clone_ptr")] public static extern long COption_CVec_ChainHashZZ_clone_ptr(long _arg); + // struct LDKCOption_CVec_ChainHashZZ COption_CVec_ChainHashZZ_clone(const struct LDKCOption_CVec_ChainHashZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_ChainHashZZ_clone")] public static extern long COption_CVec_ChainHashZZ_clone(long _orig); // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok")] public static extern long CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(long _o); // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e); @@ -2691,10 +3010,22 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr")] public static extern long CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_clone")] public static extern long CResult_PhantomRouteHintsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_ok")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_ok(ChannelShutdownState _o); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_err")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_err(long _e); + // bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free")] public static extern void CResult_ChannelShutdownStateDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_clone")] public static extern long CResult_ChannelShutdownStateDecodeErrorZ_clone(long _orig); // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChannelMonitorZ_free")] public static extern void CVec_ChannelMonitorZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChannelMonitorZ_free")] public static extern void CVec_ChannelMonitorZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelManagerZ_new")] public static extern long C2Tuple_BlockHashChannelManagerZ_new(byte[] _a, long _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelManagerZ_new")] public static extern long C2Tuple_BlockHashChannelManagerZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, long _b); // void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelManagerZ_free")] public static extern void C2Tuple_BlockHashChannelManagerZ_free(long __res); // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); @@ -2705,6 +3036,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok")] public static extern bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(long _o); // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free")] public static extern void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(long __res); + // struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_ok")] public static extern long CResult_MaxDustHTLCExposureDecodeErrorZ_ok(long _o); + // struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_err")] public static extern long CResult_MaxDustHTLCExposureDecodeErrorZ_err(long _e); + // bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok")] public static extern bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(long _o); + // void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_free")] public static extern void CResult_MaxDustHTLCExposureDecodeErrorZ_free(long __res); + // uint64_t CResult_MaxDustHTLCExposureDecodeErrorZ_clone_ptr(LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_clone_ptr")] public static extern long CResult_MaxDustHTLCExposureDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_MaxDustHTLCExposureDecodeErrorZ_clone")] public static extern long CResult_MaxDustHTLCExposureDecodeErrorZ_clone(long _orig); // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelConfigDecodeErrorZ_ok")] public static extern long CResult_ChannelConfigDecodeErrorZ_ok(long _o); // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e); @@ -2717,88 +3060,38 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelConfigDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelConfigDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelConfigDecodeErrorZ_clone")] public static extern long CResult_ChannelConfigDecodeErrorZ_clone(long _orig); - // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_ok")] public static extern long CResult_OutPointDecodeErrorZ_ok(long _o); - // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_err")] public static extern long CResult_OutPointDecodeErrorZ_err(long _e); - // bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_is_ok")] public static extern bool CResult_OutPointDecodeErrorZ_is_ok(long _o); - // void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_free")] public static extern void CResult_OutPointDecodeErrorZ_free(long __res); - // uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_clone_ptr")] public static extern long CResult_OutPointDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_clone")] public static extern long CResult_OutPointDecodeErrorZ_clone(long _orig); - // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_some")] public static extern long COption_TypeZ_some(long _o); - // struct LDKCOption_TypeZ COption_TypeZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_none")] public static extern long COption_TypeZ_none(); - // void COption_TypeZ_free(struct LDKCOption_TypeZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_free")] public static extern void COption_TypeZ_free(long __res); - // uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_clone_ptr")] public static extern long COption_TypeZ_clone_ptr(long _arg); - // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_clone")] public static extern long COption_TypeZ_clone(long _orig); - // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_ok")] public static extern long CResult_COption_TypeZDecodeErrorZ_ok(long _o); - // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_err")] public static extern long CResult_COption_TypeZDecodeErrorZ_err(long _e); - // bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_TypeZDecodeErrorZ_is_ok(long _o); - // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_free")] public static extern void CResult_COption_TypeZDecodeErrorZ_free(long __res); - // uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_TypeZDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_clone")] public static extern long CResult_COption_TypeZDecodeErrorZ_clone(long _orig); - // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_ok")] public static extern long CResult_PaymentIdPaymentErrorZ_ok(byte[] _o); - // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_err")] public static extern long CResult_PaymentIdPaymentErrorZ_err(long _e); - // bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_is_ok")] public static extern bool CResult_PaymentIdPaymentErrorZ_is_ok(long _o); - // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_free")] public static extern void CResult_PaymentIdPaymentErrorZ_free(long __res); - // uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_clone_ptr")] public static extern long CResult_PaymentIdPaymentErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_clone")] public static extern long CResult_PaymentIdPaymentErrorZ_clone(long _orig); - // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_ok")] public static extern long CResult_NonePaymentErrorZ_ok(); - // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_err")] public static extern long CResult_NonePaymentErrorZ_err(long _e); - // bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_is_ok")] public static extern bool CResult_NonePaymentErrorZ_is_ok(long _o); - // void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_free")] public static extern void CResult_NonePaymentErrorZ_free(long __res); - // uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_clone_ptr")] public static extern long CResult_NonePaymentErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_clone")] public static extern long CResult_NonePaymentErrorZ_clone(long _orig); - // struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_ok")] public static extern long CResult_StringErrorZ_ok(string _o); - // struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_err")] public static extern long CResult_StringErrorZ_err(Secp256k1Error _e); - // bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_is_ok")] public static extern bool CResult_StringErrorZ_is_ok(long _o); - // void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_free")] public static extern void CResult_StringErrorZ_free(long __res); - // uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_clone_ptr")] public static extern long CResult_StringErrorZ_clone_ptr(long _arg); - // struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_clone")] public static extern long CResult_StringErrorZ_clone(long _orig); - // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_ok")] public static extern long CResult_PublicKeyErrorZ_ok(byte[] _o); - // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_err")] public static extern long CResult_PublicKeyErrorZ_err(Secp256k1Error _e); - // bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_is_ok")] public static extern bool CResult_PublicKeyErrorZ_is_ok(long _o); - // void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_free")] public static extern void CResult_PublicKeyErrorZ_free(long __res); - // uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_clone_ptr")] public static extern long CResult_PublicKeyErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeyErrorZ_clone")] public static extern long CResult_PublicKeyErrorZ_clone(long _orig); + // struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MaxDustHTLCExposureZ_some")] public static extern long COption_MaxDustHTLCExposureZ_some(long _o); + // struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MaxDustHTLCExposureZ_none")] public static extern long COption_MaxDustHTLCExposureZ_none(); + // void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MaxDustHTLCExposureZ_free")] public static extern void COption_MaxDustHTLCExposureZ_free(long __res); + // uint64_t COption_MaxDustHTLCExposureZ_clone_ptr(LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MaxDustHTLCExposureZ_clone_ptr")] public static extern long COption_MaxDustHTLCExposureZ_clone_ptr(long _arg); + // struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_MaxDustHTLCExposureZ_clone")] public static extern long COption_MaxDustHTLCExposureZ_clone(long _orig); + // struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_APIErrorZ_some")] public static extern long COption_APIErrorZ_some(long _o); + // struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_APIErrorZ_none")] public static extern long COption_APIErrorZ_none(); + // void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_APIErrorZ_free")] public static extern void COption_APIErrorZ_free(long __res); + // uint64_t COption_APIErrorZ_clone_ptr(LDKCOption_APIErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_APIErrorZ_clone_ptr")] public static extern long COption_APIErrorZ_clone_ptr(long _arg); + // struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_APIErrorZ_clone")] public static extern long COption_APIErrorZ_clone(long _orig); + // struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_ok")] public static extern long CResult_COption_APIErrorZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_err")] public static extern long CResult_COption_APIErrorZDecodeErrorZ_err(long _e); + // bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_free")] public static extern void CResult_COption_APIErrorZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_APIErrorZDecodeErrorZ_clone")] public static extern long CResult_COption_APIErrorZDecodeErrorZ_clone(long _orig); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelMonitorUpdateDecodeErrorZ_ok")] public static extern long CResult_ChannelMonitorUpdateDecodeErrorZ_ok(long _o); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); @@ -2850,7 +3143,7 @@ internal class bindings { // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointScriptZ_clone")] public static extern long C2Tuple_OutPointScriptZ_clone(long _orig); // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointScriptZ_new")] public static extern long C2Tuple_OutPointScriptZ_new(long _a, byte[] _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointScriptZ_new")] public static extern long C2Tuple_OutPointScriptZ_new(long _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _b); // void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointScriptZ_free")] public static extern void C2Tuple_OutPointScriptZ_free(long __res); // uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg); @@ -2858,25 +3151,23 @@ internal class bindings { // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32ScriptZ_clone")] public static extern long C2Tuple_u32ScriptZ_clone(long _orig); // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32ScriptZ_new")] public static extern long C2Tuple_u32ScriptZ_new(int _a, byte[] _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32ScriptZ_new")] public static extern long C2Tuple_u32ScriptZ_new(int _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _b); // void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32ScriptZ_free")] public static extern void C2Tuple_u32ScriptZ_free(long __res); // void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_u32ScriptZZ_free")] public static extern void CVec_C2Tuple_u32ScriptZZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_u32ScriptZZ_free")] public static extern void CVec_C2Tuple_u32ScriptZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(long _arg); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(long _orig); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(byte[] _a, long[] _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _b); // void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free")] public static extern void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(long __res); // void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free")] public static extern void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(long[] __res); - // void CVec_EventZ_free(struct LDKCVec_EventZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_EventZ_free")] public static extern void CVec_EventZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free")] public static extern void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_TransactionZ_free")] public static extern void CVec_TransactionZ_free(byte[][] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_TransactionZ_free")] public static extern void CVec_TransactionZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); // uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32TxOutZ_clone_ptr")] public static extern long C2Tuple_u32TxOutZ_clone_ptr(long _arg); // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig); @@ -2886,19 +3177,27 @@ internal class bindings { // void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32TxOutZ_free")] public static extern void C2Tuple_u32TxOutZ_free(long __res); // void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_u32TxOutZZ_free")] public static extern void CVec_C2Tuple_u32TxOutZZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_u32TxOutZZ_free")] public static extern void CVec_C2Tuple_u32TxOutZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(long _arg); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(long _orig); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(byte[] _a, long[] _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new")] public static extern long C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _b); // void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free")] public static extern void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(long __res); // void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free")] public static extern void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free")] public static extern void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_BalanceZ_free")] public static extern void CVec_BalanceZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_BalanceZ_free")] public static extern void CVec_BalanceZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_clone_ptr")] public static extern long C2Tuple_BlockHashChannelMonitorZ_clone_ptr(long _arg); + // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_clone(const struct LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_clone")] public static extern long C2Tuple_BlockHashChannelMonitorZ_clone(long _orig); + // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_new")] public static extern long C2Tuple_BlockHashChannelMonitorZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, long _b); + // void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_free")] public static extern void C2Tuple_BlockHashChannelMonitorZ_free(long __res); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok")] public static extern long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(long _o); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e); @@ -2916,11 +3215,21 @@ internal class bindings { // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_clone")] public static extern long C2Tuple_PublicKeyTypeZ_clone(long _orig); // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_new")] public static extern long C2Tuple_PublicKeyTypeZ_new(byte[] _a, long _b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_new")] public static extern long C2Tuple_PublicKeyTypeZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, long _b); // void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyTypeZ_free")] public static extern void C2Tuple_PublicKeyTypeZ_free(long __res); // void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_PublicKeyTypeZZ_free")] public static extern void CVec_C2Tuple_PublicKeyTypeZZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_PublicKeyTypeZZ_free")] public static extern void CVec_C2Tuple_PublicKeyTypeZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_some")] public static extern long COption_OffersMessageZ_some(long _o); + // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_none")] public static extern long COption_OffersMessageZ_none(); + // void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_free")] public static extern void COption_OffersMessageZ_free(long __res); + // uint64_t COption_OffersMessageZ_clone_ptr(LDKCOption_OffersMessageZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_clone_ptr")] public static extern long COption_OffersMessageZ_clone_ptr(long _arg); + // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_clone")] public static extern long COption_OffersMessageZ_clone(long _orig); // struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CustomOnionMessageContentsZ_some")] public static extern long COption_CustomOnionMessageContentsZ_some(long _o); // struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void); @@ -2943,6 +3252,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone")] public static extern long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(long _orig); + // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_some")] public static extern long COption_TypeZ_some(long _o); + // struct LDKCOption_TypeZ COption_TypeZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_none")] public static extern long COption_TypeZ_none(); + // void COption_TypeZ_free(struct LDKCOption_TypeZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_free")] public static extern void COption_TypeZ_free(long __res); + // uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_clone_ptr")] public static extern long COption_TypeZ_clone_ptr(long _arg); + // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TypeZ_clone")] public static extern long COption_TypeZ_clone(long _orig); + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_ok")] public static extern long CResult_COption_TypeZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_err")] public static extern long CResult_COption_TypeZDecodeErrorZ_err(long _e); + // bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_TypeZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_free")] public static extern void CResult_COption_TypeZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_TypeZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_clone")] public static extern long CResult_COption_TypeZDecodeErrorZ_clone(long _orig); // struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetAddressZ_some")] public static extern long COption_NetAddressZ_some(long _o); // struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void); @@ -2953,8 +3284,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetAddressZ_clone_ptr")] public static extern long COption_NetAddressZ_clone_ptr(long _arg); // struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetAddressZ_clone")] public static extern long COption_NetAddressZ_clone(long _orig); + // uint64_t C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr")] public static extern long C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(long _arg); + // struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_NetAddressZZ_clone")] public static extern long C2Tuple_PublicKeyCOption_NetAddressZZ_clone(long _orig); + // struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_NetAddressZ b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_NetAddressZZ_new")] public static extern long C2Tuple_PublicKeyCOption_NetAddressZZ_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a, long _b); + // void C2Tuple_PublicKeyCOption_NetAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_NetAddressZZ_free")] public static extern void C2Tuple_PublicKeyCOption_NetAddressZZ_free(long __res); + // void CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free")] public static extern void CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_ok")] public static extern long CResult_CVec_u8ZPeerHandleErrorZ_ok(byte[] _o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_ok")] public static extern long CResult_CVec_u8ZPeerHandleErrorZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_err")] public static extern long CResult_CVec_u8ZPeerHandleErrorZ_err(long _e); // bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o); @@ -2987,134 +3328,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolPeerHandleErrorZ_free")] public static extern void CResult_boolPeerHandleErrorZ_free(long __res); // uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolPeerHandleErrorZ_clone_ptr")] public static extern long CResult_boolPeerHandleErrorZ_clone_ptr(long _arg); - // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolPeerHandleErrorZ_clone")] public static extern long CResult_boolPeerHandleErrorZ_clone(long _orig); - // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_ok")] public static extern long CResult_NoneSendErrorZ_ok(); - // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_err")] public static extern long CResult_NoneSendErrorZ_err(long _e); - // bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_is_ok")] public static extern bool CResult_NoneSendErrorZ_is_ok(long _o); - // void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_free")] public static extern void CResult_NoneSendErrorZ_free(long __res); - // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_ok")] public static extern long CResult_SiPrefixParseErrorZ_ok(SiPrefix _o); - // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_err")] public static extern long CResult_SiPrefixParseErrorZ_err(long _e); - // bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_is_ok")] public static extern bool CResult_SiPrefixParseErrorZ_is_ok(long _o); - // void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_free")] public static extern void CResult_SiPrefixParseErrorZ_free(long __res); - // uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_clone_ptr")] public static extern long CResult_SiPrefixParseErrorZ_clone_ptr(long _arg); - // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixParseErrorZ_clone")] public static extern long CResult_SiPrefixParseErrorZ_clone(long _orig); - // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_ok")] public static extern long CResult_InvoiceParseOrSemanticErrorZ_ok(long _o); - // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_err")] public static extern long CResult_InvoiceParseOrSemanticErrorZ_err(long _e); - // bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_is_ok")] public static extern bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(long _o); - // void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_free")] public static extern void CResult_InvoiceParseOrSemanticErrorZ_free(long __res); - // uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr")] public static extern long CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(long _arg); - // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceParseOrSemanticErrorZ_clone")] public static extern long CResult_InvoiceParseOrSemanticErrorZ_clone(long _orig); - // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_ok")] public static extern long CResult_SignedRawInvoiceParseErrorZ_ok(long _o); - // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_err")] public static extern long CResult_SignedRawInvoiceParseErrorZ_err(long _e); - // bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_is_ok")] public static extern bool CResult_SignedRawInvoiceParseErrorZ_is_ok(long _o); - // void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_free")] public static extern void CResult_SignedRawInvoiceParseErrorZ_free(long __res); - // uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_clone_ptr")] public static extern long CResult_SignedRawInvoiceParseErrorZ_clone_ptr(long _arg); - // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawInvoiceParseErrorZ_clone")] public static extern long CResult_SignedRawInvoiceParseErrorZ_clone(long _orig); - // uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr")] public static extern long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(long _arg); - // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone")] public static extern long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(long _orig); - // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new")] public static extern long C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(long _a, byte[] _b, long _c); - // void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free")] public static extern void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(long __res); - // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_ok")] public static extern long CResult_PayeePubKeyErrorZ_ok(long _o); - // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_err")] public static extern long CResult_PayeePubKeyErrorZ_err(Secp256k1Error _e); - // bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_is_ok")] public static extern bool CResult_PayeePubKeyErrorZ_is_ok(long _o); - // void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_free")] public static extern void CResult_PayeePubKeyErrorZ_free(long __res); - // uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_clone_ptr")] public static extern long CResult_PayeePubKeyErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_clone")] public static extern long CResult_PayeePubKeyErrorZ_clone(long _orig); - // void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PrivateRouteZ_free")] public static extern void CVec_PrivateRouteZ_free(long[] __res); - // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_ok")] public static extern long CResult_PositiveTimestampCreationErrorZ_ok(long _o); - // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_err")] public static extern long CResult_PositiveTimestampCreationErrorZ_err(CreationError _e); - // bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_is_ok")] public static extern bool CResult_PositiveTimestampCreationErrorZ_is_ok(long _o); - // void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_free")] public static extern void CResult_PositiveTimestampCreationErrorZ_free(long __res); - // uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone_ptr")] public static extern long CResult_PositiveTimestampCreationErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone")] public static extern long CResult_PositiveTimestampCreationErrorZ_clone(long _orig); - // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_ok")] public static extern long CResult_NoneSemanticErrorZ_ok(); - // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_err")] public static extern long CResult_NoneSemanticErrorZ_err(SemanticError _e); - // bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_is_ok")] public static extern bool CResult_NoneSemanticErrorZ_is_ok(long _o); - // void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_free")] public static extern void CResult_NoneSemanticErrorZ_free(long __res); - // uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_clone_ptr")] public static extern long CResult_NoneSemanticErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSemanticErrorZ_clone")] public static extern long CResult_NoneSemanticErrorZ_clone(long _orig); - // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_ok")] public static extern long CResult_InvoiceSemanticErrorZ_ok(long _o); - // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_err")] public static extern long CResult_InvoiceSemanticErrorZ_err(SemanticError _e); - // bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_is_ok")] public static extern bool CResult_InvoiceSemanticErrorZ_is_ok(long _o); - // void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_free")] public static extern void CResult_InvoiceSemanticErrorZ_free(long __res); - // uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_clone_ptr")] public static extern long CResult_InvoiceSemanticErrorZ_clone_ptr(long _arg); - // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSemanticErrorZ_clone")] public static extern long CResult_InvoiceSemanticErrorZ_clone(long _orig); - // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_ok")] public static extern long CResult_DescriptionCreationErrorZ_ok(long _o); - // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_err")] public static extern long CResult_DescriptionCreationErrorZ_err(CreationError _e); - // bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_is_ok")] public static extern bool CResult_DescriptionCreationErrorZ_is_ok(long _o); - // void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_free")] public static extern void CResult_DescriptionCreationErrorZ_free(long __res); - // uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_clone_ptr")] public static extern long CResult_DescriptionCreationErrorZ_clone_ptr(long _arg); - // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_clone")] public static extern long CResult_DescriptionCreationErrorZ_clone(long _orig); - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_ok")] public static extern long CResult_PrivateRouteCreationErrorZ_ok(long _o); - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_err")] public static extern long CResult_PrivateRouteCreationErrorZ_err(CreationError _e); - // bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_is_ok")] public static extern bool CResult_PrivateRouteCreationErrorZ_is_ok(long _o); - // void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_free")] public static extern void CResult_PrivateRouteCreationErrorZ_free(long __res); - // uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_clone_ptr")] public static extern long CResult_PrivateRouteCreationErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_clone")] public static extern long CResult_PrivateRouteCreationErrorZ_clone(long _orig); + // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_boolPeerHandleErrorZ_clone")] public static extern long CResult_boolPeerHandleErrorZ_clone(long _orig); // struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u32GraphSyncErrorZ_ok")] public static extern long CResult_u32GraphSyncErrorZ_ok(int _o); // struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e); @@ -3123,6 +3338,66 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u32GraphSyncErrorZ_is_ok")] public static extern bool CResult_u32GraphSyncErrorZ_is_ok(long _o); // void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u32GraphSyncErrorZ_free")] public static extern void CResult_u32GraphSyncErrorZ_free(long __res); + // struct LDKCOption_KeyPairZ COption_KeyPairZ_some(struct LDKSecretKey o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_KeyPairZ_some")] public static extern long COption_KeyPairZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_KeyPairZ COption_KeyPairZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_KeyPairZ_none")] public static extern long COption_KeyPairZ_none(); + // void COption_KeyPairZ_free(struct LDKCOption_KeyPairZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_KeyPairZ_free")] public static extern void COption_KeyPairZ_free(long __res); + // uint64_t COption_KeyPairZ_clone_ptr(LDKCOption_KeyPairZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_KeyPairZ_clone_ptr")] public static extern long COption_KeyPairZ_clone_ptr(long _arg); + // struct LDKCOption_KeyPairZ COption_KeyPairZ_clone(const struct LDKCOption_KeyPairZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_KeyPairZ_clone")] public static extern long COption_KeyPairZ_clone(long _orig); + // struct LDKCResult_COption_KeyPairZNoneZ CResult_COption_KeyPairZNoneZ_ok(struct LDKCOption_KeyPairZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_ok")] public static extern long CResult_COption_KeyPairZNoneZ_ok(long _o); + // struct LDKCResult_COption_KeyPairZNoneZ CResult_COption_KeyPairZNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_err")] public static extern long CResult_COption_KeyPairZNoneZ_err(); + // bool CResult_COption_KeyPairZNoneZ_is_ok(const struct LDKCResult_COption_KeyPairZNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_is_ok")] public static extern bool CResult_COption_KeyPairZNoneZ_is_ok(long _o); + // void CResult_COption_KeyPairZNoneZ_free(struct LDKCResult_COption_KeyPairZNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_free")] public static extern void CResult_COption_KeyPairZNoneZ_free(long __res); + // uint64_t CResult_COption_KeyPairZNoneZ_clone_ptr(LDKCResult_COption_KeyPairZNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_clone_ptr")] public static extern long CResult_COption_KeyPairZNoneZ_clone_ptr(long _arg); + // struct LDKCResult_COption_KeyPairZNoneZ CResult_COption_KeyPairZNoneZ_clone(const struct LDKCResult_COption_KeyPairZNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_KeyPairZNoneZ_clone")] public static extern long CResult_COption_KeyPairZNoneZ_clone(long _orig); + // struct LDKCOption_ScriptZ COption_ScriptZ_some(struct LDKCVec_u8Z o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScriptZ_some")] public static extern long COption_ScriptZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_ScriptZ COption_ScriptZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScriptZ_none")] public static extern long COption_ScriptZ_none(); + // void COption_ScriptZ_free(struct LDKCOption_ScriptZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScriptZ_free")] public static extern void COption_ScriptZ_free(long __res); + // uint64_t COption_ScriptZ_clone_ptr(LDKCOption_ScriptZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScriptZ_clone_ptr")] public static extern long COption_ScriptZ_clone_ptr(long _arg); + // struct LDKCOption_ScriptZ COption_ScriptZ_clone(const struct LDKCOption_ScriptZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ScriptZ_clone")] public static extern long COption_ScriptZ_clone(long _orig); + // enum LDKCOption_NoneZ COption_NoneZ_some(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_some")] public static extern COption_NoneZ COption_NoneZ_some(); + // enum LDKCOption_NoneZ COption_NoneZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_none")] public static extern COption_NoneZ COption_NoneZ_none(); + // void COption_NoneZ_free(enum LDKCOption_NoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_free")] public static extern void COption_NoneZ_free(COption_NoneZ __res); + // void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_WitnessZ_free")] public static extern void CVec_WitnessZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] __res); + // struct LDKCOption_i64Z COption_i64Z_some(int64_t o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_i64Z_some")] public static extern long COption_i64Z_some(long _o); + // struct LDKCOption_i64Z COption_i64Z_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_i64Z_none")] public static extern long COption_i64Z_none(); + // void COption_i64Z_free(struct LDKCOption_i64Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_i64Z_free")] public static extern void COption_i64Z_free(long __res); + // uint64_t COption_i64Z_clone_ptr(LDKCOption_i64Z *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_i64Z_clone_ptr")] public static extern long COption_i64Z_clone_ptr(long _arg); + // struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_i64Z_clone")] public static extern long COption_i64Z_clone(long _orig); + // struct LDKCOption_TxidZ COption_TxidZ_some(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxidZ_some")] public static extern long COption_TxidZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_TxidZ COption_TxidZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxidZ_none")] public static extern long COption_TxidZ_none(); + // void COption_TxidZ_free(struct LDKCOption_TxidZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxidZ_free")] public static extern void COption_TxidZ_free(long __res); + // uint64_t COption_TxidZ_clone_ptr(LDKCOption_TxidZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxidZ_clone_ptr")] public static extern long COption_TxidZ_clone_ptr(long _arg); + // struct LDKCOption_TxidZ COption_TxidZ_clone(const struct LDKCOption_TxidZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_TxidZ_clone")] public static extern long COption_TxidZ_clone(long _orig); // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetAddressDecodeErrorZ_ok")] public static extern long CResult_NetAddressDecodeErrorZ_ok(long _o); // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e); @@ -3136,13 +3411,13 @@ internal class bindings { // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetAddressDecodeErrorZ_clone")] public static extern long CResult_NetAddressDecodeErrorZ_clone(long _orig); // void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateAddHTLCZ_free")] public static extern void CVec_UpdateAddHTLCZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateAddHTLCZ_free")] public static extern void CVec_UpdateAddHTLCZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateFulfillHTLCZ_free")] public static extern void CVec_UpdateFulfillHTLCZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateFulfillHTLCZ_free")] public static extern void CVec_UpdateFulfillHTLCZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateFailHTLCZ_free")] public static extern void CVec_UpdateFailHTLCZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateFailHTLCZ_free")] public static extern void CVec_UpdateFailHTLCZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateFailMalformedHTLCZ_free")] public static extern void CVec_UpdateFailMalformedHTLCZ_free(long[] __res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_UpdateFailMalformedHTLCZ_free")] public static extern void CVec_UpdateFailMalformedHTLCZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelDecodeErrorZ_ok")] public static extern long CResult_AcceptChannelDecodeErrorZ_ok(long _o); // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e); @@ -3155,6 +3430,126 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelDecodeErrorZ_clone_ptr")] public static extern long CResult_AcceptChannelDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelDecodeErrorZ_clone")] public static extern long CResult_AcceptChannelDecodeErrorZ_clone(long _orig); + // struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_ok")] public static extern long CResult_AcceptChannelV2DecodeErrorZ_ok(long _o); + // struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_err")] public static extern long CResult_AcceptChannelV2DecodeErrorZ_err(long _e); + // bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_is_ok")] public static extern bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(long _o); + // void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_free")] public static extern void CResult_AcceptChannelV2DecodeErrorZ_free(long __res); + // uint64_t CResult_AcceptChannelV2DecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_clone_ptr")] public static extern long CResult_AcceptChannelV2DecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_clone")] public static extern long CResult_AcceptChannelV2DecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_ok")] public static extern long CResult_TxAddInputDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_err")] public static extern long CResult_TxAddInputDecodeErrorZ_err(long _e); + // bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_is_ok")] public static extern bool CResult_TxAddInputDecodeErrorZ_is_ok(long _o); + // void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_free")] public static extern void CResult_TxAddInputDecodeErrorZ_free(long __res); + // uint64_t CResult_TxAddInputDecodeErrorZ_clone_ptr(LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_clone_ptr")] public static extern long CResult_TxAddInputDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddInputDecodeErrorZ_clone")] public static extern long CResult_TxAddInputDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_ok")] public static extern long CResult_TxAddOutputDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_err")] public static extern long CResult_TxAddOutputDecodeErrorZ_err(long _e); + // bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_is_ok")] public static extern bool CResult_TxAddOutputDecodeErrorZ_is_ok(long _o); + // void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_free")] public static extern void CResult_TxAddOutputDecodeErrorZ_free(long __res); + // uint64_t CResult_TxAddOutputDecodeErrorZ_clone_ptr(LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_clone_ptr")] public static extern long CResult_TxAddOutputDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAddOutputDecodeErrorZ_clone")] public static extern long CResult_TxAddOutputDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_ok")] public static extern long CResult_TxRemoveInputDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_err")] public static extern long CResult_TxRemoveInputDecodeErrorZ_err(long _e); + // bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_is_ok")] public static extern bool CResult_TxRemoveInputDecodeErrorZ_is_ok(long _o); + // void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_free")] public static extern void CResult_TxRemoveInputDecodeErrorZ_free(long __res); + // uint64_t CResult_TxRemoveInputDecodeErrorZ_clone_ptr(LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_clone_ptr")] public static extern long CResult_TxRemoveInputDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveInputDecodeErrorZ_clone")] public static extern long CResult_TxRemoveInputDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_ok")] public static extern long CResult_TxRemoveOutputDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_err")] public static extern long CResult_TxRemoveOutputDecodeErrorZ_err(long _e); + // bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_is_ok")] public static extern bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(long _o); + // void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_free")] public static extern void CResult_TxRemoveOutputDecodeErrorZ_free(long __res); + // uint64_t CResult_TxRemoveOutputDecodeErrorZ_clone_ptr(LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_clone_ptr")] public static extern long CResult_TxRemoveOutputDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxRemoveOutputDecodeErrorZ_clone")] public static extern long CResult_TxRemoveOutputDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_ok")] public static extern long CResult_TxCompleteDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_err")] public static extern long CResult_TxCompleteDecodeErrorZ_err(long _e); + // bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_is_ok")] public static extern bool CResult_TxCompleteDecodeErrorZ_is_ok(long _o); + // void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_free")] public static extern void CResult_TxCompleteDecodeErrorZ_free(long __res); + // uint64_t CResult_TxCompleteDecodeErrorZ_clone_ptr(LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_clone_ptr")] public static extern long CResult_TxCompleteDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCompleteDecodeErrorZ_clone")] public static extern long CResult_TxCompleteDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_ok")] public static extern long CResult_TxSignaturesDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_err")] public static extern long CResult_TxSignaturesDecodeErrorZ_err(long _e); + // bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_is_ok")] public static extern bool CResult_TxSignaturesDecodeErrorZ_is_ok(long _o); + // void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_free")] public static extern void CResult_TxSignaturesDecodeErrorZ_free(long __res); + // uint64_t CResult_TxSignaturesDecodeErrorZ_clone_ptr(LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_TxSignaturesDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxSignaturesDecodeErrorZ_clone")] public static extern long CResult_TxSignaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_ok")] public static extern long CResult_TxInitRbfDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_err")] public static extern long CResult_TxInitRbfDecodeErrorZ_err(long _e); + // bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_is_ok")] public static extern bool CResult_TxInitRbfDecodeErrorZ_is_ok(long _o); + // void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_free")] public static extern void CResult_TxInitRbfDecodeErrorZ_free(long __res); + // uint64_t CResult_TxInitRbfDecodeErrorZ_clone_ptr(LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_clone_ptr")] public static extern long CResult_TxInitRbfDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxInitRbfDecodeErrorZ_clone")] public static extern long CResult_TxInitRbfDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_ok")] public static extern long CResult_TxAckRbfDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_err")] public static extern long CResult_TxAckRbfDecodeErrorZ_err(long _e); + // bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_is_ok")] public static extern bool CResult_TxAckRbfDecodeErrorZ_is_ok(long _o); + // void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_free")] public static extern void CResult_TxAckRbfDecodeErrorZ_free(long __res); + // uint64_t CResult_TxAckRbfDecodeErrorZ_clone_ptr(LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_clone_ptr")] public static extern long CResult_TxAckRbfDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAckRbfDecodeErrorZ_clone")] public static extern long CResult_TxAckRbfDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_ok")] public static extern long CResult_TxAbortDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_err")] public static extern long CResult_TxAbortDecodeErrorZ_err(long _e); + // bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_is_ok")] public static extern bool CResult_TxAbortDecodeErrorZ_is_ok(long _o); + // void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_free")] public static extern void CResult_TxAbortDecodeErrorZ_free(long __res); + // uint64_t CResult_TxAbortDecodeErrorZ_clone_ptr(LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_clone_ptr")] public static extern long CResult_TxAbortDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxAbortDecodeErrorZ_clone")] public static extern long CResult_TxAbortDecodeErrorZ_clone(long _orig); // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_AnnouncementSignaturesDecodeErrorZ_ok")] public static extern long CResult_AnnouncementSignaturesDecodeErrorZ_ok(long _o); // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e); @@ -3275,6 +3670,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelDecodeErrorZ_clone_ptr")] public static extern long CResult_OpenChannelDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelDecodeErrorZ_clone")] public static extern long CResult_OpenChannelDecodeErrorZ_clone(long _orig); + // struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_ok")] public static extern long CResult_OpenChannelV2DecodeErrorZ_ok(long _o); + // struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_err")] public static extern long CResult_OpenChannelV2DecodeErrorZ_err(long _e); + // bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_is_ok")] public static extern bool CResult_OpenChannelV2DecodeErrorZ_is_ok(long _o); + // void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_free")] public static extern void CResult_OpenChannelV2DecodeErrorZ_free(long __res); + // uint64_t CResult_OpenChannelV2DecodeErrorZ_clone_ptr(LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_clone_ptr")] public static extern long CResult_OpenChannelV2DecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OpenChannelV2DecodeErrorZ_clone")] public static extern long CResult_OpenChannelV2DecodeErrorZ_clone(long _orig); // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevokeAndACKDecodeErrorZ_ok")] public static extern long CResult_RevokeAndACKDecodeErrorZ_ok(long _o); // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e); @@ -3436,325 +3843,807 @@ internal class bindings { // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_err")] public static extern long CResult_ChannelUpdateDecodeErrorZ_err(long _e); // bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelUpdateDecodeErrorZ_is_ok(long _o); - // void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_free")] public static extern void CResult_ChannelUpdateDecodeErrorZ_free(long __res); - // uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelUpdateDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_clone")] public static extern long CResult_ChannelUpdateDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_ok")] public static extern long CResult_ErrorMessageDecodeErrorZ_ok(long _o); - // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_err")] public static extern long CResult_ErrorMessageDecodeErrorZ_err(long _e); - // bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_is_ok")] public static extern bool CResult_ErrorMessageDecodeErrorZ_is_ok(long _o); - // void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_free")] public static extern void CResult_ErrorMessageDecodeErrorZ_free(long __res); - // uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_clone_ptr")] public static extern long CResult_ErrorMessageDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_clone")] public static extern long CResult_ErrorMessageDecodeErrorZ_clone(long _orig); - // struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_ok")] public static extern long CResult_WarningMessageDecodeErrorZ_ok(long _o); - // struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_err")] public static extern long CResult_WarningMessageDecodeErrorZ_err(long _e); - // bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_is_ok")] public static extern bool CResult_WarningMessageDecodeErrorZ_is_ok(long _o); - // void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_free")] public static extern void CResult_WarningMessageDecodeErrorZ_free(long __res); - // uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_clone_ptr")] public static extern long CResult_WarningMessageDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_clone")] public static extern long CResult_WarningMessageDecodeErrorZ_clone(long _orig); - // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(long _o); - // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(long _e); - // bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok")] public static extern bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(long _o); - // void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free")] public static extern void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(long __res); - // uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(long _orig); - // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_ok")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_ok(long _o); - // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_err")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_err(long _e); - // bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_is_ok")] public static extern bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(long _o); - // void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_free")] public static extern void CResult_NodeAnnouncementDecodeErrorZ_free(long __res); - // uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_clone")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_clone(long _orig); - // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_ok")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_ok(long _o); - // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_err")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_err(long _e); - // bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok")] public static extern bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(long _o); - // void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_free")] public static extern void CResult_QueryShortChannelIdsDecodeErrorZ_free(long __res); - // uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_clone")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(long _o); - // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(long _e); - // bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok")] public static extern bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(long _o); - // void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free")] public static extern void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(long __res); - // uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(long _orig); - // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_ok")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_ok(long _o); - // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_err")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_err(long _e); - // bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_is_ok")] public static extern bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(long _o); - // void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_free")] public static extern void CResult_QueryChannelRangeDecodeErrorZ_free(long __res); - // uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_clone")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_clone(long _orig); - // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_ok")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_ok(long _o); - // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_err")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_err(long _e); - // bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_is_ok")] public static extern bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(long _o); - // void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_free")] public static extern void CResult_ReplyChannelRangeDecodeErrorZ_free(long __res); - // uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_clone")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_clone(long _orig); - // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_ok")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_ok(long _o); - // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_err")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_err(long _e); - // bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_is_ok")] public static extern bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(long _o); - // void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_free")] public static extern void CResult_GossipTimestampFilterDecodeErrorZ_free(long __res); - // uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(long _arg); - // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_clone(long _orig); - // void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PhantomRouteHintsZ_free")] public static extern void CVec_PhantomRouteHintsZ_free(long[] __res); - // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_ok")] public static extern long CResult_InvoiceSignOrCreationErrorZ_ok(long _o); - // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_err")] public static extern long CResult_InvoiceSignOrCreationErrorZ_err(long _e); - // bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_is_ok")] public static extern bool CResult_InvoiceSignOrCreationErrorZ_is_ok(long _o); - // void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_free")] public static extern void CResult_InvoiceSignOrCreationErrorZ_free(long __res); - // uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_clone_ptr")] public static extern long CResult_InvoiceSignOrCreationErrorZ_clone_ptr(long _arg); - // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceSignOrCreationErrorZ_clone")] public static extern long CResult_InvoiceSignOrCreationErrorZ_clone(long _orig); - // struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_some")] public static extern long COption_FilterZ_some(long _o); - // struct LDKCOption_FilterZ COption_FilterZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_none")] public static extern long COption_FilterZ_none(); - // void COption_FilterZ_free(struct LDKCOption_FilterZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_free")] public static extern void COption_FilterZ_free(long __res); - // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_ok")] public static extern long CResult_LockedChannelMonitorNoneZ_ok(long _o); - // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_err")] public static extern long CResult_LockedChannelMonitorNoneZ_err(); - // bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_is_ok")] public static extern bool CResult_LockedChannelMonitorNoneZ_is_ok(long _o); - // void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_free")] public static extern void CResult_LockedChannelMonitorNoneZ_free(long __res); - // void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_OutPointZ_free")] public static extern void CVec_OutPointZ_free(long[] __res); - // void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MonitorUpdateIdZ_free")] public static extern void CVec_MonitorUpdateIdZ_free(long[] __res); - // uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(long _arg); - // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(long _orig); - // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(long _a, long[] _b); - // void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free")] public static extern void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(long __res); - // void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free")] public static extern void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(long[] __res); - // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_free")] public static extern void PaymentPurpose_free(long _this_ptr); - // uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_clone_ptr")] public static extern long PaymentPurpose_clone_ptr(long _arg); - // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_clone")] public static extern long PaymentPurpose_clone(long _orig); - // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_invoice_payment")] public static extern long PaymentPurpose_invoice_payment(byte[] _payment_preimage, byte[] _payment_secret); - // struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_spontaneous_payment")] public static extern long PaymentPurpose_spontaneous_payment(byte[] _a); - // struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_write")] public static extern byte[] PaymentPurpose_write(long _obj); - // struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_read")] public static extern long PaymentPurpose_read(byte[] _ser); - // void ClosureReason_free(struct LDKClosureReason this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_free")] public static extern void ClosureReason_free(long _this_ptr); - // uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_clone_ptr")] public static extern long ClosureReason_clone_ptr(long _arg); - // struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_clone")] public static extern long ClosureReason_clone(long _orig); - // struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_counterparty_force_closed")] public static extern long ClosureReason_counterparty_force_closed(string _peer_msg); - // struct LDKClosureReason ClosureReason_holder_force_closed(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_holder_force_closed")] public static extern long ClosureReason_holder_force_closed(); - // struct LDKClosureReason ClosureReason_cooperative_closure(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_cooperative_closure")] public static extern long ClosureReason_cooperative_closure(); - // struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_commitment_tx_confirmed")] public static extern long ClosureReason_commitment_tx_confirmed(); - // struct LDKClosureReason ClosureReason_funding_timed_out(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_funding_timed_out")] public static extern long ClosureReason_funding_timed_out(); - // struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_processing_error")] public static extern long ClosureReason_processing_error(string _err); - // struct LDKClosureReason ClosureReason_disconnected_peer(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_disconnected_peer")] public static extern long ClosureReason_disconnected_peer(); - // struct LDKClosureReason ClosureReason_outdated_channel_manager(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_outdated_channel_manager")] public static extern long ClosureReason_outdated_channel_manager(); - // bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_eq")] public static extern bool ClosureReason_eq(long _a, long _b); - // struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_write")] public static extern byte[] ClosureReason_write(long _obj); - // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_read")] public static extern long ClosureReason_read(byte[] _ser); - // void HTLCDestination_free(struct LDKHTLCDestination this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_free")] public static extern void HTLCDestination_free(long _this_ptr); - // uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_clone_ptr")] public static extern long HTLCDestination_clone_ptr(long _arg); - // struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_clone")] public static extern long HTLCDestination_clone(long _orig); - // struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_next_hop_channel")] public static extern long HTLCDestination_next_hop_channel(byte[] _node_id, byte[] _channel_id); - // struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_unknown_next_hop")] public static extern long HTLCDestination_unknown_next_hop(long _requested_forward_scid); - // struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_invalid_forward")] public static extern long HTLCDestination_invalid_forward(long _requested_forward_scid); - // struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_failed_payment")] public static extern long HTLCDestination_failed_payment(byte[] _payment_hash); - // bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_eq")] public static extern bool HTLCDestination_eq(long _a, long _b); - // struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_write")] public static extern byte[] HTLCDestination_write(long _obj); - // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_read")] public static extern long HTLCDestination_read(byte[] _ser); - // void Event_free(struct LDKEvent this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_free")] public static extern void Event_free(long _this_ptr); - // uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_clone_ptr")] public static extern long Event_clone_ptr(long _arg); - // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_clone")] public static extern long Event_clone(long _orig); - // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_funding_generation_ready")] public static extern long Event_funding_generation_ready(byte[] _temporary_channel_id, byte[] _counterparty_node_id, long _channel_value_satoshis, byte[] _output_script, byte[] _user_channel_id); - // struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKThirtyTwoBytes via_channel_id, struct LDKCOption_u128Z via_user_channel_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_claimable")] public static extern long Event_payment_claimable(byte[] _receiver_node_id, byte[] _payment_hash, long _amount_msat, long _purpose, byte[] _via_channel_id, long _via_user_channel_id); - // struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_claimed")] public static extern long Event_payment_claimed(byte[] _receiver_node_id, byte[] _payment_hash, long _amount_msat, long _purpose); - // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_sent")] public static extern long Event_payment_sent(byte[] _payment_id, byte[] _payment_preimage, byte[] _payment_hash, long _fee_paid_msat); - // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_failed")] public static extern long Event_payment_failed(byte[] _payment_id, byte[] _payment_hash); - // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_path_successful")] public static extern long Event_payment_path_successful(byte[] _payment_id, byte[] _payment_hash, long[] _path); - // struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_path_failed")] public static extern long Event_payment_path_failed(byte[] _payment_id, byte[] _payment_hash, bool _payment_failed_permanently, long _network_update, bool _all_paths_failed, long[] _path, long _short_channel_id, long _retry); - // struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_probe_successful")] public static extern long Event_probe_successful(byte[] _payment_id, byte[] _payment_hash, long[] _path); - // struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_probe_failed")] public static extern long Event_probe_failed(byte[] _payment_id, byte[] _payment_hash, long[] _path, long _short_channel_id); - // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_pending_htlcs_forwardable")] public static extern long Event_pending_htlcs_forwardable(long _time_forwardable); - // struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_htlcintercepted")] public static extern long Event_htlcintercepted(byte[] _intercept_id, long _requested_next_hop_scid, byte[] _payment_hash, long _inbound_amount_msat, long _expected_outbound_amount_msat); - // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_spendable_outputs")] public static extern long Event_spendable_outputs(long[] _outputs); - // struct LDKEvent Event_payment_forwarded(struct LDKThirtyTwoBytes prev_channel_id, struct LDKThirtyTwoBytes next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_forwarded")] public static extern long Event_payment_forwarded(byte[] _prev_channel_id, byte[] _next_channel_id, long _fee_earned_msat, bool _claim_from_onchain_tx); - // struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_ready")] public static extern long Event_channel_ready(byte[] _channel_id, byte[] _user_channel_id, byte[] _counterparty_node_id, long _channel_type); - // struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_closed")] public static extern long Event_channel_closed(byte[] _channel_id, byte[] _user_channel_id, long _reason); - // struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_discard_funding")] public static extern long Event_discard_funding(byte[] _channel_id, byte[] _transaction); - // struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_open_channel_request")] public static extern long Event_open_channel_request(byte[] _temporary_channel_id, byte[] _counterparty_node_id, long _funding_satoshis, long _push_msat, long _channel_type); - // struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_htlchandling_failed")] public static extern long Event_htlchandling_failed(byte[] _prev_channel_id, long _failed_next_destination); - // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_write")] public static extern byte[] Event_write(long _obj); - // struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_read")] public static extern long Event_read(byte[] _ser); - // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_free")] public static extern void MessageSendEvent_free(long _this_ptr); - // uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_clone_ptr")] public static extern long MessageSendEvent_clone_ptr(long _arg); - // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_clone")] public static extern long MessageSendEvent_clone(long _orig); - // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_accept_channel")] public static extern long MessageSendEvent_send_accept_channel(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_open_channel")] public static extern long MessageSendEvent_send_open_channel(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_funding_created")] public static extern long MessageSendEvent_send_funding_created(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_funding_signed")] public static extern long MessageSendEvent_send_funding_signed(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_ready")] public static extern long MessageSendEvent_send_channel_ready(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_announcement_signatures")] public static extern long MessageSendEvent_send_announcement_signatures(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_update_htlcs")] public static extern long MessageSendEvent_update_htlcs(byte[] _node_id, long _updates); - // struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_revoke_and_ack")] public static extern long MessageSendEvent_send_revoke_and_ack(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_closing_signed")] public static extern long MessageSendEvent_send_closing_signed(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_shutdown")] public static extern long MessageSendEvent_send_shutdown(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_reestablish")] public static extern long MessageSendEvent_send_channel_reestablish(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_announcement")] public static extern long MessageSendEvent_send_channel_announcement(byte[] _node_id, long _msg, long _update_msg); - // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_broadcast_channel_announcement")] public static extern long MessageSendEvent_broadcast_channel_announcement(long _msg, long _update_msg); - // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_broadcast_channel_update")] public static extern long MessageSendEvent_broadcast_channel_update(long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_update")] public static extern long MessageSendEvent_send_channel_update(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_handle_error")] public static extern long MessageSendEvent_handle_error(byte[] _node_id, long _action); - // struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_range_query")] public static extern long MessageSendEvent_send_channel_range_query(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_short_ids_query")] public static extern long MessageSendEvent_send_short_ids_query(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_reply_channel_range")] public static extern long MessageSendEvent_send_reply_channel_range(byte[] _node_id, long _msg); - // struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_gossip_timestamp_filter")] public static extern long MessageSendEvent_send_gossip_timestamp_filter(byte[] _node_id, long _msg); - // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEventsProvider_free")] public static extern void MessageSendEventsProvider_free(long _this_ptr); - // void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageProvider_free")] public static extern void OnionMessageProvider_free(long _this_ptr); - // void EventsProvider_free(struct LDKEventsProvider this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventsProvider_free")] public static extern void EventsProvider_free(long _this_ptr); - // void EventHandler_free(struct LDKEventHandler this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventHandler_free")] public static extern void EventHandler_free(long _this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelUpdateDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_free")] public static extern void CResult_ChannelUpdateDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelUpdateDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelUpdateDecodeErrorZ_clone")] public static extern long CResult_ChannelUpdateDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_ok")] public static extern long CResult_ErrorMessageDecodeErrorZ_ok(long _o); + // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_err")] public static extern long CResult_ErrorMessageDecodeErrorZ_err(long _e); + // bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_is_ok")] public static extern bool CResult_ErrorMessageDecodeErrorZ_is_ok(long _o); + // void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_free")] public static extern void CResult_ErrorMessageDecodeErrorZ_free(long __res); + // uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_clone_ptr")] public static extern long CResult_ErrorMessageDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ErrorMessageDecodeErrorZ_clone")] public static extern long CResult_ErrorMessageDecodeErrorZ_clone(long _orig); + // struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_ok")] public static extern long CResult_WarningMessageDecodeErrorZ_ok(long _o); + // struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_err")] public static extern long CResult_WarningMessageDecodeErrorZ_err(long _e); + // bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_is_ok")] public static extern bool CResult_WarningMessageDecodeErrorZ_is_ok(long _o); + // void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_free")] public static extern void CResult_WarningMessageDecodeErrorZ_free(long __res); + // uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_clone_ptr")] public static extern long CResult_WarningMessageDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WarningMessageDecodeErrorZ_clone")] public static extern long CResult_WarningMessageDecodeErrorZ_clone(long _orig); + // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(long _o); + // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(long _e); + // bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok")] public static extern bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(long _o); + // void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free")] public static extern void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(long __res); + // uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone")] public static extern long CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_ok")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_ok(long _o); + // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_err")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_err(long _e); + // bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_is_ok")] public static extern bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(long _o); + // void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_free")] public static extern void CResult_NodeAnnouncementDecodeErrorZ_free(long __res); + // uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeAnnouncementDecodeErrorZ_clone")] public static extern long CResult_NodeAnnouncementDecodeErrorZ_clone(long _orig); + // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_ok")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_ok(long _o); + // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_err")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_err(long _e); + // bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok")] public static extern bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(long _o); + // void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_free")] public static extern void CResult_QueryShortChannelIdsDecodeErrorZ_free(long __res); + // uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryShortChannelIdsDecodeErrorZ_clone")] public static extern long CResult_QueryShortChannelIdsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(long _o); + // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(long _e); + // bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok")] public static extern bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(long _o); + // void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free")] public static extern void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(long __res); + // uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone")] public static extern long CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(long _orig); + // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_ok")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_ok(long _o); + // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_err")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_err(long _e); + // bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_is_ok")] public static extern bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(long _o); + // void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_free")] public static extern void CResult_QueryChannelRangeDecodeErrorZ_free(long __res); + // uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_QueryChannelRangeDecodeErrorZ_clone")] public static extern long CResult_QueryChannelRangeDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_ok")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_ok(long _o); + // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_err")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_err(long _e); + // bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_is_ok")] public static extern bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(long _o); + // void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_free")] public static extern void CResult_ReplyChannelRangeDecodeErrorZ_free(long __res); + // uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ReplyChannelRangeDecodeErrorZ_clone")] public static extern long CResult_ReplyChannelRangeDecodeErrorZ_clone(long _orig); + // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_ok")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_ok(long _o); + // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_err")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_err(long _e); + // bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_is_ok")] public static extern bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(long _o); + // void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_free")] public static extern void CResult_GossipTimestampFilterDecodeErrorZ_free(long __res); + // uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_GossipTimestampFilterDecodeErrorZ_clone")] public static extern long CResult_GossipTimestampFilterDecodeErrorZ_clone(long _orig); + // void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PhantomRouteHintsZ_free")] public static extern void CVec_PhantomRouteHintsZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_ok")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(long _o); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_err")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_err(long _e); + // bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok")] public static extern bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(long _o); + // void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_free")] public static extern void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(long __res); + // uint64_t CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone")] public static extern long CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(long _orig); + // void CVec_FutureZ_free(struct LDKCVec_FutureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_FutureZ_free")] public static extern void CVec_FutureZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_ok")] public static extern long CResult_OffersMessageDecodeErrorZ_ok(long _o); + // struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_err")] public static extern long CResult_OffersMessageDecodeErrorZ_err(long _e); + // bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_is_ok")] public static extern bool CResult_OffersMessageDecodeErrorZ_is_ok(long _o); + // void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_free")] public static extern void CResult_OffersMessageDecodeErrorZ_free(long __res); + // uint64_t CResult_OffersMessageDecodeErrorZ_clone_ptr(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_clone_ptr")] public static extern long CResult_OffersMessageDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OffersMessageDecodeErrorZ_clone")] public static extern long CResult_OffersMessageDecodeErrorZ_clone(long _orig); + // struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCClaimZ_some")] public static extern long COption_HTLCClaimZ_some(HTLCClaim _o); + // struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCClaimZ_none")] public static extern long COption_HTLCClaimZ_none(); + // void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCClaimZ_free")] public static extern void COption_HTLCClaimZ_free(long __res); + // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(long _o); + // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(long _e); + // bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok")] public static extern bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(long _o); + // void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free")] public static extern void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(long __res); + // uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone")] public static extern long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_ok")] public static extern long CResult_TxCreationKeysDecodeErrorZ_ok(long _o); + // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_err")] public static extern long CResult_TxCreationKeysDecodeErrorZ_err(long _e); + // bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_is_ok")] public static extern bool CResult_TxCreationKeysDecodeErrorZ_is_ok(long _o); + // void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_free")] public static extern void CResult_TxCreationKeysDecodeErrorZ_free(long __res); + // uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone_ptr")] public static extern long CResult_TxCreationKeysDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxCreationKeysDecodeErrorZ_clone")] public static extern long CResult_TxCreationKeysDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_ok")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_err")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_err(long _e); + // bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_free")] public static extern void CResult_ChannelPublicKeysDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelPublicKeysDecodeErrorZ_clone")] public static extern long CResult_ChannelPublicKeysDecodeErrorZ_clone(long _orig); + // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(long _o); + // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_err")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_err(long _e); + // bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok")] public static extern bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(long _o); + // void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_free")] public static extern void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(long __res); + // uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone")] public static extern long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(long _orig); + // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(long _o); + // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(long _e); + // bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok")] public static extern bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(long _o); + // void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free")] public static extern void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(long __res); + // uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone")] public static extern long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_ok")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_err")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_err(long _e); + // bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_free")] public static extern void CResult_ChannelTransactionParametersDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTransactionParametersDecodeErrorZ_clone")] public static extern long CResult_ChannelTransactionParametersDecodeErrorZ_clone(long _orig); + // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_ok")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_ok(long _o); + // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_err")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_err(long _e); + // bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok")] public static extern bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(long _o); + // void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_free")] public static extern void CResult_HolderCommitmentTransactionDecodeErrorZ_free(long __res); + // uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HolderCommitmentTransactionDecodeErrorZ_clone")] public static extern long CResult_HolderCommitmentTransactionDecodeErrorZ_clone(long _orig); + // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(long _o); + // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_err")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_err(long _e); + // bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok")] public static extern bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(long _o); + // void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_free")] public static extern void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(long __res); + // uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone")] public static extern long CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_ok")] public static extern long CResult_TrustedClosingTransactionNoneZ_ok(long _o); + // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_err")] public static extern long CResult_TrustedClosingTransactionNoneZ_err(); + // bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_is_ok")] public static extern bool CResult_TrustedClosingTransactionNoneZ_is_ok(long _o); + // void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedClosingTransactionNoneZ_free")] public static extern void CResult_TrustedClosingTransactionNoneZ_free(long __res); + // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_ok")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_ok(long _o); + // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_err")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_err(long _e); + // bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_is_ok")] public static extern bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(long _o); + // void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_free")] public static extern void CResult_CommitmentTransactionDecodeErrorZ_free(long __res); + // uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CommitmentTransactionDecodeErrorZ_clone")] public static extern long CResult_CommitmentTransactionDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_ok")] public static extern long CResult_TrustedCommitmentTransactionNoneZ_ok(long _o); + // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_err")] public static extern long CResult_TrustedCommitmentTransactionNoneZ_err(); + // bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_is_ok")] public static extern bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(long _o); + // void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrustedCommitmentTransactionNoneZ_free")] public static extern void CResult_TrustedCommitmentTransactionNoneZ_free(long __res); + // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_ok")] public static extern long CResult_CVec_SignatureZNoneZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _o); + // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_err")] public static extern long CResult_CVec_SignatureZNoneZ_err(); + // bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_is_ok")] public static extern bool CResult_CVec_SignatureZNoneZ_is_ok(long _o); + // void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_free")] public static extern void CResult_CVec_SignatureZNoneZ_free(long __res); + // uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_clone_ptr")] public static extern long CResult_CVec_SignatureZNoneZ_clone_ptr(long _arg); + // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_SignatureZNoneZ_clone")] public static extern long CResult_CVec_SignatureZNoneZ_clone(long _orig); + // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_ok")] public static extern long CResult_ShutdownScriptDecodeErrorZ_ok(long _o); + // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_err")] public static extern long CResult_ShutdownScriptDecodeErrorZ_err(long _e); + // bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_is_ok")] public static extern bool CResult_ShutdownScriptDecodeErrorZ_is_ok(long _o); + // void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_free")] public static extern void CResult_ShutdownScriptDecodeErrorZ_free(long __res); + // uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone_ptr")] public static extern long CResult_ShutdownScriptDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptDecodeErrorZ_clone")] public static extern long CResult_ShutdownScriptDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_ok")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_ok(long _o); + // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_err")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_err(long _e); + // bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok")] public static extern bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(long _o); + // void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_free")] public static extern void CResult_ShutdownScriptInvalidShutdownScriptZ_free(long __res); + // uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(long _arg); + // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_clone(long _orig); + // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok")] public static extern long CResult_PaymentPurposeDecodeErrorZ_ok(long _o); + // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_err")] public static extern long CResult_PaymentPurposeDecodeErrorZ_err(long _e); + // bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_is_ok")] public static extern bool CResult_PaymentPurposeDecodeErrorZ_is_ok(long _o); + // void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_free")] public static extern void CResult_PaymentPurposeDecodeErrorZ_free(long __res); + // uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentPurposeDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_clone")] public static extern long CResult_PaymentPurposeDecodeErrorZ_clone(long _orig); + // struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PathFailureZ_some")] public static extern long COption_PathFailureZ_some(long _o); + // struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PathFailureZ_none")] public static extern long COption_PathFailureZ_none(); + // void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PathFailureZ_free")] public static extern void COption_PathFailureZ_free(long __res); + // uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PathFailureZ_clone_ptr")] public static extern long COption_PathFailureZ_clone_ptr(long _arg); + // struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PathFailureZ_clone")] public static extern long COption_PathFailureZ_clone(long _orig); + // struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_ok")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_err")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_err(long _e); + // bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_free")] public static extern void CResult_COption_PathFailureZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_clone")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_clone(long _orig); + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_some")] public static extern long COption_ClosureReasonZ_some(long _o); + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_none")] public static extern long COption_ClosureReasonZ_none(); + // void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_free")] public static extern void COption_ClosureReasonZ_free(long __res); + // uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_clone_ptr")] public static extern long COption_ClosureReasonZ_clone_ptr(long _arg); + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ClosureReasonZ_clone")] public static extern long COption_ClosureReasonZ_clone(long _orig); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_ok")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_err")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_err(long _e); + // bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_free")] public static extern void CResult_COption_ClosureReasonZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_ClosureReasonZDecodeErrorZ_clone")] public static extern long CResult_COption_ClosureReasonZDecodeErrorZ_clone(long _orig); + // struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_some")] public static extern long COption_HTLCDestinationZ_some(long _o); + // struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_none")] public static extern long COption_HTLCDestinationZ_none(); + // void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_free")] public static extern void COption_HTLCDestinationZ_free(long __res); + // uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_clone_ptr")] public static extern long COption_HTLCDestinationZ_clone_ptr(long _arg); + // struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_HTLCDestinationZ_clone")] public static extern long COption_HTLCDestinationZ_clone(long _orig); + // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_ok")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_err")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_err(long _e); + // bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_free")] public static extern void CResult_COption_HTLCDestinationZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_HTLCDestinationZDecodeErrorZ_clone")] public static extern long CResult_COption_HTLCDestinationZDecodeErrorZ_clone(long _orig); + // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_ok")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_ok(PaymentFailureReason _o); + // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_err")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_err(long _e); + // bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_is_ok")] public static extern bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(long _o); + // void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_free")] public static extern void CResult_PaymentFailureReasonDecodeErrorZ_free(long __res); + // uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentFailureReasonDecodeErrorZ_clone")] public static extern long CResult_PaymentFailureReasonDecodeErrorZ_clone(long _orig); + // struct LDKCOption_u128Z COption_u128Z_some(struct LDKU128 o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_some")] public static extern long COption_u128Z_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_u128Z COption_u128Z_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_none")] public static extern long COption_u128Z_none(); + // void COption_u128Z_free(struct LDKCOption_u128Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_free")] public static extern void COption_u128Z_free(long __res); + // uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_clone_ptr")] public static extern long COption_u128Z_clone_ptr(long _arg); + // struct LDKCOption_u128Z COption_u128Z_clone(const struct LDKCOption_u128Z *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u128Z_clone")] public static extern long COption_u128Z_clone(long _orig); + // struct LDKCOption_PaymentIdZ COption_PaymentIdZ_some(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentIdZ_some")] public static extern long COption_PaymentIdZ_some([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCOption_PaymentIdZ COption_PaymentIdZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentIdZ_none")] public static extern long COption_PaymentIdZ_none(); + // void COption_PaymentIdZ_free(struct LDKCOption_PaymentIdZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentIdZ_free")] public static extern void COption_PaymentIdZ_free(long __res); + // uint64_t COption_PaymentIdZ_clone_ptr(LDKCOption_PaymentIdZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentIdZ_clone_ptr")] public static extern long COption_PaymentIdZ_clone_ptr(long _arg); + // struct LDKCOption_PaymentIdZ COption_PaymentIdZ_clone(const struct LDKCOption_PaymentIdZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentIdZ_clone")] public static extern long COption_PaymentIdZ_clone(long _orig); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_some")] public static extern long COption_PaymentFailureReasonZ_some(PaymentFailureReason _o); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_none")] public static extern long COption_PaymentFailureReasonZ_none(); + // void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_free")] public static extern void COption_PaymentFailureReasonZ_free(long __res); + // uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_clone_ptr")] public static extern long COption_PaymentFailureReasonZ_clone_ptr(long _arg); + // struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentFailureReasonZ_clone")] public static extern long COption_PaymentFailureReasonZ_clone(long _orig); + // struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_some")] public static extern long COption_EventZ_some(long _o); + // struct LDKCOption_EventZ COption_EventZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_none")] public static extern long COption_EventZ_none(); + // void COption_EventZ_free(struct LDKCOption_EventZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_free")] public static extern void COption_EventZ_free(long __res); + // uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_clone_ptr")] public static extern long COption_EventZ_clone_ptr(long _arg); + // struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_EventZ_clone")] public static extern long COption_EventZ_clone(long _orig); + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_ok")] public static extern long CResult_COption_EventZDecodeErrorZ_ok(long _o); + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_err")] public static extern long CResult_COption_EventZDecodeErrorZ_err(long _e); + // bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_is_ok")] public static extern bool CResult_COption_EventZDecodeErrorZ_is_ok(long _o); + // void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_free")] public static extern void CResult_COption_EventZDecodeErrorZ_free(long __res); + // uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_clone_ptr")] public static extern long CResult_COption_EventZDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_EventZDecodeErrorZ_clone")] public static extern long CResult_COption_EventZDecodeErrorZ_clone(long _orig); + // void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_BlockHashChannelMonitorZZ_free")] public static extern void CVec_C2Tuple_BlockHashChannelMonitorZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _o); + // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(IOError _e); + // bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok")] public static extern bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(long _o); + // void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free")] public static extern void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(long __res); + // uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(long _arg); + // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone")] public static extern long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(long _orig); + // struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_ok")] public static extern long CResult_SiPrefixBolt11ParseErrorZ_ok(SiPrefix _o); + // struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_err")] public static extern long CResult_SiPrefixBolt11ParseErrorZ_err(long _e); + // bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_is_ok")] public static extern bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(long _o); + // void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_free")] public static extern void CResult_SiPrefixBolt11ParseErrorZ_free(long __res); + // uint64_t CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr")] public static extern long CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(long _arg); + // struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SiPrefixBolt11ParseErrorZ_clone")] public static extern long CResult_SiPrefixBolt11ParseErrorZ_clone(long _orig); + // struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok")] public static extern long CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(long _o); + // struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_err")] public static extern long CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(long _e); + // bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok")] public static extern bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(long _o); + // void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_free")] public static extern void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(long __res); + // uint64_t CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr")] public static extern long CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone")] public static extern long CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(long _orig); + // struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok")] public static extern long CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(long _o); + // struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err")] public static extern long CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(long _e); + // bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok")] public static extern bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(long _o); + // void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free")] public static extern void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(long __res); + // uint64_t CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr")] public static extern long CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(long _arg); + // struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone")] public static extern long CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(long _orig); + // uint64_t C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr")] public static extern long C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(long _arg); + // struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone")] public static extern long C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(long _orig); + // struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new")] public static extern long C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(long _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _b, long _c); + // void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free")] public static extern void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(long __res); + // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_ok")] public static extern long CResult_PayeePubKeyErrorZ_ok(long _o); + // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_err")] public static extern long CResult_PayeePubKeyErrorZ_err(Secp256k1Error _e); + // bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_is_ok")] public static extern bool CResult_PayeePubKeyErrorZ_is_ok(long _o); + // void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_free")] public static extern void CResult_PayeePubKeyErrorZ_free(long __res); + // uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_clone_ptr")] public static extern long CResult_PayeePubKeyErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PayeePubKeyErrorZ_clone")] public static extern long CResult_PayeePubKeyErrorZ_clone(long _orig); + // void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PrivateRouteZ_free")] public static extern void CVec_PrivateRouteZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_ok")] public static extern long CResult_PositiveTimestampCreationErrorZ_ok(long _o); + // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_err")] public static extern long CResult_PositiveTimestampCreationErrorZ_err(CreationError _e); + // bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_is_ok")] public static extern bool CResult_PositiveTimestampCreationErrorZ_is_ok(long _o); + // void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_free")] public static extern void CResult_PositiveTimestampCreationErrorZ_free(long __res); + // uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone_ptr")] public static extern long CResult_PositiveTimestampCreationErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PositiveTimestampCreationErrorZ_clone")] public static extern long CResult_PositiveTimestampCreationErrorZ_clone(long _orig); + // struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_ok")] public static extern long CResult_NoneBolt11SemanticErrorZ_ok(); + // struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_err")] public static extern long CResult_NoneBolt11SemanticErrorZ_err(Bolt11SemanticError _e); + // bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_is_ok")] public static extern bool CResult_NoneBolt11SemanticErrorZ_is_ok(long _o); + // void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_free")] public static extern void CResult_NoneBolt11SemanticErrorZ_free(long __res); + // uint64_t CResult_NoneBolt11SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone_ptr")] public static extern long CResult_NoneBolt11SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt11SemanticErrorZ_clone")] public static extern long CResult_NoneBolt11SemanticErrorZ_clone(long _orig); + // struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok")] public static extern long CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(long _o); + // struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err")] public static extern long CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(Bolt11SemanticError _e); + // bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok")] public static extern bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(long _o); + // void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_free")] public static extern void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(long __res); + // uint64_t CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr")] public static extern long CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone")] public static extern long CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(long _orig); + // void CVec_AddressZ_free(struct LDKCVec_AddressZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_AddressZ_free")] public static extern void CVec_AddressZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] string[] __res); + // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_ok")] public static extern long CResult_DescriptionCreationErrorZ_ok(long _o); + // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_err")] public static extern long CResult_DescriptionCreationErrorZ_err(CreationError _e); + // bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_is_ok")] public static extern bool CResult_DescriptionCreationErrorZ_is_ok(long _o); + // void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_free")] public static extern void CResult_DescriptionCreationErrorZ_free(long __res); + // uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_clone_ptr")] public static extern long CResult_DescriptionCreationErrorZ_clone_ptr(long _arg); + // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DescriptionCreationErrorZ_clone")] public static extern long CResult_DescriptionCreationErrorZ_clone(long _orig); + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_ok")] public static extern long CResult_PrivateRouteCreationErrorZ_ok(long _o); + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_err")] public static extern long CResult_PrivateRouteCreationErrorZ_err(CreationError _e); + // bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_is_ok")] public static extern bool CResult_PrivateRouteCreationErrorZ_is_ok(long _o); + // void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_free")] public static extern void CResult_PrivateRouteCreationErrorZ_free(long __res); + // uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_clone_ptr")] public static extern long CResult_PrivateRouteCreationErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PrivateRouteCreationErrorZ_clone")] public static extern long CResult_PrivateRouteCreationErrorZ_clone(long _orig); + // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_ok")] public static extern long CResult_OutPointDecodeErrorZ_ok(long _o); + // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_err")] public static extern long CResult_OutPointDecodeErrorZ_err(long _e); + // bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_is_ok")] public static extern bool CResult_OutPointDecodeErrorZ_is_ok(long _o); + // void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_free")] public static extern void CResult_OutPointDecodeErrorZ_free(long __res); + // uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_clone_ptr")] public static extern long CResult_OutPointDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutPointDecodeErrorZ_clone")] public static extern long CResult_OutPointDecodeErrorZ_clone(long _orig); + // struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_ok")] public static extern long CResult_BigSizeDecodeErrorZ_ok(long _o); + // struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_err")] public static extern long CResult_BigSizeDecodeErrorZ_err(long _e); + // bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_is_ok")] public static extern bool CResult_BigSizeDecodeErrorZ_is_ok(long _o); + // void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_free")] public static extern void CResult_BigSizeDecodeErrorZ_free(long __res); + // uint64_t CResult_BigSizeDecodeErrorZ_clone_ptr(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_clone_ptr")] public static extern long CResult_BigSizeDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BigSizeDecodeErrorZ_clone")] public static extern long CResult_BigSizeDecodeErrorZ_clone(long _orig); + // struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_ok")] public static extern long CResult_HostnameDecodeErrorZ_ok(long _o); + // struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_err")] public static extern long CResult_HostnameDecodeErrorZ_err(long _e); + // bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_is_ok")] public static extern bool CResult_HostnameDecodeErrorZ_is_ok(long _o); + // void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_free")] public static extern void CResult_HostnameDecodeErrorZ_free(long __res); + // uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_clone_ptr")] public static extern long CResult_HostnameDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HostnameDecodeErrorZ_clone")] public static extern long CResult_HostnameDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_ok")] public static extern long CResult_TransactionU16LenLimitedNoneZ_ok(long _o); + // struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_err")] public static extern long CResult_TransactionU16LenLimitedNoneZ_err(); + // bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_is_ok")] public static extern bool CResult_TransactionU16LenLimitedNoneZ_is_ok(long _o); + // void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_free")] public static extern void CResult_TransactionU16LenLimitedNoneZ_free(long __res); + // uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone_ptr")] public static extern long CResult_TransactionU16LenLimitedNoneZ_clone_ptr(long _arg); + // struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedNoneZ_clone")] public static extern long CResult_TransactionU16LenLimitedNoneZ_clone(long _orig); + // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_ok")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_ok(long _o); + // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_err")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_err(long _e); + // bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok")] public static extern bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(long _o); + // void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_free")] public static extern void CResult_TransactionU16LenLimitedDecodeErrorZ_free(long __res); + // uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionU16LenLimitedDecodeErrorZ_clone")] public static extern long CResult_TransactionU16LenLimitedDecodeErrorZ_clone(long _orig); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_ok")] public static extern long CResult_UntrustedStringDecodeErrorZ_ok(long _o); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_err")] public static extern long CResult_UntrustedStringDecodeErrorZ_err(long _e); + // bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_is_ok")] public static extern bool CResult_UntrustedStringDecodeErrorZ_is_ok(long _o); + // void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_free")] public static extern void CResult_UntrustedStringDecodeErrorZ_free(long __res); + // uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone_ptr")] public static extern long CResult_UntrustedStringDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone")] public static extern long CResult_UntrustedStringDecodeErrorZ_clone(long _orig); + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_ok")] public static extern long CResult_PaymentIdPaymentErrorZ_ok([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _o); + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_err")] public static extern long CResult_PaymentIdPaymentErrorZ_err(long _e); + // bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_is_ok")] public static extern bool CResult_PaymentIdPaymentErrorZ_is_ok(long _o); + // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_free")] public static extern void CResult_PaymentIdPaymentErrorZ_free(long __res); + // uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_clone_ptr")] public static extern long CResult_PaymentIdPaymentErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentIdPaymentErrorZ_clone")] public static extern long CResult_PaymentIdPaymentErrorZ_clone(long _orig); + // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_ok")] public static extern long CResult_NonePaymentErrorZ_ok(); + // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_err")] public static extern long CResult_NonePaymentErrorZ_err(long _e); + // bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_is_ok")] public static extern bool CResult_NonePaymentErrorZ_is_ok(long _o); + // void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_free")] public static extern void CResult_NonePaymentErrorZ_free(long __res); + // uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_clone_ptr")] public static extern long CResult_NonePaymentErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NonePaymentErrorZ_clone")] public static extern long CResult_NonePaymentErrorZ_clone(long _orig); + // struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_ok")] public static extern long CResult_StringErrorZ_ok(string _o); + // struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_err")] public static extern long CResult_StringErrorZ_err(Secp256k1Error _e); + // bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_is_ok")] public static extern bool CResult_StringErrorZ_is_ok(long _o); + // void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_free")] public static extern void CResult_StringErrorZ_free(long __res); + // uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_clone_ptr")] public static extern long CResult_StringErrorZ_clone_ptr(long _arg); + // struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StringErrorZ_clone")] public static extern long CResult_StringErrorZ_clone(long _orig); + // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok")] public static extern long CResult_TxOutUtxoLookupErrorZ_ok(long _o); + // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_err")] public static extern long CResult_TxOutUtxoLookupErrorZ_err(UtxoLookupError _e); + // bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_is_ok")] public static extern bool CResult_TxOutUtxoLookupErrorZ_is_ok(long _o); + // void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_free")] public static extern void CResult_TxOutUtxoLookupErrorZ_free(long __res); + // uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone_ptr")] public static extern long CResult_TxOutUtxoLookupErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone")] public static extern long CResult_TxOutUtxoLookupErrorZ_clone(long _orig); + // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_ok")] public static extern long CResult_OnionMessagePathNoneZ_ok(long _o); + // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_err")] public static extern long CResult_OnionMessagePathNoneZ_err(); + // bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_is_ok")] public static extern bool CResult_OnionMessagePathNoneZ_is_ok(long _o); + // void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_free")] public static extern void CResult_OnionMessagePathNoneZ_free(long __res); + // uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_clone_ptr")] public static extern long CResult_OnionMessagePathNoneZ_clone_ptr(long _arg); + // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OnionMessagePathNoneZ_clone")] public static extern long CResult_OnionMessagePathNoneZ_clone(long _orig); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_ok")] public static extern long CResult_NoneSendErrorZ_ok(); + // struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_err")] public static extern long CResult_NoneSendErrorZ_err(long _e); + // bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_is_ok")] public static extern bool CResult_NoneSendErrorZ_is_ok(long _o); + // void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneSendErrorZ_free")] public static extern void CResult_NoneSendErrorZ_free(long __res); + // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_ok")] public static extern long CResult_BlindedPathNoneZ_ok(long _o); + // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_err")] public static extern long CResult_BlindedPathNoneZ_err(); + // bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_is_ok")] public static extern bool CResult_BlindedPathNoneZ_is_ok(long _o); + // void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_free")] public static extern void CResult_BlindedPathNoneZ_free(long __res); + // uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_clone_ptr")] public static extern long CResult_BlindedPathNoneZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_clone")] public static extern long CResult_BlindedPathNoneZ_clone(long _orig); + // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_ok")] public static extern long CResult_BlindedPathDecodeErrorZ_ok(long _o); + // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_err")] public static extern long CResult_BlindedPathDecodeErrorZ_err(long _e); + // bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedPathDecodeErrorZ_is_ok(long _o); + // void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_free")] public static extern void CResult_BlindedPathDecodeErrorZ_free(long __res); + // uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedPathDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathDecodeErrorZ_clone")] public static extern long CResult_BlindedPathDecodeErrorZ_clone(long _orig); + // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_ok")] public static extern long CResult_BlindedHopDecodeErrorZ_ok(long _o); + // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_err")] public static extern long CResult_BlindedHopDecodeErrorZ_err(long _e); + // bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_is_ok")] public static extern bool CResult_BlindedHopDecodeErrorZ_is_ok(long _o); + // void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_free")] public static extern void CResult_BlindedHopDecodeErrorZ_free(long __res); + // uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_clone_ptr")] public static extern long CResult_BlindedHopDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedHopDecodeErrorZ_clone")] public static extern long CResult_BlindedHopDecodeErrorZ_clone(long _orig); + // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_ok")] public static extern long CResult_InvoiceErrorDecodeErrorZ_ok(long _o); + // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_err")] public static extern long CResult_InvoiceErrorDecodeErrorZ_err(long _e); + // bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_is_ok")] public static extern bool CResult_InvoiceErrorDecodeErrorZ_is_ok(long _o); + // void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_free")] public static extern void CResult_InvoiceErrorDecodeErrorZ_free(long __res); + // uint64_t CResult_InvoiceErrorDecodeErrorZ_clone_ptr(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone_ptr")] public static extern long CResult_InvoiceErrorDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone")] public static extern long CResult_InvoiceErrorDecodeErrorZ_clone(long _orig); + // struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_some")] public static extern long COption_FilterZ_some(long _o); + // struct LDKCOption_FilterZ COption_FilterZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_none")] public static extern long COption_FilterZ_none(); + // void COption_FilterZ_free(struct LDKCOption_FilterZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_free")] public static extern void COption_FilterZ_free(long __res); + // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_ok")] public static extern long CResult_LockedChannelMonitorNoneZ_ok(long _o); + // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_err")] public static extern long CResult_LockedChannelMonitorNoneZ_err(); + // bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_is_ok")] public static extern bool CResult_LockedChannelMonitorNoneZ_is_ok(long _o); + // void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_free")] public static extern void CResult_LockedChannelMonitorNoneZ_free(long __res); + // void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_OutPointZ_free")] public static extern void CVec_OutPointZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MonitorUpdateIdZ_free")] public static extern void CVec_MonitorUpdateIdZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); + // uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(long _arg); + // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(long _orig); + // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(long _a, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _b); + // void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free")] public static extern void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(long __res); + // void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free")] public static extern void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] __res); // void APIError_free(struct LDKAPIError this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_APIError_free")] public static extern void APIError_free(long _this_ptr); // uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg); @@ -3775,6 +4664,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_APIError_incompatible_shutdown_script")] public static extern long APIError_incompatible_shutdown_script(long _script); // bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_APIError_eq")] public static extern bool APIError_eq(long _a, long _b); + // struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_APIError_write")] public static extern byte[] APIError_write(long _obj); + // struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_APIError_read")] public static extern long APIError_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void BigSize_free(struct LDKBigSize this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_free")] public static extern void BigSize_free(long _this_obj); // uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr); @@ -3783,6 +4676,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_set_a")] public static extern void BigSize_set_a(long _this_ptr, long _val); // MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_new")] public static extern long BigSize_new(long _a_arg); + // uint64_t BigSize_clone_ptr(LDKBigSize *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_clone_ptr")] public static extern long BigSize_clone_ptr(long _arg); + // struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_clone")] public static extern long BigSize_clone(long _orig); + // uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_hash")] public static extern long BigSize_hash(long _o); + // bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_eq")] public static extern bool BigSize_eq(long _a, long _b); + // struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_write")] public static extern byte[] BigSize_write(long _obj); + // struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigSize_read")] public static extern long BigSize_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void Hostname_free(struct LDKHostname this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_free")] public static extern void Hostname_free(long _this_obj); // uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg); @@ -3793,16 +4698,54 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_eq")] public static extern bool Hostname_eq(long _a, long _b); // MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_len")] public static extern byte Hostname_len(long _this_arg); + // struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_write")] public static extern byte[] Hostname_write(long _obj); + // struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Hostname_read")] public static extern long Hostname_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_free")] public static extern void TransactionU16LenLimited_free(long _this_obj); + // uint64_t TransactionU16LenLimited_clone_ptr(LDKTransactionU16LenLimited *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_clone_ptr")] public static extern long TransactionU16LenLimited_clone_ptr(long _arg); + // struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_clone")] public static extern long TransactionU16LenLimited_clone(long _orig); + // bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_eq")] public static extern bool TransactionU16LenLimited_eq(long _a, long _b); + // MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_new")] public static extern long TransactionU16LenLimited_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _transaction); + // MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_into_transaction")] public static extern byte[] TransactionU16LenLimited_into_transaction(long _this_arg); + // struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_write")] public static extern byte[] TransactionU16LenLimited_write(long _obj); + // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_read")] public static extern long TransactionU16LenLimited_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_sign")] public static extern long sign(byte[] _msg, byte[] _sk); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_sign")] public static extern long sign([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _msg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _sk); // struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_recover_pk")] public static extern long recover_pk(byte[] _msg, string _sig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_recover_pk")] public static extern long recover_pk([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _msg, string _sig); // bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_verify")] public static extern bool verify(byte[] _msg, string _sig, byte[] _pk); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_verify")] public static extern bool verify([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _msg, string _sig, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _pk); // struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_construct_invoice_preimage")] public static extern byte[] construct_invoice_preimage(byte[] _hrp_bytes, byte[] _data_without_signature); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_construct_invoice_preimage")] public static extern byte[] construct_invoice_preimage([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _hrp_bytes, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _data_without_signature); // void Persister_free(struct LDKPersister this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_free")] public static extern void Persister_free(long _this_ptr); + // void UntrustedString_free(struct LDKUntrustedString this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_free")] public static extern void UntrustedString_free(long _this_obj); + // struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_get_a")] public static extern string UntrustedString_get_a(long _this_ptr); + // void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_set_a")] public static extern void UntrustedString_set_a(long _this_ptr, string _val); + // MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_new")] public static extern long UntrustedString_new(string _a_arg); + // uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_clone_ptr")] public static extern long UntrustedString_clone_ptr(long _arg); + // struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_clone")] public static extern long UntrustedString_clone(long _orig); + // bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_eq")] public static extern bool UntrustedString_eq(long _a, long _b); + // struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_write")] public static extern byte[] UntrustedString_write(long _obj); + // struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_read")] public static extern long UntrustedString_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void PrintableString_free(struct LDKPrintableString this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_free")] public static extern void PrintableString_free(long _this_obj); // struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr); @@ -3815,8 +4758,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FutureCallback_free")] public static extern void FutureCallback_free(long _this_ptr); // void Future_free(struct LDKFuture this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_free")] public static extern void Future_free(long _this_obj); + // uint64_t Future_clone_ptr(LDKFuture *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_clone_ptr")] public static extern long Future_clone_ptr(long _arg); + // struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_clone")] public static extern long Future_clone(long _orig); // void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_register_callback_fn")] public static extern void Future_register_callback_fn(long _this_arg, long _callback); + // void Future_wait(struct LDKFuture this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_wait")] public static extern void Future_wait(long _this_arg); + // MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_wait_timeout")] public static extern bool Future_wait_timeout(long _this_arg, long _max_wait); + // void Sleeper_free(struct LDKSleeper this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_free")] public static extern void Sleeper_free(long _this_obj); + // MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_from_single_future")] public static extern long Sleeper_from_single_future(long _future); + // MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_from_two_futures")] public static extern long Sleeper_from_two_futures(long _fut_a, long _fut_b); + // MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_new")] public static extern long Sleeper_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _futures); + // void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_wait")] public static extern void Sleeper_wait(long _this_arg); + // MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_wait_timeout")] public static extern bool Sleeper_wait_timeout(long _this_arg, long _max_wait); // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Level_clone")] public static extern Level Level_clone(long _orig); // enum LDKLevel Level_gossip(void); @@ -3899,8 +4862,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths")] public static extern int ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(long _this_ptr); // void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths")] public static extern void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(long _this_ptr, int _val); - // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_new")] public static extern long ChannelHandshakeConfig_new(int _minimum_depth_arg, short _our_to_self_delay_arg, long _our_htlc_minimum_msat_arg, byte _max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool _negotiate_scid_privacy_arg, bool _announced_channel_arg, bool _commit_upfront_shutdown_pubkey_arg, int _their_channel_reserve_proportional_millionths_arg); + // bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx")] public static extern bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(long _this_ptr); + // void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx")] public static extern void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(long _this_ptr, bool _val); + // uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_get_our_max_accepted_htlcs")] public static extern short ChannelHandshakeConfig_get_our_max_accepted_htlcs(long _this_ptr); + // void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_set_our_max_accepted_htlcs")] public static extern void ChannelHandshakeConfig_set_our_max_accepted_htlcs(long _this_ptr, short _val); + // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_new")] public static extern long ChannelHandshakeConfig_new(int _minimum_depth_arg, short _our_to_self_delay_arg, long _our_htlc_minimum_msat_arg, byte _max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool _negotiate_scid_privacy_arg, bool _announced_channel_arg, bool _commit_upfront_shutdown_pubkey_arg, int _their_channel_reserve_proportional_millionths_arg, bool _negotiate_anchors_zero_fee_htlc_tx_arg, short _our_max_accepted_htlcs_arg); // uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeConfig_clone_ptr")] public static extern long ChannelHandshakeConfig_clone_ptr(long _arg); // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); @@ -3957,6 +4928,22 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeLimits_clone")] public static extern long ChannelHandshakeLimits_clone(long _orig); // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelHandshakeLimits_default")] public static extern long ChannelHandshakeLimits_default(); + // void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_free")] public static extern void MaxDustHTLCExposure_free(long _this_ptr); + // uint64_t MaxDustHTLCExposure_clone_ptr(LDKMaxDustHTLCExposure *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_clone_ptr")] public static extern long MaxDustHTLCExposure_clone_ptr(long _arg); + // struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_clone")] public static extern long MaxDustHTLCExposure_clone(long _orig); + // struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_fixed_limit_msat")] public static extern long MaxDustHTLCExposure_fixed_limit_msat(long _a); + // struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_fee_rate_multiplier")] public static extern long MaxDustHTLCExposure_fee_rate_multiplier(long _a); + // bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_eq")] public static extern bool MaxDustHTLCExposure_eq(long _a, long _b); + // struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_write")] public static extern byte[] MaxDustHTLCExposure_write(long _obj); + // struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MaxDustHTLCExposure_read")] public static extern long MaxDustHTLCExposure_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void ChannelConfig_free(struct LDKChannelConfig this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_free")] public static extern void ChannelConfig_free(long _this_obj); // uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr); @@ -3971,28 +4958,60 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_get_cltv_expiry_delta")] public static extern short ChannelConfig_get_cltv_expiry_delta(long _this_ptr); // void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_set_cltv_expiry_delta")] public static extern void ChannelConfig_set_cltv_expiry_delta(long _this_ptr, short _val); - // uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_get_max_dust_htlc_exposure_msat")] public static extern long ChannelConfig_get_max_dust_htlc_exposure_msat(long _this_ptr); - // void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_set_max_dust_htlc_exposure_msat")] public static extern void ChannelConfig_set_max_dust_htlc_exposure_msat(long _this_ptr, long _val); + // struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_get_max_dust_htlc_exposure")] public static extern long ChannelConfig_get_max_dust_htlc_exposure(long _this_ptr); + // void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_set_max_dust_htlc_exposure")] public static extern void ChannelConfig_set_max_dust_htlc_exposure(long _this_ptr, long _val); // uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_get_force_close_avoidance_max_fee_satoshis")] public static extern long ChannelConfig_get_force_close_avoidance_max_fee_satoshis(long _this_ptr); // void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_set_force_close_avoidance_max_fee_satoshis")] public static extern void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_new")] public static extern long ChannelConfig_new(int _forwarding_fee_proportional_millionths_arg, int _forwarding_fee_base_msat_arg, short _cltv_expiry_delta_arg, long _max_dust_htlc_exposure_msat_arg, long _force_close_avoidance_max_fee_satoshis_arg); + // bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_get_accept_underpaying_htlcs")] public static extern bool ChannelConfig_get_accept_underpaying_htlcs(long _this_ptr); + // void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_set_accept_underpaying_htlcs")] public static extern void ChannelConfig_set_accept_underpaying_htlcs(long _this_ptr, bool _val); + // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, struct LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg, bool accept_underpaying_htlcs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_new")] public static extern long ChannelConfig_new(int _forwarding_fee_proportional_millionths_arg, int _forwarding_fee_base_msat_arg, short _cltv_expiry_delta_arg, long _max_dust_htlc_exposure_arg, long _force_close_avoidance_max_fee_satoshis_arg, bool _accept_underpaying_htlcs_arg); // uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_clone_ptr")] public static extern long ChannelConfig_clone_ptr(long _arg); // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_clone")] public static extern long ChannelConfig_clone(long _orig); // bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_eq")] public static extern bool ChannelConfig_eq(long _a, long _b); + // void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_apply")] public static extern void ChannelConfig_apply(long _this_arg, long _update); // MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_default")] public static extern long ChannelConfig_default(); // struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_write")] public static extern byte[] ChannelConfig_write(long _obj); // struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_read")] public static extern long ChannelConfig_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfig_read")] public static extern long ChannelConfig_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_free")] public static extern void ChannelConfigUpdate_free(long _this_obj); + // struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths")] public static extern long ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(long _this_ptr); + // void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths")] public static extern void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(long _this_ptr, long _val); + // struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_get_forwarding_fee_base_msat")] public static extern long ChannelConfigUpdate_get_forwarding_fee_base_msat(long _this_ptr); + // void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_set_forwarding_fee_base_msat")] public static extern void ChannelConfigUpdate_set_forwarding_fee_base_msat(long _this_ptr, long _val); + // struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_get_cltv_expiry_delta")] public static extern long ChannelConfigUpdate_get_cltv_expiry_delta(long _this_ptr); + // void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_set_cltv_expiry_delta")] public static extern void ChannelConfigUpdate_set_cltv_expiry_delta(long _this_ptr, long _val); + // struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat")] public static extern long ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(long _this_ptr); + // void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat")] public static extern void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(long _this_ptr, long _val); + // struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis")] public static extern long ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(long _this_ptr); + // void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis")] public static extern void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(long _this_ptr, long _val); + // MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_new(struct LDKCOption_u32Z forwarding_fee_proportional_millionths_arg, struct LDKCOption_u32Z forwarding_fee_base_msat_arg, struct LDKCOption_u16Z cltv_expiry_delta_arg, struct LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, struct LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_new")] public static extern long ChannelConfigUpdate_new(long _forwarding_fee_proportional_millionths_arg, long _forwarding_fee_base_msat_arg, long _cltv_expiry_delta_arg, long _max_dust_htlc_exposure_msat_arg, long _force_close_avoidance_max_fee_satoshis_arg); + // MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelConfigUpdate_default")] public static extern long ChannelConfigUpdate_default(); // void UserConfig_free(struct LDKUserConfig this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_free")] public static extern void UserConfig_free(long _this_obj); // struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr); @@ -4023,8 +5042,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_get_accept_intercept_htlcs")] public static extern bool UserConfig_get_accept_intercept_htlcs(long _this_ptr); // void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_set_accept_intercept_htlcs")] public static extern void UserConfig_set_accept_intercept_htlcs(long _this_ptr, bool _val); - // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_new")] public static extern long UserConfig_new(long _channel_handshake_config_arg, long _channel_handshake_limits_arg, long _channel_config_arg, bool _accept_forwards_to_priv_channels_arg, bool _accept_inbound_channels_arg, bool _manually_accept_inbound_channels_arg, bool _accept_intercept_htlcs_arg); + // bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_get_accept_mpp_keysend")] public static extern bool UserConfig_get_accept_mpp_keysend(long _this_ptr); + // void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_set_accept_mpp_keysend")] public static extern void UserConfig_set_accept_mpp_keysend(long _this_ptr, bool _val); + // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_new")] public static extern long UserConfig_new(long _channel_handshake_config_arg, long _channel_handshake_limits_arg, long _channel_config_arg, bool _accept_forwards_to_priv_channels_arg, bool _accept_inbound_channels_arg, bool _manually_accept_inbound_channels_arg, bool _accept_intercept_htlcs_arg, bool _accept_mpp_keysend_arg); // uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_clone_ptr")] public static extern long UserConfig_clone_ptr(long _arg); // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); @@ -4039,22 +5062,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_clone")] public static extern long BestBlock_clone(long _orig); // bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_eq")] public static extern bool BestBlock_eq(long _a, long _b); - // MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_from_genesis")] public static extern long BestBlock_from_genesis(Network _network); + // MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_from_network")] public static extern long BestBlock_from_network(Network _network); // MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_new")] public static extern long BestBlock_new(byte[] _block_hash, int _height); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_new")] public static extern long BestBlock_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _block_hash, int _height); // MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_block_hash")] public static extern byte[] BestBlock_block_hash(long _this_arg); // MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_height")] public static extern int BestBlock_height(long _this_arg); - // enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AccessError_clone")] public static extern AccessError AccessError_clone(long _orig); - // enum LDKAccessError AccessError_unknown_chain(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AccessError_unknown_chain")] public static extern AccessError AccessError_unknown_chain(); - // enum LDKAccessError AccessError_unknown_tx(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AccessError_unknown_tx")] public static extern AccessError AccessError_unknown_tx(); - // void Access_free(struct LDKAccess this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Access_free")] public static extern void Access_free(long _this_ptr); // void Listen_free(struct LDKListen this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_free")] public static extern void Listen_free(long _this_ptr); // void Confirm_free(struct LDKConfirm this_ptr); @@ -4075,10 +5090,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Filter_free")] public static extern void Filter_free(long _this_ptr); // void WatchedOutput_free(struct LDKWatchedOutput this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_free")] public static extern void WatchedOutput_free(long _this_obj); - // struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_get_block_hash")] public static extern byte[] WatchedOutput_get_block_hash(long _this_ptr); - // void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_set_block_hash")] public static extern void WatchedOutput_set_block_hash(long _this_ptr, byte[] _val); + // struct LDKCOption_BlockHashZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_get_block_hash")] public static extern long WatchedOutput_get_block_hash(long _this_ptr); + // void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_BlockHashZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_set_block_hash")] public static extern void WatchedOutput_set_block_hash(long _this_ptr, long _val); // struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_get_outpoint")] public static extern long WatchedOutput_get_outpoint(long _this_ptr); // void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val); @@ -4086,9 +5101,9 @@ internal class bindings { // struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_get_script_pubkey")] public static extern byte[] WatchedOutput_get_script_pubkey(long _this_ptr); // void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_set_script_pubkey")] public static extern void WatchedOutput_set_script_pubkey(long _this_ptr, byte[] _val); - // MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_new")] public static extern long WatchedOutput_new(byte[] _block_hash_arg, long _outpoint_arg, byte[] _script_pubkey_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_set_script_pubkey")] public static extern void WatchedOutput_set_script_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_BlockHashZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_new")] public static extern long WatchedOutput_new(long _block_hash_arg, long _outpoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _script_pubkey_arg); // uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WatchedOutput_clone_ptr")] public static extern long WatchedOutput_clone_ptr(long _arg); // struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig); @@ -4101,6 +5116,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BroadcasterInterface_free")] public static extern void BroadcasterInterface_free(long _this_ptr); // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_clone")] public static extern ConfirmationTarget ConfirmationTarget_clone(long _orig); + // enum LDKConfirmationTarget ConfirmationTarget_mempool_minimum(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_mempool_minimum")] public static extern ConfirmationTarget ConfirmationTarget_mempool_minimum(); // enum LDKConfirmationTarget ConfirmationTarget_background(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_background")] public static extern ConfirmationTarget ConfirmationTarget_background(); // enum LDKConfirmationTarget ConfirmationTarget_normal(void); @@ -4132,7 +5149,7 @@ internal class bindings { // MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_new")] public static extern long ChainMonitor_new(long _chain_source, long _broadcaster, long _logger, long _feeest, long _persister); // MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_claimable_balances")] public static extern long[] ChainMonitor_get_claimable_balances(long _this_arg, long[] _ignored_channels); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_claimable_balances")] public static extern long[] ChainMonitor_get_claimable_balances(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _ignored_channels); // MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_monitor")] public static extern long ChainMonitor_get_monitor(long _this_arg, long _funding_txo); // MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); @@ -4141,6 +5158,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_list_pending_monitor_updates")] public static extern long[] ChainMonitor_list_pending_monitor_updates(long _this_arg); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_channel_monitor_updated")] public static extern long ChainMonitor_channel_monitor_updated(long _this_arg, long _funding_txo, long _completed_update_id); + // MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_update_future")] public static extern long ChainMonitor_get_update_future(long _this_arg); + // void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_rebroadcast_pending_claims")] public static extern void ChainMonitor_rebroadcast_pending_claims(long _this_arg); // struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_as_Listen")] public static extern long ChainMonitor_as_Listen(long _this_arg); // struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg); @@ -4159,10 +5180,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_clone_ptr")] public static extern long ChannelMonitorUpdate_clone_ptr(long _arg); // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_clone")] public static extern long ChannelMonitorUpdate_clone(long _orig); + // bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_eq")] public static extern bool ChannelMonitorUpdate_eq(long _a, long _b); // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_write")] public static extern byte[] ChannelMonitorUpdate_write(long _obj); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_read")] public static extern long ChannelMonitorUpdate_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_read")] public static extern long ChannelMonitorUpdate_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void MonitorEvent_free(struct LDKMonitorEvent this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_free")] public static extern void MonitorEvent_free(long _this_ptr); // uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg); @@ -4182,7 +5205,7 @@ internal class bindings { // struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_write")] public static extern byte[] MonitorEvent_write(long _obj); // struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_read")] public static extern long MonitorEvent_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_read")] public static extern long MonitorEvent_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCUpdate_free")] public static extern void HTLCUpdate_free(long _this_obj); // uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg); @@ -4194,27 +5217,29 @@ internal class bindings { // struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCUpdate_write")] public static extern byte[] HTLCUpdate_write(long _obj); // struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCUpdate_read")] public static extern long HTLCUpdate_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCUpdate_read")] public static extern long HTLCUpdate_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void Balance_free(struct LDKBalance this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_free")] public static extern void Balance_free(long _this_ptr); // uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_clone_ptr")] public static extern long Balance_clone_ptr(long _arg); // struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_clone")] public static extern long Balance_clone(long _orig); - // struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_on_channel_close")] public static extern long Balance_claimable_on_channel_close(long _claimable_amount_satoshis); - // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_awaiting_confirmations")] public static extern long Balance_claimable_awaiting_confirmations(long _claimable_amount_satoshis, int _confirmation_height); - // struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_contentious_claimable")] public static extern long Balance_contentious_claimable(long _claimable_amount_satoshis, int _timeout_height); - // struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t claimable_height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_maybe_timeout_claimable_htlc")] public static extern long Balance_maybe_timeout_claimable_htlc(long _claimable_amount_satoshis, int _claimable_height); - // struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t expiry_height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_maybe_preimage_claimable_htlc")] public static extern long Balance_maybe_preimage_claimable_htlc(long _claimable_amount_satoshis, int _expiry_height); - // struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t claimable_amount_satoshis); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_counterparty_revoked_output_claimable")] public static extern long Balance_counterparty_revoked_output_claimable(long _claimable_amount_satoshis); + // struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_on_channel_close")] public static extern long Balance_claimable_on_channel_close(long _amount_satoshis); + // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_awaiting_confirmations")] public static extern long Balance_claimable_awaiting_confirmations(long _amount_satoshis, int _confirmation_height); + // struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_contentious_claimable")] public static extern long Balance_contentious_claimable(long _amount_satoshis, int _timeout_height, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_preimage); + // struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_maybe_timeout_claimable_htlc")] public static extern long Balance_maybe_timeout_claimable_htlc(long _amount_satoshis, int _claimable_height, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash); + // struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_maybe_preimage_claimable_htlc")] public static extern long Balance_maybe_preimage_claimable_htlc(long _amount_satoshis, int _expiry_height, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash); + // struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_counterparty_revoked_output_claimable")] public static extern long Balance_counterparty_revoked_output_claimable(long _amount_satoshis); // bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_eq")] public static extern bool Balance_eq(long _a, long _b); + // MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Balance_claimable_amount_satoshis")] public static extern long Balance_claimable_amount_satoshis(long _this_arg); // void ChannelMonitor_free(struct LDKChannelMonitor this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_free")] public static extern void ChannelMonitor_free(long _this_obj); // uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg); @@ -4235,42 +5260,44 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_load_outputs_to_watch")] public static extern void ChannelMonitor_load_outputs_to_watch(long _this_arg, long _filter); // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_and_clear_pending_monitor_events")] public static extern long[] ChannelMonitor_get_and_clear_pending_monitor_events(long _this_arg); - // MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_and_clear_pending_events")] public static extern long[] ChannelMonitor_get_and_clear_pending_events(long _this_arg); + // void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_process_pending_events")] public static extern void ChannelMonitor_process_pending_events(long _this_arg, long _handler); // MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_counterparty_node_id")] public static extern byte[] ChannelMonitor_get_counterparty_node_id(long _this_arg); // MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_latest_holder_commitment_txn")] public static extern byte[][] ChannelMonitor_get_latest_holder_commitment_txn(long _this_arg, long _logger); // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_block_connected")] public static extern long[] ChannelMonitor_block_connected(long _this_arg, byte[] _header, long[] _txdata, int _height, long _broadcaster, long _fee_estimator, long _logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_block_connected")] public static extern long[] ChannelMonitor_block_connected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _txdata, int _height, long _broadcaster, long _fee_estimator, long _logger); // void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_block_disconnected")] public static extern void ChannelMonitor_block_disconnected(long _this_arg, byte[] _header, int _height, long _broadcaster, long _fee_estimator, long _logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_block_disconnected")] public static extern void ChannelMonitor_block_disconnected(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, int _height, long _broadcaster, long _fee_estimator, long _logger); // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_transactions_confirmed")] public static extern long[] ChannelMonitor_transactions_confirmed(long _this_arg, byte[] _header, long[] _txdata, int _height, long _broadcaster, long _fee_estimator, long _logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_transactions_confirmed")] public static extern long[] ChannelMonitor_transactions_confirmed(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _txdata, int _height, long _broadcaster, long _fee_estimator, long _logger); // void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_transaction_unconfirmed")] public static extern void ChannelMonitor_transaction_unconfirmed(long _this_arg, byte[] _txid, long _broadcaster, long _fee_estimator, long _logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_transaction_unconfirmed")] public static extern void ChannelMonitor_transaction_unconfirmed(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _txid, long _broadcaster, long _fee_estimator, long _logger); // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_best_block_updated")] public static extern long[] ChannelMonitor_best_block_updated(long _this_arg, byte[] _header, int _height, long _broadcaster, long _fee_estimator, long _logger); - // MUST_USE_RES struct LDKCVec_C2Tuple_TxidBlockHashZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_best_block_updated")] public static extern long[] ChannelMonitor_best_block_updated(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _header, int _height, long _broadcaster, long _fee_estimator, long _logger); + // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_relevant_txids")] public static extern long[] ChannelMonitor_get_relevant_txids(long _this_arg); // MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_current_best_block")] public static extern long ChannelMonitor_current_best_block(long _this_arg); + // void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_rebroadcast_pending_claims")] public static extern void ChannelMonitor_rebroadcast_pending_claims(long _this_arg, long _broadcaster, long _fee_estimator, long _logger); // MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_claimable_balances")] public static extern long[] ChannelMonitor_get_claimable_balances(long _this_arg); - // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_read")] public static extern long C2Tuple_BlockHashChannelMonitorZ_read(byte[] _ser, long _arg); + // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelMonitorZ_read")] public static extern long C2Tuple_BlockHashChannelMonitorZ_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, long _arg_a, long _arg_b); // void OutPoint_free(struct LDKOutPoint this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_free")] public static extern void OutPoint_free(long _this_obj); // const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_get_txid")] public static extern byte[] OutPoint_get_txid(long _this_ptr); // void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_set_txid")] public static extern void OutPoint_set_txid(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_set_txid")] public static extern void OutPoint_set_txid(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_get_index")] public static extern short OutPoint_get_index(long _this_ptr); // void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_set_index")] public static extern void OutPoint_set_index(long _this_ptr, short _val); // MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_new")] public static extern long OutPoint_new(byte[] _txid_arg, short _index_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_new")] public static extern long OutPoint_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _txid_arg, short _index_arg); // uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_clone_ptr")] public static extern long OutPoint_clone_ptr(long _arg); // struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); @@ -4284,191 +5311,15 @@ internal class bindings { // struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_write")] public static extern byte[] OutPoint_write(long _obj); // struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_read")] public static extern long OutPoint_read(byte[] _ser); - // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_free")] public static extern void DelayedPaymentOutputDescriptor_free(long _this_obj); - // struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_outpoint")] public static extern long DelayedPaymentOutputDescriptor_get_outpoint(long _this_ptr); - // void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_outpoint")] public static extern void DelayedPaymentOutputDescriptor_set_outpoint(long _this_ptr, long _val); - // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_per_commitment_point")] public static extern byte[] DelayedPaymentOutputDescriptor_get_per_commitment_point(long _this_ptr); - // void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_per_commitment_point")] public static extern void DelayedPaymentOutputDescriptor_set_per_commitment_point(long _this_ptr, byte[] _val); - // uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_to_self_delay")] public static extern short DelayedPaymentOutputDescriptor_get_to_self_delay(long _this_ptr); - // void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_to_self_delay")] public static extern void DelayedPaymentOutputDescriptor_set_to_self_delay(long _this_ptr, short _val); - // struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_output")] public static extern long DelayedPaymentOutputDescriptor_get_output(long _this_ptr); - // void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_output")] public static extern void DelayedPaymentOutputDescriptor_set_output(long _this_ptr, long _val); - // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey")] public static extern byte[] DelayedPaymentOutputDescriptor_get_revocation_pubkey(long _this_ptr); - // void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_revocation_pubkey")] public static extern void DelayedPaymentOutputDescriptor_set_revocation_pubkey(long _this_ptr, byte[] _val); - // const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_channel_keys_id")] public static extern byte[] DelayedPaymentOutputDescriptor_get_channel_keys_id(long _this_ptr); - // void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_channel_keys_id")] public static extern void DelayedPaymentOutputDescriptor_set_channel_keys_id(long _this_ptr, byte[] _val); - // uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_channel_value_satoshis")] public static extern long DelayedPaymentOutputDescriptor_get_channel_value_satoshis(long _this_ptr); - // void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis")] public static extern void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(long _this_ptr, long _val); - // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_new")] public static extern long DelayedPaymentOutputDescriptor_new(long _outpoint_arg, byte[] _per_commitment_point_arg, short _to_self_delay_arg, long _output_arg, byte[] _revocation_pubkey_arg, byte[] _channel_keys_id_arg, long _channel_value_satoshis_arg); - // uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_clone_ptr")] public static extern long DelayedPaymentOutputDescriptor_clone_ptr(long _arg); - // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_clone")] public static extern long DelayedPaymentOutputDescriptor_clone(long _orig); - // bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_eq")] public static extern bool DelayedPaymentOutputDescriptor_eq(long _a, long _b); - // struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_write")] public static extern byte[] DelayedPaymentOutputDescriptor_write(long _obj); - // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_read")] public static extern long DelayedPaymentOutputDescriptor_read(byte[] _ser); - // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_free")] public static extern void StaticPaymentOutputDescriptor_free(long _this_obj); - // struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_outpoint")] public static extern long StaticPaymentOutputDescriptor_get_outpoint(long _this_ptr); - // void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_outpoint")] public static extern void StaticPaymentOutputDescriptor_set_outpoint(long _this_ptr, long _val); - // struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_output")] public static extern long StaticPaymentOutputDescriptor_get_output(long _this_ptr); - // void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_output")] public static extern void StaticPaymentOutputDescriptor_set_output(long _this_ptr, long _val); - // const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_channel_keys_id")] public static extern byte[] StaticPaymentOutputDescriptor_get_channel_keys_id(long _this_ptr); - // void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_channel_keys_id")] public static extern void StaticPaymentOutputDescriptor_set_channel_keys_id(long _this_ptr, byte[] _val); - // uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_channel_value_satoshis")] public static extern long StaticPaymentOutputDescriptor_get_channel_value_satoshis(long _this_ptr); - // void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_channel_value_satoshis")] public static extern void StaticPaymentOutputDescriptor_set_channel_value_satoshis(long _this_ptr, long _val); - // MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_new")] public static extern long StaticPaymentOutputDescriptor_new(long _outpoint_arg, long _output_arg, byte[] _channel_keys_id_arg, long _channel_value_satoshis_arg); - // uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_clone_ptr")] public static extern long StaticPaymentOutputDescriptor_clone_ptr(long _arg); - // struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_clone")] public static extern long StaticPaymentOutputDescriptor_clone(long _orig); - // bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_eq")] public static extern bool StaticPaymentOutputDescriptor_eq(long _a, long _b); - // struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_write")] public static extern byte[] StaticPaymentOutputDescriptor_write(long _obj); - // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_read")] public static extern long StaticPaymentOutputDescriptor_read(byte[] _ser); - // void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_free")] public static extern void SpendableOutputDescriptor_free(long _this_ptr); - // uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_clone_ptr")] public static extern long SpendableOutputDescriptor_clone_ptr(long _arg); - // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_clone")] public static extern long SpendableOutputDescriptor_clone(long _orig); - // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_static_output")] public static extern long SpendableOutputDescriptor_static_output(long _outpoint, long _output); - // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_delayed_payment_output")] public static extern long SpendableOutputDescriptor_delayed_payment_output(long _a); - // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_static_payment_output")] public static extern long SpendableOutputDescriptor_static_payment_output(long _a); - // bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_eq")] public static extern bool SpendableOutputDescriptor_eq(long _a, long _b); - // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_write")] public static extern byte[] SpendableOutputDescriptor_write(long _obj); - // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_read")] public static extern long SpendableOutputDescriptor_read(byte[] _ser); - // void BaseSign_free(struct LDKBaseSign this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BaseSign_free")] public static extern void BaseSign_free(long _this_ptr); - // uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sign_clone_ptr")] public static extern long Sign_clone_ptr(long _arg); - // struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sign_clone")] public static extern long Sign_clone(long _orig); - // void Sign_free(struct LDKSign this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sign_free")] public static extern void Sign_free(long _this_ptr); - // enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Recipient_clone")] public static extern Recipient Recipient_clone(long _orig); - // enum LDKRecipient Recipient_node(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Recipient_node")] public static extern Recipient Recipient_node(); - // enum LDKRecipient Recipient_phantom_node(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Recipient_phantom_node")] public static extern Recipient Recipient_phantom_node(); - // void KeysInterface_free(struct LDKKeysInterface this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysInterface_free")] public static extern void KeysInterface_free(long _this_ptr); - // void InMemorySigner_free(struct LDKInMemorySigner this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_free")] public static extern void InMemorySigner_free(long _this_obj); - // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_funding_key")] public static extern byte[] InMemorySigner_get_funding_key(long _this_ptr); - // void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_funding_key")] public static extern void InMemorySigner_set_funding_key(long _this_ptr, byte[] _val); - // const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_revocation_base_key")] public static extern byte[] InMemorySigner_get_revocation_base_key(long _this_ptr); - // void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_revocation_base_key")] public static extern void InMemorySigner_set_revocation_base_key(long _this_ptr, byte[] _val); - // const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_payment_key")] public static extern byte[] InMemorySigner_get_payment_key(long _this_ptr); - // void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_payment_key")] public static extern void InMemorySigner_set_payment_key(long _this_ptr, byte[] _val); - // const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_delayed_payment_base_key")] public static extern byte[] InMemorySigner_get_delayed_payment_base_key(long _this_ptr); - // void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_delayed_payment_base_key")] public static extern void InMemorySigner_set_delayed_payment_base_key(long _this_ptr, byte[] _val); - // const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_htlc_base_key")] public static extern byte[] InMemorySigner_get_htlc_base_key(long _this_ptr); - // void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_htlc_base_key")] public static extern void InMemorySigner_set_htlc_base_key(long _this_ptr, byte[] _val); - // const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_commitment_seed")] public static extern byte[] InMemorySigner_get_commitment_seed(long _this_ptr); - // void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_commitment_seed")] public static extern void InMemorySigner_set_commitment_seed(long _this_ptr, byte[] _val); - // uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_clone_ptr")] public static extern long InMemorySigner_clone_ptr(long _arg); - // struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_clone")] public static extern long InMemorySigner_clone(long _orig); - // MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey node_secret, struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_new")] public static extern long InMemorySigner_new(byte[] _node_secret, byte[] _funding_key, byte[] _revocation_base_key, byte[] _payment_key, byte[] _delayed_payment_base_key, byte[] _htlc_base_key, byte[] _commitment_seed, long _channel_value_satoshis, byte[] _channel_keys_id); - // MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_counterparty_pubkeys")] public static extern long InMemorySigner_counterparty_pubkeys(long _this_arg); - // MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_counterparty_selected_contest_delay")] public static extern short InMemorySigner_counterparty_selected_contest_delay(long _this_arg); - // MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_holder_selected_contest_delay")] public static extern short InMemorySigner_holder_selected_contest_delay(long _this_arg); - // MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_is_outbound")] public static extern bool InMemorySigner_is_outbound(long _this_arg); - // MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_funding_outpoint")] public static extern long InMemorySigner_funding_outpoint(long _this_arg); - // MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_channel_parameters")] public static extern long InMemorySigner_get_channel_parameters(long _this_arg); - // MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_opt_anchors")] public static extern bool InMemorySigner_opt_anchors(long _this_arg); - // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_sign_counterparty_payment_input")] public static extern long InMemorySigner_sign_counterparty_payment_input(long _this_arg, byte[] _spend_tx, long _input_idx, long _descriptor); - // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_sign_dynamic_p2wsh_input")] public static extern long InMemorySigner_sign_dynamic_p2wsh_input(long _this_arg, byte[] _spend_tx, long _input_idx, long _descriptor); - // struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_BaseSign")] public static extern long InMemorySigner_as_BaseSign(long _this_arg); - // struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_Sign")] public static extern long InMemorySigner_as_Sign(long _this_arg); - // struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_write")] public static extern byte[] InMemorySigner_write(long _obj); - // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_read")] public static extern long InMemorySigner_read(byte[] _ser, byte[] _arg); - // void KeysManager_free(struct LDKKeysManager this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_free")] public static extern void KeysManager_free(long _this_obj); - // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_new")] public static extern long KeysManager_new(byte[] _seed, long _starting_time_secs, int _starting_time_nanos); - // MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_derive_channel_keys")] public static extern long KeysManager_derive_channel_keys(long _this_arg, long _channel_value_satoshis, byte[] _params); - // MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_spend_spendable_outputs")] public static extern long KeysManager_spend_spendable_outputs(long _this_arg, long[] _descriptors, long[] _outputs, byte[] _change_destination_script, int _feerate_sat_per_1000_weight); - // struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_KeysInterface")] public static extern long KeysManager_as_KeysInterface(long _this_arg); - // void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_free")] public static extern void PhantomKeysManager_free(long _this_obj); - // struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_KeysInterface")] public static extern long PhantomKeysManager_as_KeysInterface(long _this_arg); - // MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_new")] public static extern long PhantomKeysManager_new(byte[] _seed, long _starting_time_secs, int _starting_time_nanos, byte[] _cross_node_seed); - // MUST_USE_RES struct LDKCResult_TransactionNoneZ PhantomKeysManager_spend_spendable_outputs(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_spend_spendable_outputs")] public static extern long PhantomKeysManager_spend_spendable_outputs(long _this_arg, long[] _descriptors, long[] _outputs, byte[] _change_destination_script, int _feerate_sat_per_1000_weight); - // MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_derive_channel_keys")] public static extern long PhantomKeysManager_derive_channel_keys(long _this_arg, long _channel_value_satoshis, byte[] _params); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_read")] public static extern long OutPoint_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // enum LDKFailureCode FailureCode_clone(const enum LDKFailureCode *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FailureCode_clone")] public static extern FailureCode FailureCode_clone(long _orig); + // enum LDKFailureCode FailureCode_temporary_node_failure(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FailureCode_temporary_node_failure")] public static extern FailureCode FailureCode_temporary_node_failure(); + // enum LDKFailureCode FailureCode_required_node_feature_missing(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FailureCode_required_node_feature_missing")] public static extern FailureCode FailureCode_required_node_feature_missing(); + // enum LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FailureCode_incorrect_or_unknown_payment_details")] public static extern FailureCode FailureCode_incorrect_or_unknown_payment_details(); // void ChannelManager_free(struct LDKChannelManager this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_free")] public static extern void ChannelManager_free(long _this_obj); // void ChainParameters_free(struct LDKChainParameters this_obj); @@ -4512,7 +5363,7 @@ internal class bindings { // struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_node_id")] public static extern byte[] ChannelCounterparty_get_node_id(long _this_ptr); // void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_node_id")] public static extern void ChannelCounterparty_set_node_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_node_id")] public static extern void ChannelCounterparty_set_node_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_get_features")] public static extern long ChannelCounterparty_get_features(long _this_ptr); // void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val); @@ -4534,7 +5385,7 @@ internal class bindings { // void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat")] public static extern void ChannelCounterparty_set_outbound_htlc_maximum_msat(long _this_ptr, long _val); // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_new")] public static extern long ChannelCounterparty_new(byte[] _node_id_arg, long _features_arg, long _unspendable_punishment_reserve_arg, long _forwarding_info_arg, long _outbound_htlc_minimum_msat_arg, long _outbound_htlc_maximum_msat_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_new")] public static extern long ChannelCounterparty_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id_arg, long _features_arg, long _unspendable_punishment_reserve_arg, long _forwarding_info_arg, long _outbound_htlc_minimum_msat_arg, long _outbound_htlc_maximum_msat_arg); // uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_clone_ptr")] public static extern long ChannelCounterparty_clone_ptr(long _arg); // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); @@ -4544,7 +5395,7 @@ internal class bindings { // const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_id")] public static extern byte[] ChannelDetails_get_channel_id(long _this_ptr); // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_id")] public static extern void ChannelDetails_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_id")] public static extern void ChannelDetails_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_counterparty")] public static extern long ChannelDetails_get_counterparty(long _this_ptr); // void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val); @@ -4580,7 +5431,11 @@ internal class bindings { // struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_user_channel_id")] public static extern byte[] ChannelDetails_get_user_channel_id(long _this_ptr); // void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_user_channel_id")] public static extern void ChannelDetails_set_user_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_user_channel_id")] public static extern void ChannelDetails_set_user_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_feerate_sat_per_1000_weight")] public static extern long ChannelDetails_get_feerate_sat_per_1000_weight(long _this_ptr); + // void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight")] public static extern void ChannelDetails_set_feerate_sat_per_1000_weight(long _this_ptr, long _val); // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_balance_msat")] public static extern long ChannelDetails_get_balance_msat(long _this_ptr); // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); @@ -4593,6 +5448,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_next_outbound_htlc_limit_msat")] public static extern long ChannelDetails_get_next_outbound_htlc_limit_msat(long _this_ptr); // void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_next_outbound_htlc_limit_msat")] public static extern void ChannelDetails_set_next_outbound_htlc_limit_msat(long _this_ptr, long _val); + // uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_next_outbound_htlc_minimum_msat")] public static extern long ChannelDetails_get_next_outbound_htlc_minimum_msat(long _this_ptr); + // void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_next_outbound_htlc_minimum_msat")] public static extern void ChannelDetails_set_next_outbound_htlc_minimum_msat(long _this_ptr, long _val); // uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_capacity_msat")] public static extern long ChannelDetails_get_inbound_capacity_msat(long _this_ptr); // void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); @@ -4617,6 +5476,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_channel_ready")] public static extern bool ChannelDetails_get_is_channel_ready(long _this_ptr); // void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_is_channel_ready")] public static extern void ChannelDetails_set_is_channel_ready(long _this_ptr, bool _val); + // struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_shutdown_state")] public static extern long ChannelDetails_get_channel_shutdown_state(long _this_ptr); + // void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_shutdown_state")] public static extern void ChannelDetails_set_channel_shutdown_state(long _this_ptr, long _val); // bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_is_usable")] public static extern bool ChannelDetails_get_is_usable(long _this_ptr); // void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); @@ -4637,8 +5500,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_config")] public static extern long ChannelDetails_get_config(long _this_ptr); // void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_config")] public static extern void ChannelDetails_set_config(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_new")] public static extern long ChannelDetails_new(byte[] _channel_id_arg, long _counterparty_arg, long _funding_txo_arg, long _channel_type_arg, long _short_channel_id_arg, long _outbound_scid_alias_arg, long _inbound_scid_alias_arg, long _channel_value_satoshis_arg, long _unspendable_punishment_reserve_arg, byte[] _user_channel_id_arg, long _balance_msat_arg, long _outbound_capacity_msat_arg, long _next_outbound_htlc_limit_msat_arg, long _inbound_capacity_msat_arg, long _confirmations_required_arg, long _confirmations_arg, long _force_close_spend_delay_arg, bool _is_outbound_arg, bool _is_channel_ready_arg, bool _is_usable_arg, bool _is_public_arg, long _inbound_htlc_minimum_msat_arg, long _inbound_htlc_maximum_msat_arg, long _config_arg); + // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_new")] public static extern long ChannelDetails_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _counterparty_arg, long _funding_txo_arg, long _channel_type_arg, long _short_channel_id_arg, long _outbound_scid_alias_arg, long _inbound_scid_alias_arg, long _channel_value_satoshis_arg, long _unspendable_punishment_reserve_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id_arg, long _feerate_sat_per_1000_weight_arg, long _balance_msat_arg, long _outbound_capacity_msat_arg, long _next_outbound_htlc_limit_msat_arg, long _next_outbound_htlc_minimum_msat_arg, long _inbound_capacity_msat_arg, long _confirmations_required_arg, long _confirmations_arg, long _force_close_spend_delay_arg, bool _is_outbound_arg, bool _is_channel_ready_arg, long _channel_shutdown_state_arg, bool _is_usable_arg, bool _is_public_arg, long _inbound_htlc_minimum_msat_arg, long _inbound_htlc_maximum_msat_arg, long _config_arg); // uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_clone_ptr")] public static extern long ChannelDetails_clone_ptr(long _arg); // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); @@ -4647,28 +5510,38 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_inbound_payment_scid")] public static extern long ChannelDetails_get_inbound_payment_scid(long _this_arg); // MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_outbound_payment_scid")] public static extern long ChannelDetails_get_outbound_payment_scid(long _this_arg); - // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_free")] public static extern void PaymentSendFailure_free(long _this_ptr); - // uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_clone_ptr")] public static extern long PaymentSendFailure_clone_ptr(long _arg); - // struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_clone")] public static extern long PaymentSendFailure_clone(long _orig); - // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_parameter_error")] public static extern long PaymentSendFailure_parameter_error(long _a); - // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_path_parameter_error")] public static extern long PaymentSendFailure_path_parameter_error(long[] _a); - // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_all_failed_resend_safe")] public static extern long PaymentSendFailure_all_failed_resend_safe(long[] _a); - // struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_duplicate_payment")] public static extern long PaymentSendFailure_duplicate_payment(); - // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_partial_failure")] public static extern long PaymentSendFailure_partial_failure(long[] _results, long _failed_paths_retry, byte[] _payment_id); + // enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_clone")] public static extern ChannelShutdownState ChannelShutdownState_clone(long _orig); + // enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_not_shutting_down")] public static extern ChannelShutdownState ChannelShutdownState_not_shutting_down(); + // enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_shutdown_initiated")] public static extern ChannelShutdownState ChannelShutdownState_shutdown_initiated(); + // enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_resolving_htlcs")] public static extern ChannelShutdownState ChannelShutdownState_resolving_htlcs(); + // enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_negotiating_closing_fee")] public static extern ChannelShutdownState ChannelShutdownState_negotiating_closing_fee(); + // enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_shutdown_complete")] public static extern ChannelShutdownState ChannelShutdownState_shutdown_complete(); + // bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_eq")] public static extern bool ChannelShutdownState_eq(long _a, long _b); + // void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecentPaymentDetails_free")] public static extern void RecentPaymentDetails_free(long _this_ptr); + // uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecentPaymentDetails_clone_ptr")] public static extern long RecentPaymentDetails_clone_ptr(long _arg); + // struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecentPaymentDetails_clone")] public static extern long RecentPaymentDetails_clone(long _orig); + // struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecentPaymentDetails_pending")] public static extern long RecentPaymentDetails_pending([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _total_msat); + // struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKCOption_PaymentHashZ payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecentPaymentDetails_fulfilled")] public static extern long RecentPaymentDetails_fulfilled(long _payment_hash); + // struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecentPaymentDetails_abandoned")] public static extern long RecentPaymentDetails_abandoned([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash); // void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_free")] public static extern void PhantomRouteHints_free(long _this_obj); // struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_get_channels")] public static extern long[] PhantomRouteHints_get_channels(long _this_ptr); // void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_set_channels")] public static extern void PhantomRouteHints_set_channels(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_set_channels")] public static extern void PhantomRouteHints_set_channels(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_get_phantom_scid")] public static extern long PhantomRouteHints_get_phantom_scid(long _this_ptr); // void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val); @@ -4676,77 +5549,83 @@ internal class bindings { // struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_get_real_node_pubkey")] public static extern byte[] PhantomRouteHints_get_real_node_pubkey(long _this_ptr); // void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_set_real_node_pubkey")] public static extern void PhantomRouteHints_set_real_node_pubkey(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_set_real_node_pubkey")] public static extern void PhantomRouteHints_set_real_node_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_new")] public static extern long PhantomRouteHints_new(long[] _channels_arg, long _phantom_scid_arg, byte[] _real_node_pubkey_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_new")] public static extern long PhantomRouteHints_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _channels_arg, long _phantom_scid_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _real_node_pubkey_arg); // uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_clone_ptr")] public static extern long PhantomRouteHints_clone_ptr(long _arg); // struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_clone")] public static extern long PhantomRouteHints_clone(long _orig); - // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_new")] public static extern long ChannelManager_new(long _fee_est, long _chain_monitor, long _tx_broadcaster, long _logger, long _keys_manager, long _config, long _params); + // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_new")] public static extern long ChannelManager_new(long _fee_est, long _chain_monitor, long _tx_broadcaster, long _router, long _logger, long _entropy_source, long _node_signer, long _signer_provider, long _config, long _params, int _current_timestamp); // MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_current_default_configuration")] public static extern long ChannelManager_get_current_default_configuration(long _this_arg); // MUST_USE_RES struct LDKCResult__u832APIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKUserConfig override_config); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_channel")] public static extern long ChannelManager_create_channel(long _this_arg, byte[] _their_network_key, long _channel_value_satoshis, long _push_msat, byte[] _user_channel_id, long _override_config); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_channel")] public static extern long ChannelManager_create_channel(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_network_key, long _channel_value_satoshis, long _push_msat, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id, long _override_config); // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_list_channels")] public static extern long[] ChannelManager_list_channels(long _this_arg); // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_list_usable_channels")] public static extern long[] ChannelManager_list_usable_channels(long _this_arg); + // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_list_channels_with_counterparty")] public static extern long[] ChannelManager_list_channels_with_counterparty(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id); + // MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_list_recent_payments")] public static extern long[] ChannelManager_list_recent_payments(long _this_arg); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_close_channel")] public static extern long ChannelManager_close_channel(long _this_arg, byte[] _channel_id, byte[] _counterparty_node_id); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, uint32_t target_feerate_sats_per_1000_weight); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_close_channel_with_target_feerate")] public static extern long ChannelManager_close_channel_with_target_feerate(long _this_arg, byte[] _channel_id, byte[] _counterparty_node_id, int _target_feerate_sats_per_1000_weight); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_close_channel")] public static extern long ChannelManager_close_channel(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_close_channel_with_feerate_and_script")] public static extern long ChannelManager_close_channel_with_feerate_and_script(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, long _target_feerate_sats_per_1000_weight, long _shutdown_script); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_broadcasting_latest_txn")] public static extern long ChannelManager_force_close_broadcasting_latest_txn(long _this_arg, byte[] _channel_id, byte[] _counterparty_node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_broadcasting_latest_txn")] public static extern long ChannelManager_force_close_broadcasting_latest_txn(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_without_broadcasting_txn")] public static extern long ChannelManager_force_close_without_broadcasting_txn(long _this_arg, byte[] _channel_id, byte[] _counterparty_node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_without_broadcasting_txn")] public static extern long ChannelManager_force_close_without_broadcasting_txn(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id); // void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn")] public static extern void ChannelManager_force_close_all_channels_broadcasting_latest_txn(long _this_arg); // void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn")] public static extern void ChannelManager_force_close_all_channels_without_broadcasting_txn(long _this_arg); - // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_payment")] public static extern long ChannelManager_send_payment(long _this_arg, long _route, byte[] _payment_hash, byte[] _payment_secret, byte[] _payment_id); - // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_retry_payment")] public static extern long ChannelManager_retry_payment(long _this_arg, long _route, byte[] _payment_id); + // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_payment_with_route")] public static extern long ChannelManager_send_payment_with_route(long _this_arg, long _route, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _recipient_onion, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id); + // MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_payment")] public static extern long ChannelManager_send_payment(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _recipient_onion, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, long _route_params, long _retry_strategy); // void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_abandon_payment")] public static extern void ChannelManager_abandon_payment(long _this_arg, byte[] _payment_id); - // MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_spontaneous_payment")] public static extern long ChannelManager_send_spontaneous_payment(long _this_arg, long _route, byte[] _payment_preimage, byte[] _payment_id); - // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_probe")] public static extern long ChannelManager_send_probe(long _this_arg, long[] _hops); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_abandon_payment")] public static extern void ChannelManager_abandon_payment(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id); + // MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_PaymentPreimageZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_spontaneous_payment")] public static extern long ChannelManager_send_spontaneous_payment(long _this_arg, long _route, long _payment_preimage, long _recipient_onion, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id); + // MUST_USE_RES struct LDKCResult_PaymentHashRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_PaymentPreimageZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_spontaneous_payment_with_retry")] public static extern long ChannelManager_send_spontaneous_payment_with_retry(long _this_arg, long _payment_preimage, long _recipient_onion, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, long _route_params, long _retry_strategy); + // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_probe")] public static extern long ChannelManager_send_probe(long _this_arg, long _path); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_funding_transaction_generated")] public static extern long ChannelManager_funding_transaction_generated(long _this_arg, byte[] _temporary_channel_id, byte[] _counterparty_node_id, byte[] _funding_transaction); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_funding_transaction_generated")] public static extern long ChannelManager_funding_transaction_generated(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_transaction); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_update_partial_channel_config")] public static extern long ChannelManager_update_partial_channel_config(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _channel_ids, long _config_update); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_update_channel_config")] public static extern long ChannelManager_update_channel_config(long _this_arg, byte[] _counterparty_node_id, byte[][] _channel_ids, long _config); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey _next_node_id, uint64_t amt_to_forward_msat); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_forward_intercepted_htlc")] public static extern long ChannelManager_forward_intercepted_htlc(long _this_arg, byte[] _intercept_id, byte[] _next_hop_channel_id, byte[] __next_node_id, long _amt_to_forward_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_update_channel_config")] public static extern long ChannelManager_update_channel_config(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _channel_ids, long _config); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_forward_intercepted_htlc")] public static extern long ChannelManager_forward_intercepted_htlc(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _intercept_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _next_hop_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _next_node_id, long _amt_to_forward_msat); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_fail_intercepted_htlc")] public static extern long ChannelManager_fail_intercepted_htlc(long _this_arg, byte[] _intercept_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_fail_intercepted_htlc")] public static extern long ChannelManager_fail_intercepted_htlc(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _intercept_id); // void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_process_pending_htlc_forwards")] public static extern void ChannelManager_process_pending_htlc_forwards(long _this_arg); // void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_timer_tick_occurred")] public static extern void ChannelManager_timer_tick_occurred(long _this_arg); // void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_fail_htlc_backwards")] public static extern void ChannelManager_fail_htlc_backwards(long _this_arg, byte[] _payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_fail_htlc_backwards")] public static extern void ChannelManager_fail_htlc_backwards(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash); + // void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], enum LDKFailureCode failure_code); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_fail_htlc_backwards_with_reason")] public static extern void ChannelManager_fail_htlc_backwards_with_reason(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, FailureCode _failure_code); // void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_claim_funds")] public static extern void ChannelManager_claim_funds(long _this_arg, byte[] _payment_preimage); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_claim_funds")] public static extern void ChannelManager_claim_funds(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_preimage); // MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_our_node_id")] public static extern byte[] ChannelManager_get_our_node_id(long _this_arg); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_accept_inbound_channel")] public static extern long ChannelManager_accept_inbound_channel(long _this_arg, byte[] _temporary_channel_id, byte[] _counterparty_node_id, byte[] _user_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_accept_inbound_channel")] public static extern long ChannelManager_accept_inbound_channel(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf")] public static extern long ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(long _this_arg, byte[] _temporary_channel_id, byte[] _counterparty_node_id, byte[] _user_channel_id); - // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_inbound_payment")] public static extern long ChannelManager_create_inbound_payment(long _this_arg, long _min_value_msat, int _invoice_expiry_delta_secs); - // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_inbound_payment_legacy")] public static extern long ChannelManager_create_inbound_payment_legacy(long _this_arg, long _min_value_msat, int _invoice_expiry_delta_secs); - // MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_inbound_payment_for_hash")] public static extern long ChannelManager_create_inbound_payment_for_hash(long _this_arg, byte[] _payment_hash, long _min_value_msat, int _invoice_expiry_delta_secs); - // MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_inbound_payment_for_hash_legacy")] public static extern long ChannelManager_create_inbound_payment_for_hash_legacy(long _this_arg, byte[] _payment_hash, long _min_value_msat, int _invoice_expiry_delta_secs); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf")] public static extern long ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id); + // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_inbound_payment")] public static extern long ChannelManager_create_inbound_payment(long _this_arg, long _min_value_msat, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_inbound_payment_for_hash")] public static extern long ChannelManager_create_inbound_payment_for_hash(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _min_value_msat, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry); // MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_payment_preimage")] public static extern long ChannelManager_get_payment_preimage(long _this_arg, byte[] _payment_hash, byte[] _payment_secret); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_payment_preimage")] public static extern long ChannelManager_get_payment_preimage(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_secret); // MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_phantom_scid")] public static extern long ChannelManager_get_phantom_scid(long _this_arg); // MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg); @@ -4763,46 +5642,58 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_Listen")] public static extern long ChannelManager_as_Listen(long _this_arg); // struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_Confirm")] public static extern long ChannelManager_as_Confirm(long _this_arg); - // MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_await_persistable_update_timeout")] public static extern bool ChannelManager_await_persistable_update_timeout(long _this_arg, long _max_wait); - // void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_await_persistable_update")] public static extern void ChannelManager_await_persistable_update(long _this_arg); // MUST_USE_RES struct LDKFuture ChannelManager_get_persistable_update_future(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_persistable_update_future")] public static extern long ChannelManager_get_persistable_update_future(long _this_arg); // MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_current_best_block")] public static extern long ChannelManager_current_best_block(long _this_arg); + // MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_node_features")] public static extern long ChannelManager_node_features(long _this_arg); + // MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_channel_features")] public static extern long ChannelManager_channel_features(long _this_arg); + // MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_channel_type_features")] public static extern long ChannelManager_channel_type_features(long _this_arg); + // MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_init_features")] public static extern long ChannelManager_init_features(long _this_arg); // struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_ChannelMessageHandler")] public static extern long ChannelManager_as_ChannelMessageHandler(long _this_arg); - // struct LDKNodeFeatures provided_node_features(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_provided_node_features")] public static extern long provided_node_features(); - // struct LDKChannelFeatures provided_channel_features(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_provided_channel_features")] public static extern long provided_channel_features(); - // struct LDKInitFeatures provided_init_features(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_provided_init_features")] public static extern long provided_init_features(); + // struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_provided_init_features")] public static extern long provided_init_features(long _config); // struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_write")] public static extern byte[] CounterpartyForwardingInfo_write(long _obj); // struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_read")] public static extern long CounterpartyForwardingInfo_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyForwardingInfo_read")] public static extern long CounterpartyForwardingInfo_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_write")] public static extern byte[] ChannelCounterparty_write(long _obj); // struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_read")] public static extern long ChannelCounterparty_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_read")] public static extern long ChannelCounterparty_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_write")] public static extern byte[] ChannelDetails_write(long _obj); // struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_read")] public static extern long ChannelDetails_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_read")] public static extern long ChannelDetails_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_write")] public static extern byte[] PhantomRouteHints_write(long _obj); // struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_read")] public static extern long PhantomRouteHints_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomRouteHints_read")] public static extern long PhantomRouteHints_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_write")] public static extern byte[] ChannelManager_write(long _obj); + // struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_write")] public static extern byte[] ChannelShutdownState_write(long _obj); + // struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelShutdownState_read")] public static extern long ChannelShutdownState_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_free")] public static extern void ChannelManagerReadArgs_free(long _this_obj); - // const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_keys_manager")] public static extern long ChannelManagerReadArgs_get_keys_manager(long _this_ptr); - // void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_set_keys_manager")] public static extern void ChannelManagerReadArgs_set_keys_manager(long _this_ptr, long _val); + // const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_entropy_source")] public static extern long ChannelManagerReadArgs_get_entropy_source(long _this_ptr); + // void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_set_entropy_source")] public static extern void ChannelManagerReadArgs_set_entropy_source(long _this_ptr, long _val); + // const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_node_signer")] public static extern long ChannelManagerReadArgs_get_node_signer(long _this_ptr); + // void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_set_node_signer")] public static extern void ChannelManagerReadArgs_set_node_signer(long _this_ptr, long _val); + // const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_signer_provider")] public static extern long ChannelManagerReadArgs_get_signer_provider(long _this_ptr); + // void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_set_signer_provider")] public static extern void ChannelManagerReadArgs_set_signer_provider(long _this_ptr, long _val); // const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_fee_estimator")] public static extern long ChannelManagerReadArgs_get_fee_estimator(long _this_ptr); // void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val); @@ -4815,6 +5706,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_tx_broadcaster")] public static extern long ChannelManagerReadArgs_get_tx_broadcaster(long _this_ptr); // void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_set_tx_broadcaster")] public static extern void ChannelManagerReadArgs_set_tx_broadcaster(long _this_ptr, long _val); + // const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_router")] public static extern long ChannelManagerReadArgs_get_router(long _this_ptr); + // void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_set_router")] public static extern void ChannelManagerReadArgs_set_router(long _this_ptr, long _val); // const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_logger")] public static extern long ChannelManagerReadArgs_get_logger(long _this_ptr); // void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val); @@ -4823,18 +5718,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_get_default_config")] public static extern long ChannelManagerReadArgs_get_default_config(long _this_ptr); // void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_set_default_config")] public static extern void ChannelManagerReadArgs_set_default_config(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_new")] public static extern long ChannelManagerReadArgs_new(long _keys_manager, long _fee_estimator, long _chain_monitor, long _tx_broadcaster, long _logger, long _default_config, long[] _channel_monitors); + // MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManagerReadArgs_new")] public static extern long ChannelManagerReadArgs_new(long _entropy_source, long _node_signer, long _signer_provider, long _fee_estimator, long _chain_monitor, long _tx_broadcaster, long _router, long _logger, long _default_config, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _channel_monitors); // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelManagerZ_read")] public static extern long C2Tuple_BlockHashChannelManagerZ_read(byte[] _ser, long _arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BlockHashChannelManagerZ_read")] public static extern long C2Tuple_BlockHashChannelManagerZ_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, long _arg); // void ExpandedKey_free(struct LDKExpandedKey this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ExpandedKey_free")] public static extern void ExpandedKey_free(long _this_obj); // MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ExpandedKey_new")] public static extern long ExpandedKey_new(byte[] _key_material); - // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKKeysInterface *NONNULL_PTR keys_manager, uint64_t current_time); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create")] public static extern long create(long _keys, long _min_value_msat, int _invoice_expiry_delta_secs, long _keys_manager, long _current_time); - // struct LDKCResult_PaymentSecretNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_from_hash")] public static extern long create_from_hash(long _keys, long _min_value_msat, byte[] _payment_hash, int _invoice_expiry_delta_secs, long _current_time); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ExpandedKey_new")] public static extern long ExpandedKey_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _key_material); + // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create")] public static extern long create(long _keys, long _min_value_msat, int _invoice_expiry_delta_secs, long _entropy_source, long _current_time, long _min_final_cltv_expiry_delta); + // struct LDKCResult_PaymentSecretNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_from_hash")] public static extern long create_from_hash(long _keys, long _min_value_msat, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, int _invoice_expiry_delta_secs, long _current_time, long _min_final_cltv_expiry_delta); // void DecodeError_free(struct LDKDecodeError this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DecodeError_free")] public static extern void DecodeError_free(long _this_ptr); // uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg); @@ -4863,12 +5758,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_get_features")] public static extern long Init_get_features(long _this_ptr); // void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_set_features")] public static extern void Init_set_features(long _this_ptr, long _val); + // struct LDKCOption_CVec_ChainHashZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_get_networks")] public static extern long Init_get_networks(long _this_ptr); + // void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ChainHashZZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_set_networks")] public static extern void Init_set_networks(long _this_ptr, long _val); // struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_get_remote_network_address")] public static extern long Init_get_remote_network_address(long _this_ptr); // void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_set_remote_network_address")] public static extern void Init_set_remote_network_address(long _this_ptr, long _val); - // MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_new")] public static extern long Init_new(long _features_arg, long _remote_network_address_arg); + // MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ChainHashZZ networks_arg, struct LDKCOption_NetAddressZ remote_network_address_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_new")] public static extern long Init_new(long _features_arg, long _networks_arg, long _remote_network_address_arg); // uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_clone_ptr")] public static extern long Init_clone_ptr(long _arg); // struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); @@ -4880,13 +5779,13 @@ internal class bindings { // const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_get_channel_id")] public static extern byte[] ErrorMessage_get_channel_id(long _this_ptr); // void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_set_channel_id")] public static extern void ErrorMessage_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_set_channel_id")] public static extern void ErrorMessage_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_get_data")] public static extern string ErrorMessage_get_data(long _this_ptr); // void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_set_data")] public static extern void ErrorMessage_set_data(long _this_ptr, string _val); // MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_new")] public static extern long ErrorMessage_new(byte[] _channel_id_arg, string _data_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_new")] public static extern long ErrorMessage_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, string _data_arg); // uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_clone_ptr")] public static extern long ErrorMessage_clone_ptr(long _arg); // struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); @@ -4898,13 +5797,13 @@ internal class bindings { // const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_get_channel_id")] public static extern byte[] WarningMessage_get_channel_id(long _this_ptr); // void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_set_channel_id")] public static extern void WarningMessage_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_set_channel_id")] public static extern void WarningMessage_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_get_data")] public static extern string WarningMessage_get_data(long _this_ptr); // void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_set_data")] public static extern void WarningMessage_set_data(long _this_ptr, string _val); // MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_new")] public static extern long WarningMessage_new(byte[] _channel_id_arg, string _data_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_new")] public static extern long WarningMessage_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, string _data_arg); // uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_clone_ptr")] public static extern long WarningMessage_clone_ptr(long _arg); // struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig); @@ -4948,11 +5847,11 @@ internal class bindings { // const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_chain_hash")] public static extern byte[] OpenChannel_get_chain_hash(long _this_ptr); // void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_chain_hash")] public static extern void OpenChannel_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_chain_hash")] public static extern void OpenChannel_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_temporary_channel_id")] public static extern byte[] OpenChannel_get_temporary_channel_id(long _this_ptr); // void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_temporary_channel_id")] public static extern void OpenChannel_set_temporary_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_temporary_channel_id")] public static extern void OpenChannel_set_temporary_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_funding_satoshis")] public static extern long OpenChannel_get_funding_satoshis(long _this_ptr); // void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); @@ -4992,47 +5891,151 @@ internal class bindings { // struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_funding_pubkey")] public static extern byte[] OpenChannel_get_funding_pubkey(long _this_ptr); // void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_funding_pubkey")] public static extern void OpenChannel_set_funding_pubkey(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_funding_pubkey")] public static extern void OpenChannel_set_funding_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_revocation_basepoint")] public static extern byte[] OpenChannel_get_revocation_basepoint(long _this_ptr); // void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_revocation_basepoint")] public static extern void OpenChannel_set_revocation_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_revocation_basepoint")] public static extern void OpenChannel_set_revocation_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_payment_point")] public static extern byte[] OpenChannel_get_payment_point(long _this_ptr); // void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_payment_point")] public static extern void OpenChannel_set_payment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_payment_point")] public static extern void OpenChannel_set_payment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_delayed_payment_basepoint")] public static extern byte[] OpenChannel_get_delayed_payment_basepoint(long _this_ptr); // void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_delayed_payment_basepoint")] public static extern void OpenChannel_set_delayed_payment_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_delayed_payment_basepoint")] public static extern void OpenChannel_set_delayed_payment_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_htlc_basepoint")] public static extern byte[] OpenChannel_get_htlc_basepoint(long _this_ptr); // void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_htlc_basepoint")] public static extern void OpenChannel_set_htlc_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_htlc_basepoint")] public static extern void OpenChannel_set_htlc_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_first_per_commitment_point")] public static extern byte[] OpenChannel_get_first_per_commitment_point(long _this_ptr); // void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_first_per_commitment_point")] public static extern void OpenChannel_set_first_per_commitment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_first_per_commitment_point")] public static extern void OpenChannel_set_first_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_channel_flags")] public static extern byte OpenChannel_get_channel_flags(long _this_ptr); // void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_channel_flags")] public static extern void OpenChannel_set_channel_flags(long _this_ptr, byte _val); + // struct LDKCOption_ScriptZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_shutdown_scriptpubkey")] public static extern long OpenChannel_get_shutdown_scriptpubkey(long _this_ptr); + // void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_shutdown_scriptpubkey")] public static extern void OpenChannel_set_shutdown_scriptpubkey(long _this_ptr, long _val); // struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_channel_type")] public static extern long OpenChannel_get_channel_type(long _this_ptr); // void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_channel_type")] public static extern void OpenChannel_set_channel_type(long _this_ptr, long _val); + // MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t push_msat_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t feerate_per_kw_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_new")] public static extern long OpenChannel_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id_arg, long _funding_satoshis_arg, long _push_msat_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _channel_reserve_satoshis_arg, long _htlc_minimum_msat_arg, int _feerate_per_kw_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_pubkey_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_point_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _delayed_payment_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _first_per_commitment_point_arg, byte _channel_flags_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg); // uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_clone_ptr")] public static extern long OpenChannel_clone_ptr(long _arg); // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_clone")] public static extern long OpenChannel_clone(long _orig); // bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_eq")] public static extern bool OpenChannel_eq(long _a, long _b); + // void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_free")] public static extern void OpenChannelV2_free(long _this_obj); + // const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_chain_hash")] public static extern byte[] OpenChannelV2_get_chain_hash(long _this_ptr); + // void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_chain_hash")] public static extern void OpenChannelV2_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_temporary_channel_id")] public static extern byte[] OpenChannelV2_get_temporary_channel_id(long _this_ptr); + // void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_temporary_channel_id")] public static extern void OpenChannelV2_set_temporary_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight")] public static extern int OpenChannelV2_get_funding_feerate_sat_per_1000_weight(long _this_ptr); + // void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight")] public static extern void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(long _this_ptr, int _val); + // uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_commitment_feerate_sat_per_1000_weight")] public static extern int OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(long _this_ptr); + // void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_commitment_feerate_sat_per_1000_weight")] public static extern void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(long _this_ptr, int _val); + // uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_funding_satoshis")] public static extern long OpenChannelV2_get_funding_satoshis(long _this_ptr); + // void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_funding_satoshis")] public static extern void OpenChannelV2_set_funding_satoshis(long _this_ptr, long _val); + // uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_dust_limit_satoshis")] public static extern long OpenChannelV2_get_dust_limit_satoshis(long _this_ptr); + // void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_dust_limit_satoshis")] public static extern void OpenChannelV2_set_dust_limit_satoshis(long _this_ptr, long _val); + // uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_max_htlc_value_in_flight_msat")] public static extern long OpenChannelV2_get_max_htlc_value_in_flight_msat(long _this_ptr); + // void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_max_htlc_value_in_flight_msat")] public static extern void OpenChannelV2_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); + // uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_htlc_minimum_msat")] public static extern long OpenChannelV2_get_htlc_minimum_msat(long _this_ptr); + // void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_htlc_minimum_msat")] public static extern void OpenChannelV2_set_htlc_minimum_msat(long _this_ptr, long _val); + // uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_to_self_delay")] public static extern short OpenChannelV2_get_to_self_delay(long _this_ptr); + // void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_to_self_delay")] public static extern void OpenChannelV2_set_to_self_delay(long _this_ptr, short _val); + // uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_max_accepted_htlcs")] public static extern short OpenChannelV2_get_max_accepted_htlcs(long _this_ptr); + // void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_max_accepted_htlcs")] public static extern void OpenChannelV2_set_max_accepted_htlcs(long _this_ptr, short _val); + // uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_locktime")] public static extern int OpenChannelV2_get_locktime(long _this_ptr); + // void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_locktime")] public static extern void OpenChannelV2_set_locktime(long _this_ptr, int _val); + // struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_funding_pubkey")] public static extern byte[] OpenChannelV2_get_funding_pubkey(long _this_ptr); + // void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_funding_pubkey")] public static extern void OpenChannelV2_set_funding_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_revocation_basepoint")] public static extern byte[] OpenChannelV2_get_revocation_basepoint(long _this_ptr); + // void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_revocation_basepoint")] public static extern void OpenChannelV2_set_revocation_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_payment_basepoint")] public static extern byte[] OpenChannelV2_get_payment_basepoint(long _this_ptr); + // void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_payment_basepoint")] public static extern void OpenChannelV2_set_payment_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_delayed_payment_basepoint")] public static extern byte[] OpenChannelV2_get_delayed_payment_basepoint(long _this_ptr); + // void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_delayed_payment_basepoint")] public static extern void OpenChannelV2_set_delayed_payment_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_htlc_basepoint")] public static extern byte[] OpenChannelV2_get_htlc_basepoint(long _this_ptr); + // void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_htlc_basepoint")] public static extern void OpenChannelV2_set_htlc_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_first_per_commitment_point")] public static extern byte[] OpenChannelV2_get_first_per_commitment_point(long _this_ptr); + // void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_first_per_commitment_point")] public static extern void OpenChannelV2_set_first_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_second_per_commitment_point")] public static extern byte[] OpenChannelV2_get_second_per_commitment_point(long _this_ptr); + // void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_second_per_commitment_point")] public static extern void OpenChannelV2_set_second_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_channel_flags")] public static extern byte OpenChannelV2_get_channel_flags(long _this_ptr); + // void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_channel_flags")] public static extern void OpenChannelV2_set_channel_flags(long _this_ptr, byte _val); + // struct LDKCOption_ScriptZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_shutdown_scriptpubkey")] public static extern long OpenChannelV2_get_shutdown_scriptpubkey(long _this_ptr); + // void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey")] public static extern void OpenChannelV2_set_shutdown_scriptpubkey(long _this_ptr, long _val); + // struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_channel_type")] public static extern long OpenChannelV2_get_channel_type(long _this_ptr); + // void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_channel_type")] public static extern void OpenChannelV2_set_channel_type(long _this_ptr, long _val); + // enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_require_confirmed_inputs")] public static extern COption_NoneZ OpenChannelV2_get_require_confirmed_inputs(long _this_ptr); + // void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_require_confirmed_inputs")] public static extern void OpenChannelV2_set_require_confirmed_inputs(long _this_ptr, COption_NoneZ _val); + // MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_new")] public static extern long OpenChannelV2_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id_arg, int _funding_feerate_sat_per_1000_weight_arg, int _commitment_feerate_sat_per_1000_weight_arg, long _funding_satoshis_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _htlc_minimum_msat_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, int _locktime_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_pubkey_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _delayed_payment_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _first_per_commitment_point_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _second_per_commitment_point_arg, byte _channel_flags_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg, COption_NoneZ _require_confirmed_inputs_arg); + // uint64_t OpenChannelV2_clone_ptr(LDKOpenChannelV2 *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_clone_ptr")] public static extern long OpenChannelV2_clone_ptr(long _arg); + // struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_clone")] public static extern long OpenChannelV2_clone(long _orig); + // bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_eq")] public static extern bool OpenChannelV2_eq(long _a, long _b); // void AcceptChannel_free(struct LDKAcceptChannel this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_free")] public static extern void AcceptChannel_free(long _this_obj); // const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_temporary_channel_id")] public static extern byte[] AcceptChannel_get_temporary_channel_id(long _this_ptr); // void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_temporary_channel_id")] public static extern void AcceptChannel_set_temporary_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_temporary_channel_id")] public static extern void AcceptChannel_set_temporary_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_dust_limit_satoshis")] public static extern long AcceptChannel_get_dust_limit_satoshis(long _this_ptr); // void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); @@ -5064,47 +6067,135 @@ internal class bindings { // struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_funding_pubkey")] public static extern byte[] AcceptChannel_get_funding_pubkey(long _this_ptr); // void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_funding_pubkey")] public static extern void AcceptChannel_set_funding_pubkey(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_funding_pubkey")] public static extern void AcceptChannel_set_funding_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_revocation_basepoint")] public static extern byte[] AcceptChannel_get_revocation_basepoint(long _this_ptr); // void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_revocation_basepoint")] public static extern void AcceptChannel_set_revocation_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_revocation_basepoint")] public static extern void AcceptChannel_set_revocation_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_payment_point")] public static extern byte[] AcceptChannel_get_payment_point(long _this_ptr); // void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_payment_point")] public static extern void AcceptChannel_set_payment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_payment_point")] public static extern void AcceptChannel_set_payment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_delayed_payment_basepoint")] public static extern byte[] AcceptChannel_get_delayed_payment_basepoint(long _this_ptr); // void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_delayed_payment_basepoint")] public static extern void AcceptChannel_set_delayed_payment_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_delayed_payment_basepoint")] public static extern void AcceptChannel_set_delayed_payment_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_htlc_basepoint")] public static extern byte[] AcceptChannel_get_htlc_basepoint(long _this_ptr); // void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_htlc_basepoint")] public static extern void AcceptChannel_set_htlc_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_htlc_basepoint")] public static extern void AcceptChannel_set_htlc_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_first_per_commitment_point")] public static extern byte[] AcceptChannel_get_first_per_commitment_point(long _this_ptr); // void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_first_per_commitment_point")] public static extern void AcceptChannel_set_first_per_commitment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_first_per_commitment_point")] public static extern void AcceptChannel_set_first_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKCOption_ScriptZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_shutdown_scriptpubkey")] public static extern long AcceptChannel_get_shutdown_scriptpubkey(long _this_ptr); + // void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_shutdown_scriptpubkey")] public static extern void AcceptChannel_set_shutdown_scriptpubkey(long _this_ptr, long _val); // struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_channel_type")] public static extern long AcceptChannel_get_channel_type(long _this_ptr); // void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_channel_type")] public static extern void AcceptChannel_set_channel_type(long _this_ptr, long _val); + // MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_new")] public static extern long AcceptChannel_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _channel_reserve_satoshis_arg, long _htlc_minimum_msat_arg, int _minimum_depth_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_pubkey_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_point_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _delayed_payment_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _first_per_commitment_point_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg); // uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_clone_ptr")] public static extern long AcceptChannel_clone_ptr(long _arg); // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_clone")] public static extern long AcceptChannel_clone(long _orig); // bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_eq")] public static extern bool AcceptChannel_eq(long _a, long _b); + // void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_free")] public static extern void AcceptChannelV2_free(long _this_obj); + // const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_temporary_channel_id")] public static extern byte[] AcceptChannelV2_get_temporary_channel_id(long _this_ptr); + // void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_temporary_channel_id")] public static extern void AcceptChannelV2_set_temporary_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_funding_satoshis")] public static extern long AcceptChannelV2_get_funding_satoshis(long _this_ptr); + // void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_funding_satoshis")] public static extern void AcceptChannelV2_set_funding_satoshis(long _this_ptr, long _val); + // uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_dust_limit_satoshis")] public static extern long AcceptChannelV2_get_dust_limit_satoshis(long _this_ptr); + // void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_dust_limit_satoshis")] public static extern void AcceptChannelV2_set_dust_limit_satoshis(long _this_ptr, long _val); + // uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_max_htlc_value_in_flight_msat")] public static extern long AcceptChannelV2_get_max_htlc_value_in_flight_msat(long _this_ptr); + // void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_max_htlc_value_in_flight_msat")] public static extern void AcceptChannelV2_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); + // uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_htlc_minimum_msat")] public static extern long AcceptChannelV2_get_htlc_minimum_msat(long _this_ptr); + // void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_htlc_minimum_msat")] public static extern void AcceptChannelV2_set_htlc_minimum_msat(long _this_ptr, long _val); + // uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_minimum_depth")] public static extern int AcceptChannelV2_get_minimum_depth(long _this_ptr); + // void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_minimum_depth")] public static extern void AcceptChannelV2_set_minimum_depth(long _this_ptr, int _val); + // uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_to_self_delay")] public static extern short AcceptChannelV2_get_to_self_delay(long _this_ptr); + // void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_to_self_delay")] public static extern void AcceptChannelV2_set_to_self_delay(long _this_ptr, short _val); + // uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_max_accepted_htlcs")] public static extern short AcceptChannelV2_get_max_accepted_htlcs(long _this_ptr); + // void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_max_accepted_htlcs")] public static extern void AcceptChannelV2_set_max_accepted_htlcs(long _this_ptr, short _val); + // struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_funding_pubkey")] public static extern byte[] AcceptChannelV2_get_funding_pubkey(long _this_ptr); + // void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_funding_pubkey")] public static extern void AcceptChannelV2_set_funding_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_revocation_basepoint")] public static extern byte[] AcceptChannelV2_get_revocation_basepoint(long _this_ptr); + // void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_revocation_basepoint")] public static extern void AcceptChannelV2_set_revocation_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_payment_basepoint")] public static extern byte[] AcceptChannelV2_get_payment_basepoint(long _this_ptr); + // void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_payment_basepoint")] public static extern void AcceptChannelV2_set_payment_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_delayed_payment_basepoint")] public static extern byte[] AcceptChannelV2_get_delayed_payment_basepoint(long _this_ptr); + // void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_delayed_payment_basepoint")] public static extern void AcceptChannelV2_set_delayed_payment_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_htlc_basepoint")] public static extern byte[] AcceptChannelV2_get_htlc_basepoint(long _this_ptr); + // void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_htlc_basepoint")] public static extern void AcceptChannelV2_set_htlc_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_first_per_commitment_point")] public static extern byte[] AcceptChannelV2_get_first_per_commitment_point(long _this_ptr); + // void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_first_per_commitment_point")] public static extern void AcceptChannelV2_set_first_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_second_per_commitment_point")] public static extern byte[] AcceptChannelV2_get_second_per_commitment_point(long _this_ptr); + // void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_second_per_commitment_point")] public static extern void AcceptChannelV2_set_second_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKCOption_ScriptZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_shutdown_scriptpubkey")] public static extern long AcceptChannelV2_get_shutdown_scriptpubkey(long _this_ptr); + // void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_shutdown_scriptpubkey")] public static extern void AcceptChannelV2_set_shutdown_scriptpubkey(long _this_ptr, long _val); + // struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_channel_type")] public static extern long AcceptChannelV2_get_channel_type(long _this_ptr); + // void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_channel_type")] public static extern void AcceptChannelV2_set_channel_type(long _this_ptr, long _val); + // enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_require_confirmed_inputs")] public static extern COption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(long _this_ptr); + // void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_require_confirmed_inputs")] public static extern void AcceptChannelV2_set_require_confirmed_inputs(long _this_ptr, COption_NoneZ _val); + // MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_new")] public static extern long AcceptChannelV2_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id_arg, long _funding_satoshis_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _htlc_minimum_msat_arg, int _minimum_depth_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_pubkey_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _delayed_payment_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _first_per_commitment_point_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _second_per_commitment_point_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg, COption_NoneZ _require_confirmed_inputs_arg); + // uint64_t AcceptChannelV2_clone_ptr(LDKAcceptChannelV2 *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_clone_ptr")] public static extern long AcceptChannelV2_clone_ptr(long _arg); + // struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_clone")] public static extern long AcceptChannelV2_clone(long _orig); + // bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_eq")] public static extern bool AcceptChannelV2_eq(long _a, long _b); // void FundingCreated_free(struct LDKFundingCreated this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_free")] public static extern void FundingCreated_free(long _this_obj); // const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_get_temporary_channel_id")] public static extern byte[] FundingCreated_get_temporary_channel_id(long _this_ptr); // void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_temporary_channel_id")] public static extern void FundingCreated_set_temporary_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_temporary_channel_id")] public static extern void FundingCreated_set_temporary_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_get_funding_txid")] public static extern byte[] FundingCreated_get_funding_txid(long _this_ptr); // void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_funding_txid")] public static extern void FundingCreated_set_funding_txid(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_funding_txid")] public static extern void FundingCreated_set_funding_txid(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_get_funding_output_index")] public static extern short FundingCreated_get_funding_output_index(long _this_ptr); // void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val); @@ -5112,9 +6203,9 @@ internal class bindings { // struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_get_signature")] public static extern byte[] FundingCreated_get_signature(long _this_ptr); // void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_signature")] public static extern void FundingCreated_set_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_signature")] public static extern void FundingCreated_set_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_new")] public static extern long FundingCreated_new(byte[] _temporary_channel_id_arg, byte[] _funding_txid_arg, short _funding_output_index_arg, byte[] _signature_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_new")] public static extern long FundingCreated_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_txid_arg, short _funding_output_index_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature_arg); // uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_clone_ptr")] public static extern long FundingCreated_clone_ptr(long _arg); // struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); @@ -5126,13 +6217,13 @@ internal class bindings { // const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_get_channel_id")] public static extern byte[] FundingSigned_get_channel_id(long _this_ptr); // void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_set_channel_id")] public static extern void FundingSigned_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_set_channel_id")] public static extern void FundingSigned_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_get_signature")] public static extern byte[] FundingSigned_get_signature(long _this_ptr); // void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_set_signature")] public static extern void FundingSigned_set_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_set_signature")] public static extern void FundingSigned_set_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_new")] public static extern long FundingSigned_new(byte[] _channel_id_arg, byte[] _signature_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_new")] public static extern long FundingSigned_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature_arg); // uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_clone_ptr")] public static extern long FundingSigned_clone_ptr(long _arg); // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); @@ -5144,35 +6235,225 @@ internal class bindings { // const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_get_channel_id")] public static extern byte[] ChannelReady_get_channel_id(long _this_ptr); // void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_set_channel_id")] public static extern void ChannelReady_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_set_channel_id")] public static extern void ChannelReady_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_get_next_per_commitment_point")] public static extern byte[] ChannelReady_get_next_per_commitment_point(long _this_ptr); // void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_set_next_per_commitment_point")] public static extern void ChannelReady_set_next_per_commitment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_set_next_per_commitment_point")] public static extern void ChannelReady_set_next_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_get_short_channel_id_alias")] public static extern long ChannelReady_get_short_channel_id_alias(long _this_ptr); // void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_set_short_channel_id_alias")] public static extern void ChannelReady_set_short_channel_id_alias(long _this_ptr, long _val); // MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_new")] public static extern long ChannelReady_new(byte[] _channel_id_arg, byte[] _next_per_commitment_point_arg, long _short_channel_id_alias_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_new")] public static extern long ChannelReady_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _next_per_commitment_point_arg, long _short_channel_id_alias_arg); // uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_clone_ptr")] public static extern long ChannelReady_clone_ptr(long _arg); // struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_clone")] public static extern long ChannelReady_clone(long _orig); // bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_eq")] public static extern bool ChannelReady_eq(long _a, long _b); + // void TxAddInput_free(struct LDKTxAddInput this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_free")] public static extern void TxAddInput_free(long _this_obj); + // const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_channel_id")] public static extern byte[] TxAddInput_get_channel_id(long _this_ptr); + // void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_channel_id")] public static extern void TxAddInput_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_serial_id")] public static extern long TxAddInput_get_serial_id(long _this_ptr); + // void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_serial_id")] public static extern void TxAddInput_set_serial_id(long _this_ptr, long _val); + // struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_prevtx")] public static extern long TxAddInput_get_prevtx(long _this_ptr); + // void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_prevtx")] public static extern void TxAddInput_set_prevtx(long _this_ptr, long _val); + // uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_prevtx_out")] public static extern int TxAddInput_get_prevtx_out(long _this_ptr); + // void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_prevtx_out")] public static extern void TxAddInput_set_prevtx_out(long _this_ptr, int _val); + // uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_sequence")] public static extern int TxAddInput_get_sequence(long _this_ptr); + // void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_sequence")] public static extern void TxAddInput_set_sequence(long _this_ptr, int _val); + // MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_new")] public static extern long TxAddInput_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _serial_id_arg, long _prevtx_arg, int _prevtx_out_arg, int _sequence_arg); + // uint64_t TxAddInput_clone_ptr(LDKTxAddInput *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_clone_ptr")] public static extern long TxAddInput_clone_ptr(long _arg); + // struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_clone")] public static extern long TxAddInput_clone(long _orig); + // bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_eq")] public static extern bool TxAddInput_eq(long _a, long _b); + // void TxAddOutput_free(struct LDKTxAddOutput this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_free")] public static extern void TxAddOutput_free(long _this_obj); + // const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_get_channel_id")] public static extern byte[] TxAddOutput_get_channel_id(long _this_ptr); + // void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_set_channel_id")] public static extern void TxAddOutput_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_get_serial_id")] public static extern long TxAddOutput_get_serial_id(long _this_ptr); + // void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_set_serial_id")] public static extern void TxAddOutput_set_serial_id(long _this_ptr, long _val); + // uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_get_sats")] public static extern long TxAddOutput_get_sats(long _this_ptr); + // void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_set_sats")] public static extern void TxAddOutput_set_sats(long _this_ptr, long _val); + // struct LDKu8slice TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_get_script")] public static extern byte[] TxAddOutput_get_script(long _this_ptr); + // void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_set_script")] public static extern void TxAddOutput_set_script(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_new")] public static extern long TxAddOutput_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _serial_id_arg, long _sats_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _script_arg); + // uint64_t TxAddOutput_clone_ptr(LDKTxAddOutput *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_clone_ptr")] public static extern long TxAddOutput_clone_ptr(long _arg); + // struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_clone")] public static extern long TxAddOutput_clone(long _orig); + // bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_eq")] public static extern bool TxAddOutput_eq(long _a, long _b); + // void TxRemoveInput_free(struct LDKTxRemoveInput this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_free")] public static extern void TxRemoveInput_free(long _this_obj); + // const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_get_channel_id")] public static extern byte[] TxRemoveInput_get_channel_id(long _this_ptr); + // void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_set_channel_id")] public static extern void TxRemoveInput_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_get_serial_id")] public static extern long TxRemoveInput_get_serial_id(long _this_ptr); + // void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_set_serial_id")] public static extern void TxRemoveInput_set_serial_id(long _this_ptr, long _val); + // MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_new")] public static extern long TxRemoveInput_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _serial_id_arg); + // uint64_t TxRemoveInput_clone_ptr(LDKTxRemoveInput *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_clone_ptr")] public static extern long TxRemoveInput_clone_ptr(long _arg); + // struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_clone")] public static extern long TxRemoveInput_clone(long _orig); + // bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_eq")] public static extern bool TxRemoveInput_eq(long _a, long _b); + // void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_free")] public static extern void TxRemoveOutput_free(long _this_obj); + // const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_get_channel_id")] public static extern byte[] TxRemoveOutput_get_channel_id(long _this_ptr); + // void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_set_channel_id")] public static extern void TxRemoveOutput_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_get_serial_id")] public static extern long TxRemoveOutput_get_serial_id(long _this_ptr); + // void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_set_serial_id")] public static extern void TxRemoveOutput_set_serial_id(long _this_ptr, long _val); + // MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_new")] public static extern long TxRemoveOutput_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _serial_id_arg); + // uint64_t TxRemoveOutput_clone_ptr(LDKTxRemoveOutput *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_clone_ptr")] public static extern long TxRemoveOutput_clone_ptr(long _arg); + // struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_clone")] public static extern long TxRemoveOutput_clone(long _orig); + // bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_eq")] public static extern bool TxRemoveOutput_eq(long _a, long _b); + // void TxComplete_free(struct LDKTxComplete this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_free")] public static extern void TxComplete_free(long _this_obj); + // const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_get_channel_id")] public static extern byte[] TxComplete_get_channel_id(long _this_ptr); + // void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_set_channel_id")] public static extern void TxComplete_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_new")] public static extern long TxComplete_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg); + // uint64_t TxComplete_clone_ptr(LDKTxComplete *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_clone_ptr")] public static extern long TxComplete_clone_ptr(long _arg); + // struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_clone")] public static extern long TxComplete_clone(long _orig); + // bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_eq")] public static extern bool TxComplete_eq(long _a, long _b); + // void TxSignatures_free(struct LDKTxSignatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_free")] public static extern void TxSignatures_free(long _this_obj); + // const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_channel_id")] public static extern byte[] TxSignatures_get_channel_id(long _this_ptr); + // void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_set_channel_id")] public static extern void TxSignatures_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_tx_hash")] public static extern byte[] TxSignatures_get_tx_hash(long _this_ptr); + // void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_set_tx_hash")] public static extern void TxSignatures_set_tx_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_witnesses")] public static extern byte[][] TxSignatures_get_witnesses(long _this_ptr); + // void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_set_witnesses")] public static extern void TxSignatures_set_witnesses(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _val); + // MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_new")] public static extern long TxSignatures_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _tx_hash_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _witnesses_arg); + // uint64_t TxSignatures_clone_ptr(LDKTxSignatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_clone_ptr")] public static extern long TxSignatures_clone_ptr(long _arg); + // struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_clone")] public static extern long TxSignatures_clone(long _orig); + // bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_eq")] public static extern bool TxSignatures_eq(long _a, long _b); + // void TxInitRbf_free(struct LDKTxInitRbf this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_free")] public static extern void TxInitRbf_free(long _this_obj); + // const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_get_channel_id")] public static extern byte[] TxInitRbf_get_channel_id(long _this_ptr); + // void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_set_channel_id")] public static extern void TxInitRbf_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_get_locktime")] public static extern int TxInitRbf_get_locktime(long _this_ptr); + // void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_set_locktime")] public static extern void TxInitRbf_set_locktime(long _this_ptr, int _val); + // uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_get_feerate_sat_per_1000_weight")] public static extern int TxInitRbf_get_feerate_sat_per_1000_weight(long _this_ptr); + // void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_set_feerate_sat_per_1000_weight")] public static extern void TxInitRbf_set_feerate_sat_per_1000_weight(long _this_ptr, int _val); + // struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_get_funding_output_contribution")] public static extern long TxInitRbf_get_funding_output_contribution(long _this_ptr); + // void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_set_funding_output_contribution")] public static extern void TxInitRbf_set_funding_output_contribution(long _this_ptr, long _val); + // MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_new")] public static extern long TxInitRbf_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, int _locktime_arg, int _feerate_sat_per_1000_weight_arg, long _funding_output_contribution_arg); + // uint64_t TxInitRbf_clone_ptr(LDKTxInitRbf *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_clone_ptr")] public static extern long TxInitRbf_clone_ptr(long _arg); + // struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_clone")] public static extern long TxInitRbf_clone(long _orig); + // bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_eq")] public static extern bool TxInitRbf_eq(long _a, long _b); + // void TxAckRbf_free(struct LDKTxAckRbf this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_free")] public static extern void TxAckRbf_free(long _this_obj); + // const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_get_channel_id")] public static extern byte[] TxAckRbf_get_channel_id(long _this_ptr); + // void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_set_channel_id")] public static extern void TxAckRbf_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_get_funding_output_contribution")] public static extern long TxAckRbf_get_funding_output_contribution(long _this_ptr); + // void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_set_funding_output_contribution")] public static extern void TxAckRbf_set_funding_output_contribution(long _this_ptr, long _val); + // MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_new")] public static extern long TxAckRbf_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _funding_output_contribution_arg); + // uint64_t TxAckRbf_clone_ptr(LDKTxAckRbf *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_clone_ptr")] public static extern long TxAckRbf_clone_ptr(long _arg); + // struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_clone")] public static extern long TxAckRbf_clone(long _orig); + // bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_eq")] public static extern bool TxAckRbf_eq(long _a, long _b); + // void TxAbort_free(struct LDKTxAbort this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_free")] public static extern void TxAbort_free(long _this_obj); + // const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_get_channel_id")] public static extern byte[] TxAbort_get_channel_id(long _this_ptr); + // void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_set_channel_id")] public static extern void TxAbort_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_get_data")] public static extern byte[] TxAbort_get_data(long _this_ptr); + // void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_set_data")] public static extern void TxAbort_set_data(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_new")] public static extern long TxAbort_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _data_arg); + // uint64_t TxAbort_clone_ptr(LDKTxAbort *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_clone_ptr")] public static extern long TxAbort_clone_ptr(long _arg); + // struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_clone")] public static extern long TxAbort_clone(long _orig); + // bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_eq")] public static extern bool TxAbort_eq(long _a, long _b); // void Shutdown_free(struct LDKShutdown this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_free")] public static extern void Shutdown_free(long _this_obj); // const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_get_channel_id")] public static extern byte[] Shutdown_get_channel_id(long _this_ptr); // void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_set_channel_id")] public static extern void Shutdown_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_set_channel_id")] public static extern void Shutdown_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_get_scriptpubkey")] public static extern byte[] Shutdown_get_scriptpubkey(long _this_ptr); // void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_set_scriptpubkey")] public static extern void Shutdown_set_scriptpubkey(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_set_scriptpubkey")] public static extern void Shutdown_set_scriptpubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_new")] public static extern long Shutdown_new(byte[] _channel_id_arg, byte[] _scriptpubkey_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_new")] public static extern long Shutdown_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _scriptpubkey_arg); // uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_clone_ptr")] public static extern long Shutdown_clone_ptr(long _arg); // struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); @@ -5202,7 +6483,7 @@ internal class bindings { // const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_get_channel_id")] public static extern byte[] ClosingSigned_get_channel_id(long _this_ptr); // void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_set_channel_id")] public static extern void ClosingSigned_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_set_channel_id")] public static extern void ClosingSigned_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_get_fee_satoshis")] public static extern long ClosingSigned_get_fee_satoshis(long _this_ptr); // void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val); @@ -5210,13 +6491,13 @@ internal class bindings { // struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_get_signature")] public static extern byte[] ClosingSigned_get_signature(long _this_ptr); // void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_set_signature")] public static extern void ClosingSigned_set_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_set_signature")] public static extern void ClosingSigned_set_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_get_fee_range")] public static extern long ClosingSigned_get_fee_range(long _this_ptr); // void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_set_fee_range")] public static extern void ClosingSigned_set_fee_range(long _this_ptr, long _val); // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_new")] public static extern long ClosingSigned_new(byte[] _channel_id_arg, long _fee_satoshis_arg, byte[] _signature_arg, long _fee_range_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_new")] public static extern long ClosingSigned_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _fee_satoshis_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature_arg, long _fee_range_arg); // uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_clone_ptr")] public static extern long ClosingSigned_clone_ptr(long _arg); // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); @@ -5228,7 +6509,7 @@ internal class bindings { // const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_channel_id")] public static extern byte[] UpdateAddHTLC_get_channel_id(long _this_ptr); // void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_channel_id")] public static extern void UpdateAddHTLC_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_channel_id")] public static extern void UpdateAddHTLC_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_htlc_id")] public static extern long UpdateAddHTLC_get_htlc_id(long _this_ptr); // void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val); @@ -5240,11 +6521,15 @@ internal class bindings { // const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_payment_hash")] public static extern byte[] UpdateAddHTLC_get_payment_hash(long _this_ptr); // void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_payment_hash")] public static extern void UpdateAddHTLC_set_payment_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_payment_hash")] public static extern void UpdateAddHTLC_set_payment_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_cltv_expiry")] public static extern int UpdateAddHTLC_get_cltv_expiry(long _this_ptr); // void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_cltv_expiry")] public static extern void UpdateAddHTLC_set_cltv_expiry(long _this_ptr, int _val); + // struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_skimmed_fee_msat")] public static extern long UpdateAddHTLC_get_skimmed_fee_msat(long _this_ptr); + // void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_skimmed_fee_msat")] public static extern void UpdateAddHTLC_set_skimmed_fee_msat(long _this_ptr, long _val); // uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_clone_ptr")] public static extern long UpdateAddHTLC_clone_ptr(long _arg); // struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); @@ -5256,7 +6541,7 @@ internal class bindings { // struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_get_blinding_point")] public static extern byte[] OnionMessage_get_blinding_point(long _this_ptr); // void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_set_blinding_point")] public static extern void OnionMessage_set_blinding_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_set_blinding_point")] public static extern void OnionMessage_set_blinding_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t OnionMessage_clone_ptr(LDKOnionMessage *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_clone_ptr")] public static extern long OnionMessage_clone_ptr(long _arg); // struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig); @@ -5268,7 +6553,7 @@ internal class bindings { // const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_get_channel_id")] public static extern byte[] UpdateFulfillHTLC_get_channel_id(long _this_ptr); // void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_set_channel_id")] public static extern void UpdateFulfillHTLC_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_set_channel_id")] public static extern void UpdateFulfillHTLC_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_get_htlc_id")] public static extern long UpdateFulfillHTLC_get_htlc_id(long _this_ptr); // void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val); @@ -5276,9 +6561,9 @@ internal class bindings { // const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_get_payment_preimage")] public static extern byte[] UpdateFulfillHTLC_get_payment_preimage(long _this_ptr); // void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_set_payment_preimage")] public static extern void UpdateFulfillHTLC_set_payment_preimage(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_set_payment_preimage")] public static extern void UpdateFulfillHTLC_set_payment_preimage(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_new")] public static extern long UpdateFulfillHTLC_new(byte[] _channel_id_arg, long _htlc_id_arg, byte[] _payment_preimage_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_new")] public static extern long UpdateFulfillHTLC_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _htlc_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_preimage_arg); // uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_clone_ptr")] public static extern long UpdateFulfillHTLC_clone_ptr(long _arg); // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); @@ -5290,7 +6575,7 @@ internal class bindings { // const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_get_channel_id")] public static extern byte[] UpdateFailHTLC_get_channel_id(long _this_ptr); // void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_set_channel_id")] public static extern void UpdateFailHTLC_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_set_channel_id")] public static extern void UpdateFailHTLC_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_get_htlc_id")] public static extern long UpdateFailHTLC_get_htlc_id(long _this_ptr); // void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val); @@ -5306,7 +6591,7 @@ internal class bindings { // const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_get_channel_id")] public static extern byte[] UpdateFailMalformedHTLC_get_channel_id(long _this_ptr); // void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_set_channel_id")] public static extern void UpdateFailMalformedHTLC_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_set_channel_id")] public static extern void UpdateFailMalformedHTLC_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_get_htlc_id")] public static extern long UpdateFailMalformedHTLC_get_htlc_id(long _this_ptr); // void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val); @@ -5326,17 +6611,17 @@ internal class bindings { // const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_get_channel_id")] public static extern byte[] CommitmentSigned_get_channel_id(long _this_ptr); // void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_channel_id")] public static extern void CommitmentSigned_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_channel_id")] public static extern void CommitmentSigned_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_get_signature")] public static extern byte[] CommitmentSigned_get_signature(long _this_ptr); // void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_signature")] public static extern void CommitmentSigned_set_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_signature")] public static extern void CommitmentSigned_set_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_get_htlc_signatures")] public static extern byte[][] CommitmentSigned_get_htlc_signatures(long _this_ptr); // void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_htlc_signatures")] public static extern void CommitmentSigned_set_htlc_signatures(long _this_ptr, byte[][] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_htlc_signatures")] public static extern void CommitmentSigned_set_htlc_signatures(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _val); // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_new")] public static extern long CommitmentSigned_new(byte[] _channel_id_arg, byte[] _signature_arg, byte[][] _htlc_signatures_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_new")] public static extern long CommitmentSigned_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _htlc_signatures_arg); // uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_clone_ptr")] public static extern long CommitmentSigned_clone_ptr(long _arg); // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); @@ -5348,17 +6633,17 @@ internal class bindings { // const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_get_channel_id")] public static extern byte[] RevokeAndACK_get_channel_id(long _this_ptr); // void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_channel_id")] public static extern void RevokeAndACK_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_channel_id")] public static extern void RevokeAndACK_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_get_per_commitment_secret")] public static extern byte[] RevokeAndACK_get_per_commitment_secret(long _this_ptr); // void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_per_commitment_secret")] public static extern void RevokeAndACK_set_per_commitment_secret(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_per_commitment_secret")] public static extern void RevokeAndACK_set_per_commitment_secret(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_get_next_per_commitment_point")] public static extern byte[] RevokeAndACK_get_next_per_commitment_point(long _this_ptr); // void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_next_per_commitment_point")] public static extern void RevokeAndACK_set_next_per_commitment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_next_per_commitment_point")] public static extern void RevokeAndACK_set_next_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_new")] public static extern long RevokeAndACK_new(byte[] _channel_id_arg, byte[] _per_commitment_secret_arg, byte[] _next_per_commitment_point_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_new")] public static extern long RevokeAndACK_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_secret_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _next_per_commitment_point_arg); // uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_clone_ptr")] public static extern long RevokeAndACK_clone_ptr(long _arg); // struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); @@ -5370,43 +6655,25 @@ internal class bindings { // const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_get_channel_id")] public static extern byte[] UpdateFee_get_channel_id(long _this_ptr); // void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_set_channel_id")] public static extern void UpdateFee_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_set_channel_id")] public static extern void UpdateFee_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_get_feerate_per_kw")] public static extern int UpdateFee_get_feerate_per_kw(long _this_ptr); // void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_set_feerate_per_kw")] public static extern void UpdateFee_set_feerate_per_kw(long _this_ptr, int _val); // MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_new")] public static extern long UpdateFee_new(byte[] _channel_id_arg, int _feerate_per_kw_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_new")] public static extern long UpdateFee_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, int _feerate_per_kw_arg); // uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_clone_ptr")] public static extern long UpdateFee_clone_ptr(long _arg); // struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_clone")] public static extern long UpdateFee_clone(long _orig); // bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_eq")] public static extern bool UpdateFee_eq(long _a, long _b); - // void DataLossProtect_free(struct LDKDataLossProtect this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_free")] public static extern void DataLossProtect_free(long _this_obj); - // const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_get_your_last_per_commitment_secret")] public static extern byte[] DataLossProtect_get_your_last_per_commitment_secret(long _this_ptr); - // void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_set_your_last_per_commitment_secret")] public static extern void DataLossProtect_set_your_last_per_commitment_secret(long _this_ptr, byte[] _val); - // struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_get_my_current_per_commitment_point")] public static extern byte[] DataLossProtect_get_my_current_per_commitment_point(long _this_ptr); - // void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_set_my_current_per_commitment_point")] public static extern void DataLossProtect_set_my_current_per_commitment_point(long _this_ptr, byte[] _val); - // MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_new")] public static extern long DataLossProtect_new(byte[] _your_last_per_commitment_secret_arg, byte[] _my_current_per_commitment_point_arg); - // uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_clone_ptr")] public static extern long DataLossProtect_clone_ptr(long _arg); - // struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_clone")] public static extern long DataLossProtect_clone(long _orig); - // bool DataLossProtect_eq(const struct LDKDataLossProtect *NONNULL_PTR a, const struct LDKDataLossProtect *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DataLossProtect_eq")] public static extern bool DataLossProtect_eq(long _a, long _b); // void ChannelReestablish_free(struct LDKChannelReestablish this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_free")] public static extern void ChannelReestablish_free(long _this_obj); // const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_channel_id")] public static extern byte[] ChannelReestablish_get_channel_id(long _this_ptr); // void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_channel_id")] public static extern void ChannelReestablish_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_channel_id")] public static extern void ChannelReestablish_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_next_local_commitment_number")] public static extern long ChannelReestablish_get_next_local_commitment_number(long _this_ptr); // void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); @@ -5415,6 +6682,20 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_next_remote_commitment_number")] public static extern long ChannelReestablish_get_next_remote_commitment_number(long _this_ptr); // void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_next_remote_commitment_number")] public static extern void ChannelReestablish_set_next_remote_commitment_number(long _this_ptr, long _val); + // const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_your_last_per_commitment_secret")] public static extern byte[] ChannelReestablish_get_your_last_per_commitment_secret(long _this_ptr); + // void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_your_last_per_commitment_secret")] public static extern void ChannelReestablish_set_your_last_per_commitment_secret(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_my_current_per_commitment_point")] public static extern byte[] ChannelReestablish_get_my_current_per_commitment_point(long _this_ptr); + // void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_my_current_per_commitment_point")] public static extern void ChannelReestablish_set_my_current_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKCOption_TxidZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_next_funding_txid")] public static extern long ChannelReestablish_get_next_funding_txid(long _this_ptr); + // void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_TxidZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_next_funding_txid")] public static extern void ChannelReestablish_set_next_funding_txid(long _this_ptr, long _val); + // MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_TxidZ next_funding_txid_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_new")] public static extern long ChannelReestablish_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _next_local_commitment_number_arg, long _next_remote_commitment_number_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _your_last_per_commitment_secret_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _my_current_per_commitment_point_arg, long _next_funding_txid_arg); // uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_clone_ptr")] public static extern long ChannelReestablish_clone_ptr(long _arg); // struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); @@ -5426,7 +6707,7 @@ internal class bindings { // const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_get_channel_id")] public static extern byte[] AnnouncementSignatures_get_channel_id(long _this_ptr); // void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_channel_id")] public static extern void AnnouncementSignatures_set_channel_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_channel_id")] public static extern void AnnouncementSignatures_set_channel_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_get_short_channel_id")] public static extern long AnnouncementSignatures_get_short_channel_id(long _this_ptr); // void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val); @@ -5434,13 +6715,13 @@ internal class bindings { // struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_get_node_signature")] public static extern byte[] AnnouncementSignatures_get_node_signature(long _this_ptr); // void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_node_signature")] public static extern void AnnouncementSignatures_set_node_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_node_signature")] public static extern void AnnouncementSignatures_set_node_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_get_bitcoin_signature")] public static extern byte[] AnnouncementSignatures_get_bitcoin_signature(long _this_ptr); // void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_bitcoin_signature")] public static extern void AnnouncementSignatures_set_bitcoin_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_bitcoin_signature")] public static extern void AnnouncementSignatures_set_bitcoin_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_new")] public static extern long AnnouncementSignatures_new(byte[] _channel_id_arg, long _short_channel_id_arg, byte[] _node_signature_arg, byte[] _bitcoin_signature_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_new")] public static extern long AnnouncementSignatures_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id_arg, long _short_channel_id_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_signature_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _bitcoin_signature_arg); // uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_clone_ptr")] public static extern long AnnouncementSignatures_clone_ptr(long _arg); // struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); @@ -5454,13 +6735,13 @@ internal class bindings { // struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_clone")] public static extern long NetAddress_clone(long _orig); // struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_ipv4")] public static extern long NetAddress_ipv4(byte[] _addr, short _port); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_ipv4")] public static extern long NetAddress_ipv4([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _addr, short _port); // struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_ipv6")] public static extern long NetAddress_ipv6(byte[] _addr, short _port); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_ipv6")] public static extern long NetAddress_ipv6([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _addr, short _port); // struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_onion_v2")] public static extern long NetAddress_onion_v2(byte[] _a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_onion_v2")] public static extern long NetAddress_onion_v2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a); // struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_onion_v3")] public static extern long NetAddress_onion_v3(byte[] _ed25519_pubkey, short _checksum, byte _version, short _port); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_onion_v3")] public static extern long NetAddress_onion_v3([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ed25519_pubkey, short _checksum, byte _version, short _port); // struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_hostname")] public static extern long NetAddress_hostname(long _hostname, short _port); // bool NetAddress_eq(const struct LDKNetAddress *NONNULL_PTR a, const struct LDKNetAddress *NONNULL_PTR b); @@ -5468,7 +6749,21 @@ internal class bindings { // struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_write")] public static extern byte[] NetAddress_write(long _obj); // struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_read")] public static extern long NetAddress_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetAddress_read")] public static extern long NetAddress_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedGossipMessage_free")] public static extern void UnsignedGossipMessage_free(long _this_ptr); + // uint64_t UnsignedGossipMessage_clone_ptr(LDKUnsignedGossipMessage *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedGossipMessage_clone_ptr")] public static extern long UnsignedGossipMessage_clone_ptr(long _arg); + // struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedGossipMessage_clone")] public static extern long UnsignedGossipMessage_clone(long _orig); + // struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedGossipMessage_channel_announcement")] public static extern long UnsignedGossipMessage_channel_announcement(long _a); + // struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedGossipMessage_channel_update")] public static extern long UnsignedGossipMessage_channel_update(long _a); + // struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedGossipMessage_node_announcement")] public static extern long UnsignedGossipMessage_node_announcement(long _a); + // struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedGossipMessage_write")] public static extern byte[] UnsignedGossipMessage_write(long _obj); // void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_free")] public static extern void UnsignedNodeAnnouncement_free(long _this_obj); // struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); @@ -5479,22 +6774,22 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_timestamp")] public static extern int UnsignedNodeAnnouncement_get_timestamp(long _this_ptr); // void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_timestamp")] public static extern void UnsignedNodeAnnouncement_set_timestamp(long _this_ptr, int _val); - // struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_node_id")] public static extern byte[] UnsignedNodeAnnouncement_get_node_id(long _this_ptr); - // void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_node_id")] public static extern void UnsignedNodeAnnouncement_set_node_id(long _this_ptr, byte[] _val); + // struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_node_id")] public static extern long UnsignedNodeAnnouncement_get_node_id(long _this_ptr); + // void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_node_id")] public static extern void UnsignedNodeAnnouncement_set_node_id(long _this_ptr, long _val); // const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_rgb")] public static extern byte[] UnsignedNodeAnnouncement_get_rgb(long _this_ptr); // void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_rgb")] public static extern void UnsignedNodeAnnouncement_set_rgb(long _this_ptr, byte[] _val); - // const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_alias")] public static extern byte[] UnsignedNodeAnnouncement_get_alias(long _this_ptr); - // void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_alias")] public static extern void UnsignedNodeAnnouncement_set_alias(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_rgb")] public static extern void UnsignedNodeAnnouncement_set_rgb(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_alias")] public static extern long UnsignedNodeAnnouncement_get_alias(long _this_ptr); + // void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_alias")] public static extern void UnsignedNodeAnnouncement_set_alias(long _this_ptr, long _val); // struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_addresses")] public static extern long[] UnsignedNodeAnnouncement_get_addresses(long _this_ptr); // void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_addresses")] public static extern void UnsignedNodeAnnouncement_set_addresses(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_addresses")] public static extern void UnsignedNodeAnnouncement_set_addresses(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_clone_ptr")] public static extern long UnsignedNodeAnnouncement_clone_ptr(long _arg); // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); @@ -5506,13 +6801,13 @@ internal class bindings { // struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_get_signature")] public static extern byte[] NodeAnnouncement_get_signature(long _this_ptr); // void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_set_signature")] public static extern void NodeAnnouncement_set_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_set_signature")] public static extern void NodeAnnouncement_set_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_get_contents")] public static extern long NodeAnnouncement_get_contents(long _this_ptr); // void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_set_contents")] public static extern void NodeAnnouncement_set_contents(long _this_ptr, long _val); // MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_new")] public static extern long NodeAnnouncement_new(byte[] _signature_arg, long _contents_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_new")] public static extern long NodeAnnouncement_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature_arg, long _contents_arg); // uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_clone_ptr")] public static extern long NodeAnnouncement_clone_ptr(long _arg); // struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); @@ -5528,27 +6823,27 @@ internal class bindings { // const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_chain_hash")] public static extern byte[] UnsignedChannelAnnouncement_get_chain_hash(long _this_ptr); // void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_chain_hash")] public static extern void UnsignedChannelAnnouncement_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_chain_hash")] public static extern void UnsignedChannelAnnouncement_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_short_channel_id")] public static extern long UnsignedChannelAnnouncement_get_short_channel_id(long _this_ptr); // void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_short_channel_id")] public static extern void UnsignedChannelAnnouncement_set_short_channel_id(long _this_ptr, long _val); - // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_node_id_1")] public static extern byte[] UnsignedChannelAnnouncement_get_node_id_1(long _this_ptr); - // void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_node_id_1")] public static extern void UnsignedChannelAnnouncement_set_node_id_1(long _this_ptr, byte[] _val); - // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_node_id_2")] public static extern byte[] UnsignedChannelAnnouncement_get_node_id_2(long _this_ptr); - // void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_node_id_2")] public static extern void UnsignedChannelAnnouncement_set_node_id_2(long _this_ptr, byte[] _val); - // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_bitcoin_key_1")] public static extern byte[] UnsignedChannelAnnouncement_get_bitcoin_key_1(long _this_ptr); - // void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_bitcoin_key_1")] public static extern void UnsignedChannelAnnouncement_set_bitcoin_key_1(long _this_ptr, byte[] _val); - // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_bitcoin_key_2")] public static extern byte[] UnsignedChannelAnnouncement_get_bitcoin_key_2(long _this_ptr); - // void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_bitcoin_key_2")] public static extern void UnsignedChannelAnnouncement_set_bitcoin_key_2(long _this_ptr, byte[] _val); + // struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_node_id_1")] public static extern long UnsignedChannelAnnouncement_get_node_id_1(long _this_ptr); + // void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_node_id_1")] public static extern void UnsignedChannelAnnouncement_set_node_id_1(long _this_ptr, long _val); + // struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_node_id_2")] public static extern long UnsignedChannelAnnouncement_get_node_id_2(long _this_ptr); + // void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_node_id_2")] public static extern void UnsignedChannelAnnouncement_set_node_id_2(long _this_ptr, long _val); + // struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_bitcoin_key_1")] public static extern long UnsignedChannelAnnouncement_get_bitcoin_key_1(long _this_ptr); + // void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_bitcoin_key_1")] public static extern void UnsignedChannelAnnouncement_set_bitcoin_key_1(long _this_ptr, long _val); + // struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_get_bitcoin_key_2")] public static extern long UnsignedChannelAnnouncement_get_bitcoin_key_2(long _this_ptr); + // void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_set_bitcoin_key_2")] public static extern void UnsignedChannelAnnouncement_set_bitcoin_key_2(long _this_ptr, long _val); // uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_clone_ptr")] public static extern long UnsignedChannelAnnouncement_clone_ptr(long _arg); // struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); @@ -5560,25 +6855,25 @@ internal class bindings { // struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_get_node_signature_1")] public static extern byte[] ChannelAnnouncement_get_node_signature_1(long _this_ptr); // void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_node_signature_1")] public static extern void ChannelAnnouncement_set_node_signature_1(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_node_signature_1")] public static extern void ChannelAnnouncement_set_node_signature_1(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_get_node_signature_2")] public static extern byte[] ChannelAnnouncement_get_node_signature_2(long _this_ptr); // void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_node_signature_2")] public static extern void ChannelAnnouncement_set_node_signature_2(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_node_signature_2")] public static extern void ChannelAnnouncement_set_node_signature_2(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_get_bitcoin_signature_1")] public static extern byte[] ChannelAnnouncement_get_bitcoin_signature_1(long _this_ptr); // void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_bitcoin_signature_1")] public static extern void ChannelAnnouncement_set_bitcoin_signature_1(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_bitcoin_signature_1")] public static extern void ChannelAnnouncement_set_bitcoin_signature_1(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_get_bitcoin_signature_2")] public static extern byte[] ChannelAnnouncement_get_bitcoin_signature_2(long _this_ptr); // void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_bitcoin_signature_2")] public static extern void ChannelAnnouncement_set_bitcoin_signature_2(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_bitcoin_signature_2")] public static extern void ChannelAnnouncement_set_bitcoin_signature_2(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_get_contents")] public static extern long ChannelAnnouncement_get_contents(long _this_ptr); // void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_set_contents")] public static extern void ChannelAnnouncement_set_contents(long _this_ptr, long _val); // MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_new")] public static extern long ChannelAnnouncement_new(byte[] _node_signature_1_arg, byte[] _node_signature_2_arg, byte[] _bitcoin_signature_1_arg, byte[] _bitcoin_signature_2_arg, long _contents_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_new")] public static extern long ChannelAnnouncement_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_signature_1_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_signature_2_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _bitcoin_signature_1_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _bitcoin_signature_2_arg, long _contents_arg); // uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_clone_ptr")] public static extern long ChannelAnnouncement_clone_ptr(long _arg); // struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); @@ -5590,7 +6885,7 @@ internal class bindings { // const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_chain_hash")] public static extern byte[] UnsignedChannelUpdate_get_chain_hash(long _this_ptr); // void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_chain_hash")] public static extern void UnsignedChannelUpdate_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_chain_hash")] public static extern void UnsignedChannelUpdate_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_short_channel_id")] public static extern long UnsignedChannelUpdate_get_short_channel_id(long _this_ptr); // void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val); @@ -5626,9 +6921,9 @@ internal class bindings { // struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_get_excess_data")] public static extern byte[] UnsignedChannelUpdate_get_excess_data(long _this_ptr); // void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_excess_data")] public static extern void UnsignedChannelUpdate_set_excess_data(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_set_excess_data")] public static extern void UnsignedChannelUpdate_set_excess_data(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_new")] public static extern long UnsignedChannelUpdate_new(byte[] _chain_hash_arg, long _short_channel_id_arg, int _timestamp_arg, byte _flags_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg, int _fee_base_msat_arg, int _fee_proportional_millionths_arg, byte[] _excess_data_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_new")] public static extern long UnsignedChannelUpdate_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, long _short_channel_id_arg, int _timestamp_arg, byte _flags_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg, int _fee_base_msat_arg, int _fee_proportional_millionths_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _excess_data_arg); // uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_clone_ptr")] public static extern long UnsignedChannelUpdate_clone_ptr(long _arg); // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); @@ -5640,13 +6935,13 @@ internal class bindings { // struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_get_signature")] public static extern byte[] ChannelUpdate_get_signature(long _this_ptr); // void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_set_signature")] public static extern void ChannelUpdate_set_signature(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_set_signature")] public static extern void ChannelUpdate_set_signature(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_get_contents")] public static extern long ChannelUpdate_get_contents(long _this_ptr); // void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_set_contents")] public static extern void ChannelUpdate_set_contents(long _this_ptr, long _val); // MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_new")] public static extern long ChannelUpdate_new(byte[] _signature_arg, long _contents_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_new")] public static extern long ChannelUpdate_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature_arg, long _contents_arg); // uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_clone_ptr")] public static extern long ChannelUpdate_clone_ptr(long _arg); // struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); @@ -5658,7 +6953,7 @@ internal class bindings { // const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_get_chain_hash")] public static extern byte[] QueryChannelRange_get_chain_hash(long _this_ptr); // void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_set_chain_hash")] public static extern void QueryChannelRange_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_set_chain_hash")] public static extern void QueryChannelRange_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_get_first_blocknum")] public static extern int QueryChannelRange_get_first_blocknum(long _this_ptr); // void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); @@ -5668,7 +6963,7 @@ internal class bindings { // void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_set_number_of_blocks")] public static extern void QueryChannelRange_set_number_of_blocks(long _this_ptr, int _val); // MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_new")] public static extern long QueryChannelRange_new(byte[] _chain_hash_arg, int _first_blocknum_arg, int _number_of_blocks_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_new")] public static extern long QueryChannelRange_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, int _first_blocknum_arg, int _number_of_blocks_arg); // uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_clone_ptr")] public static extern long QueryChannelRange_clone_ptr(long _arg); // struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); @@ -5680,7 +6975,7 @@ internal class bindings { // const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_get_chain_hash")] public static extern byte[] ReplyChannelRange_get_chain_hash(long _this_ptr); // void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_set_chain_hash")] public static extern void ReplyChannelRange_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_set_chain_hash")] public static extern void ReplyChannelRange_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_get_first_blocknum")] public static extern int ReplyChannelRange_get_first_blocknum(long _this_ptr); // void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val); @@ -5696,9 +6991,9 @@ internal class bindings { // struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_get_short_channel_ids")] public static extern long[] ReplyChannelRange_get_short_channel_ids(long _this_ptr); // void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_set_short_channel_ids")] public static extern void ReplyChannelRange_set_short_channel_ids(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_set_short_channel_ids")] public static extern void ReplyChannelRange_set_short_channel_ids(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_new")] public static extern long ReplyChannelRange_new(byte[] _chain_hash_arg, int _first_blocknum_arg, int _number_of_blocks_arg, bool _sync_complete_arg, long[] _short_channel_ids_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_new")] public static extern long ReplyChannelRange_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, int _first_blocknum_arg, int _number_of_blocks_arg, bool _sync_complete_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _short_channel_ids_arg); // uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_clone_ptr")] public static extern long ReplyChannelRange_clone_ptr(long _arg); // struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); @@ -5710,13 +7005,13 @@ internal class bindings { // const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_get_chain_hash")] public static extern byte[] QueryShortChannelIds_get_chain_hash(long _this_ptr); // void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_set_chain_hash")] public static extern void QueryShortChannelIds_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_set_chain_hash")] public static extern void QueryShortChannelIds_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_get_short_channel_ids")] public static extern long[] QueryShortChannelIds_get_short_channel_ids(long _this_ptr); // void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_set_short_channel_ids")] public static extern void QueryShortChannelIds_set_short_channel_ids(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_set_short_channel_ids")] public static extern void QueryShortChannelIds_set_short_channel_ids(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_new")] public static extern long QueryShortChannelIds_new(byte[] _chain_hash_arg, long[] _short_channel_ids_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_new")] public static extern long QueryShortChannelIds_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _short_channel_ids_arg); // uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_clone_ptr")] public static extern long QueryShortChannelIds_clone_ptr(long _arg); // struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); @@ -5728,13 +7023,13 @@ internal class bindings { // const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_get_chain_hash")] public static extern byte[] ReplyShortChannelIdsEnd_get_chain_hash(long _this_ptr); // void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_set_chain_hash")] public static extern void ReplyShortChannelIdsEnd_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_set_chain_hash")] public static extern void ReplyShortChannelIdsEnd_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_get_full_information")] public static extern bool ReplyShortChannelIdsEnd_get_full_information(long _this_ptr); // void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_set_full_information")] public static extern void ReplyShortChannelIdsEnd_set_full_information(long _this_ptr, bool _val); // MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_new")] public static extern long ReplyShortChannelIdsEnd_new(byte[] _chain_hash_arg, bool _full_information_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_new")] public static extern long ReplyShortChannelIdsEnd_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, bool _full_information_arg); // uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_clone_ptr")] public static extern long ReplyShortChannelIdsEnd_clone_ptr(long _arg); // struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); @@ -5746,7 +7041,7 @@ internal class bindings { // const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_get_chain_hash")] public static extern byte[] GossipTimestampFilter_get_chain_hash(long _this_ptr); // void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_set_chain_hash")] public static extern void GossipTimestampFilter_set_chain_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_set_chain_hash")] public static extern void GossipTimestampFilter_set_chain_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_get_first_timestamp")] public static extern int GossipTimestampFilter_get_first_timestamp(long _this_ptr); // void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); @@ -5756,7 +7051,7 @@ internal class bindings { // void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_set_timestamp_range")] public static extern void GossipTimestampFilter_set_timestamp_range(long _this_ptr, int _val); // MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_new")] public static extern long GossipTimestampFilter_new(byte[] _chain_hash_arg, int _first_timestamp_arg, int _timestamp_range_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_new")] public static extern long GossipTimestampFilter_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain_hash_arg, int _first_timestamp_arg, int _timestamp_range_arg); // uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_clone_ptr")] public static extern long GossipTimestampFilter_clone_ptr(long _arg); // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); @@ -5771,6 +7066,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorAction_clone")] public static extern long ErrorAction_clone(long _orig); // struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorAction_disconnect_peer")] public static extern long ErrorAction_disconnect_peer(long _msg); + // struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorAction_disconnect_peer_with_warning")] public static extern long ErrorAction_disconnect_peer_with_warning(long _msg); // struct LDKErrorAction ErrorAction_ignore_error(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorAction_ignore_error")] public static extern long ErrorAction_ignore_error(); // struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a); @@ -5802,19 +7099,19 @@ internal class bindings { // struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_get_update_add_htlcs")] public static extern long[] CommitmentUpdate_get_update_add_htlcs(long _this_ptr); // void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_add_htlcs")] public static extern void CommitmentUpdate_set_update_add_htlcs(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_add_htlcs")] public static extern void CommitmentUpdate_set_update_add_htlcs(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_get_update_fulfill_htlcs")] public static extern long[] CommitmentUpdate_get_update_fulfill_htlcs(long _this_ptr); // void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_fulfill_htlcs")] public static extern void CommitmentUpdate_set_update_fulfill_htlcs(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_fulfill_htlcs")] public static extern void CommitmentUpdate_set_update_fulfill_htlcs(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_get_update_fail_htlcs")] public static extern long[] CommitmentUpdate_get_update_fail_htlcs(long _this_ptr); // void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_fail_htlcs")] public static extern void CommitmentUpdate_set_update_fail_htlcs(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_fail_htlcs")] public static extern void CommitmentUpdate_set_update_fail_htlcs(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_get_update_fail_malformed_htlcs")] public static extern long[] CommitmentUpdate_get_update_fail_malformed_htlcs(long _this_ptr); // void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_fail_malformed_htlcs")] public static extern void CommitmentUpdate_set_update_fail_malformed_htlcs(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_update_fail_malformed_htlcs")] public static extern void CommitmentUpdate_set_update_fail_malformed_htlcs(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_get_update_fee")] public static extern long CommitmentUpdate_get_update_fee(long _this_ptr); // void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val); @@ -5824,7 +7121,7 @@ internal class bindings { // void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_set_commitment_signed")] public static extern void CommitmentUpdate_set_commitment_signed(long _this_ptr, long _val); // MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_new")] public static extern long CommitmentUpdate_new(long[] _update_add_htlcs_arg, long[] _update_fulfill_htlcs_arg, long[] _update_fail_htlcs_arg, long[] _update_fail_malformed_htlcs_arg, long _update_fee_arg, long _commitment_signed_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_new")] public static extern long CommitmentUpdate_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _update_add_htlcs_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _update_fulfill_htlcs_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _update_fail_htlcs_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _update_fail_malformed_htlcs_arg, long _update_fee_arg, long _commitment_signed_arg); // uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentUpdate_clone_ptr")] public static extern long CommitmentUpdate_clone_ptr(long _arg); // struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); @@ -5840,141 +7137,185 @@ internal class bindings { // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_write")] public static extern byte[] AcceptChannel_write(long _obj); // struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_read")] public static extern long AcceptChannel_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_read")] public static extern long AcceptChannel_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_write")] public static extern byte[] AcceptChannelV2_write(long _obj); + // struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_read")] public static extern long AcceptChannelV2_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_write")] public static extern byte[] TxAddInput_write(long _obj); + // struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_read")] public static extern long TxAddInput_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_write")] public static extern byte[] TxAddOutput_write(long _obj); + // struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_read")] public static extern long TxAddOutput_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_write")] public static extern byte[] TxRemoveInput_write(long _obj); + // struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_read")] public static extern long TxRemoveInput_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_write")] public static extern byte[] TxRemoveOutput_write(long _obj); + // struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_read")] public static extern long TxRemoveOutput_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_write")] public static extern byte[] TxComplete_write(long _obj); + // struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_read")] public static extern long TxComplete_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_write")] public static extern byte[] TxSignatures_write(long _obj); + // struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_read")] public static extern long TxSignatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_write")] public static extern byte[] TxInitRbf_write(long _obj); + // struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_read")] public static extern long TxInitRbf_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_write")] public static extern byte[] TxAckRbf_write(long _obj); + // struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_read")] public static extern long TxAckRbf_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_write")] public static extern byte[] TxAbort_write(long _obj); + // struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_read")] public static extern long TxAbort_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_write")] public static extern byte[] AnnouncementSignatures_write(long _obj); // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_read")] public static extern long AnnouncementSignatures_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_read")] public static extern long AnnouncementSignatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_write")] public static extern byte[] ChannelReestablish_write(long _obj); // struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_read")] public static extern long ChannelReestablish_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_read")] public static extern long ChannelReestablish_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_write")] public static extern byte[] ClosingSigned_write(long _obj); // struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_read")] public static extern long ClosingSigned_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_read")] public static extern long ClosingSigned_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSignedFeeRange_write")] public static extern byte[] ClosingSignedFeeRange_write(long _obj); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSignedFeeRange_read")] public static extern long ClosingSignedFeeRange_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSignedFeeRange_read")] public static extern long ClosingSignedFeeRange_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_write")] public static extern byte[] CommitmentSigned_write(long _obj); // struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_read")] public static extern long CommitmentSigned_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_read")] public static extern long CommitmentSigned_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_write")] public static extern byte[] FundingCreated_write(long _obj); // struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_read")] public static extern long FundingCreated_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_read")] public static extern long FundingCreated_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_write")] public static extern byte[] FundingSigned_write(long _obj); // struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_read")] public static extern long FundingSigned_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_read")] public static extern long FundingSigned_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_write")] public static extern byte[] ChannelReady_write(long _obj); // struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_read")] public static extern long ChannelReady_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_read")] public static extern long ChannelReady_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_write")] public static extern byte[] Init_write(long _obj); // struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_read")] public static extern long Init_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_read")] public static extern long Init_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_write")] public static extern byte[] OpenChannel_write(long _obj); // struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_read")] public static extern long OpenChannel_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_read")] public static extern long OpenChannel_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_write")] public static extern byte[] OpenChannelV2_write(long _obj); + // struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_read")] public static extern long OpenChannelV2_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_write")] public static extern byte[] RevokeAndACK_write(long _obj); // struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_read")] public static extern long RevokeAndACK_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_read")] public static extern long RevokeAndACK_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_write")] public static extern byte[] Shutdown_write(long _obj); // struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_read")] public static extern long Shutdown_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_read")] public static extern long Shutdown_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_write")] public static extern byte[] UpdateFailHTLC_write(long _obj); // struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_read")] public static extern long UpdateFailHTLC_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_read")] public static extern long UpdateFailHTLC_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_write")] public static extern byte[] UpdateFailMalformedHTLC_write(long _obj); // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_read")] public static extern long UpdateFailMalformedHTLC_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_read")] public static extern long UpdateFailMalformedHTLC_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_write")] public static extern byte[] UpdateFee_write(long _obj); // struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_read")] public static extern long UpdateFee_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_read")] public static extern long UpdateFee_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_write")] public static extern byte[] UpdateFulfillHTLC_write(long _obj); // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_read")] public static extern long UpdateFulfillHTLC_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_read")] public static extern long UpdateFulfillHTLC_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_write")] public static extern byte[] UpdateAddHTLC_write(long _obj); // struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_read")] public static extern long UpdateAddHTLC_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_read")] public static extern long UpdateAddHTLC_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_read")] public static extern long OnionMessage_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_read")] public static extern long OnionMessage_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_write")] public static extern byte[] OnionMessage_write(long _obj); // struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Ping_write")] public static extern byte[] Ping_write(long _obj); // struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Ping_read")] public static extern long Ping_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Ping_read")] public static extern long Ping_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Pong_write")] public static extern byte[] Pong_write(long _obj); // struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Pong_read")] public static extern long Pong_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Pong_read")] public static extern long Pong_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_write")] public static extern byte[] UnsignedChannelAnnouncement_write(long _obj); // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_read")] public static extern long UnsignedChannelAnnouncement_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelAnnouncement_read")] public static extern long UnsignedChannelAnnouncement_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_write")] public static extern byte[] ChannelAnnouncement_write(long _obj); // struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_read")] public static extern long ChannelAnnouncement_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelAnnouncement_read")] public static extern long ChannelAnnouncement_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_write")] public static extern byte[] UnsignedChannelUpdate_write(long _obj); // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_read")] public static extern long UnsignedChannelUpdate_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedChannelUpdate_read")] public static extern long UnsignedChannelUpdate_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_write")] public static extern byte[] ChannelUpdate_write(long _obj); // struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_read")] public static extern long ChannelUpdate_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdate_read")] public static extern long ChannelUpdate_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_write")] public static extern byte[] ErrorMessage_write(long _obj); // struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_read")] public static extern long ErrorMessage_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_read")] public static extern long ErrorMessage_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_write")] public static extern byte[] WarningMessage_write(long _obj); // struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_read")] public static extern long WarningMessage_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_read")] public static extern long WarningMessage_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_write")] public static extern byte[] UnsignedNodeAnnouncement_write(long _obj); // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_read")] public static extern long UnsignedNodeAnnouncement_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_read")] public static extern long UnsignedNodeAnnouncement_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_write")] public static extern byte[] NodeAnnouncement_write(long _obj); // struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_read")] public static extern long NodeAnnouncement_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncement_read")] public static extern long NodeAnnouncement_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_read")] public static extern long QueryShortChannelIds_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_read")] public static extern long QueryShortChannelIds_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryShortChannelIds_write")] public static extern byte[] QueryShortChannelIds_write(long _obj); // struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_write")] public static extern byte[] ReplyShortChannelIdsEnd_write(long _obj); // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_read")] public static extern long ReplyShortChannelIdsEnd_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyShortChannelIdsEnd_read")] public static extern long ReplyShortChannelIdsEnd_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_end_blocknum")] public static extern int QueryChannelRange_end_blocknum(long _this_arg); // struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_write")] public static extern byte[] QueryChannelRange_write(long _obj); // struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_read")] public static extern long QueryChannelRange_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_QueryChannelRange_read")] public static extern long QueryChannelRange_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_read")] public static extern long ReplyChannelRange_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_read")] public static extern long ReplyChannelRange_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReplyChannelRange_write")] public static extern byte[] ReplyChannelRange_write(long _obj); // struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_write")] public static extern byte[] GossipTimestampFilter_write(long _obj); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_read")] public static extern long GossipTimestampFilter_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_GossipTimestampFilter_read")] public static extern long GossipTimestampFilter_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageHandler_free")] public static extern void CustomMessageHandler_free(long _this_ptr); // void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj); @@ -5989,6 +7330,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_OnionMessageProvider")] public static extern long IgnoringMessageHandler_as_OnionMessageProvider(long _this_arg); // struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_OnionMessageHandler")] public static extern long IgnoringMessageHandler_as_OnionMessageHandler(long _this_arg); + // struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_OffersMessageHandler")] public static extern long IgnoringMessageHandler_as_OffersMessageHandler(long _this_arg); // struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IgnoringMessageHandler_as_CustomOnionMessageHandler")] public static extern long IgnoringMessageHandler_as_CustomOnionMessageHandler(long _this_arg); // struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); @@ -6017,8 +7360,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageHandler_get_onion_message_handler")] public static extern long MessageHandler_get_onion_message_handler(long _this_ptr); // void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageHandler_set_onion_message_handler")] public static extern void MessageHandler_set_onion_message_handler(long _this_ptr, long _val); - // MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageHandler_new")] public static extern long MessageHandler_new(long _chan_handler_arg, long _route_handler_arg, long _onion_message_handler_arg); + // const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageHandler_get_custom_message_handler")] public static extern long MessageHandler_get_custom_message_handler(long _this_ptr); + // void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageHandler_set_custom_message_handler")] public static extern void MessageHandler_set_custom_message_handler(long _this_ptr, long _val); + // MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg, struct LDKCustomMessageHandler custom_message_handler_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageHandler_new")] public static extern long MessageHandler_new(long _chan_handler_arg, long _route_handler_arg, long _onion_message_handler_arg, long _custom_message_handler_arg); // uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_clone_ptr")] public static extern long SocketDescriptor_clone_ptr(long _arg); // struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig); @@ -6027,46 +7374,42 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_free")] public static extern void SocketDescriptor_free(long _this_ptr); // void PeerHandleError_free(struct LDKPeerHandleError this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_free")] public static extern void PeerHandleError_free(long _this_obj); - // bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_get_no_connection_possible")] public static extern bool PeerHandleError_get_no_connection_possible(long _this_ptr); - // void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_set_no_connection_possible")] public static extern void PeerHandleError_set_no_connection_possible(long _this_ptr, bool _val); - // MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_new")] public static extern long PeerHandleError_new(bool _no_connection_possible_arg); + // MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_new")] public static extern long PeerHandleError_new(); // uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_clone_ptr")] public static extern long PeerHandleError_clone_ptr(long _arg); // struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_clone")] public static extern long PeerHandleError_clone(long _orig); // void PeerManager_free(struct LDKPeerManager this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_free")] public static extern void PeerManager_free(long _this_obj); - // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_new")] public static extern long PeerManager_new(long _message_handler, byte[] _our_node_secret, int _current_time, byte[] _ephemeral_random_data, long _logger, long _custom_message_handler); - // MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_get_peer_node_ids")] public static extern byte[][] PeerManager_get_peer_node_ids(long _this_arg); + // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKNodeSigner node_signer); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_new")] public static extern long PeerManager_new(long _message_handler, int _current_time, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ephemeral_random_data, long _logger, long _node_signer); + // MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_get_peer_node_ids")] public static extern long[] PeerManager_get_peer_node_ids(long _this_arg); // MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_NetAddressZ remote_network_address); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_new_outbound_connection")] public static extern long PeerManager_new_outbound_connection(long _this_arg, byte[] _their_node_id, long _descriptor, long _remote_network_address); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_new_outbound_connection")] public static extern long PeerManager_new_outbound_connection(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _their_node_id, long _descriptor, long _remote_network_address); // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_NetAddressZ remote_network_address); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_new_inbound_connection")] public static extern long PeerManager_new_inbound_connection(long _this_arg, long _descriptor, long _remote_network_address); // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_write_buffer_space_avail")] public static extern long PeerManager_write_buffer_space_avail(long _this_arg, long _descriptor); // MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_read_event")] public static extern long PeerManager_read_event(long _this_arg, long _peer_descriptor, byte[] _data); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_read_event")] public static extern long PeerManager_read_event(long _this_arg, long _peer_descriptor, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _data); // void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_process_events")] public static extern void PeerManager_process_events(long _this_arg); // void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_socket_disconnected")] public static extern void PeerManager_socket_disconnected(long _this_arg, long _descriptor); - // void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_disconnect_by_node_id")] public static extern void PeerManager_disconnect_by_node_id(long _this_arg, byte[] _node_id, bool _no_connection_possible); + // void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_disconnect_by_node_id")] public static extern void PeerManager_disconnect_by_node_id(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id); // void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_disconnect_all_peers")] public static extern void PeerManager_disconnect_all_peers(long _this_arg); // void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_timer_tick_occurred")] public static extern void PeerManager_timer_tick_occurred(long _this_arg); // void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_broadcast_node_announcement")] public static extern void PeerManager_broadcast_node_announcement(long _this_arg, byte[] _rgb, byte[] _alias, long[] _addresses); - // uint64_t htlc_success_tx_weight(bool opt_anchors); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_htlc_success_tx_weight")] public static extern long htlc_success_tx_weight(bool _opt_anchors); - // uint64_t htlc_timeout_tx_weight(bool opt_anchors); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_htlc_timeout_tx_weight")] public static extern long htlc_timeout_tx_weight(bool _opt_anchors); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_broadcast_node_announcement")] public static extern void PeerManager_broadcast_node_announcement(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _rgb, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _alias, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _addresses); + // uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_htlc_success_tx_weight")] public static extern long htlc_success_tx_weight(long _channel_type_features); + // uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_htlc_timeout_tx_weight")] public static extern long htlc_timeout_tx_weight(long _channel_type_features); // enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCClaim_clone")] public static extern HTLCClaim HTLCClaim_clone(long _orig); // enum LDKHTLCClaim HTLCClaim_offered_timeout(void); @@ -6082,11 +7425,11 @@ internal class bindings { // bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCClaim_eq")] public static extern bool HTLCClaim_eq(long _a, long _b); // MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCClaim_from_witness")] public static extern long HTLCClaim_from_witness(byte[] _witness); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCClaim_from_witness")] public static extern long HTLCClaim_from_witness([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _witness); // struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_commitment_secret")] public static extern byte[] build_commitment_secret(byte[] _commitment_seed, long _idx); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_commitment_secret")] public static extern byte[] build_commitment_secret([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _commitment_seed, long _idx); // struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_closing_transaction")] public static extern byte[] build_closing_transaction(long _to_holder_value_sat, long _to_counterparty_value_sat, byte[] _to_holder_script, byte[] _to_counterparty_script, long _funding_outpoint); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_closing_transaction")] public static extern byte[] build_closing_transaction(long _to_holder_value_sat, long _to_counterparty_value_sat, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _to_holder_script, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _to_counterparty_script, long _funding_outpoint); // void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_free")] public static extern void CounterpartyCommitmentSecrets_free(long _this_obj); // uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg); @@ -6098,45 +7441,45 @@ internal class bindings { // MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_get_min_seen_secret")] public static extern long CounterpartyCommitmentSecrets_get_min_seen_secret(long _this_arg); // MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_provide_secret")] public static extern long CounterpartyCommitmentSecrets_provide_secret(long _this_arg, long _idx, byte[] _secret); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_provide_secret")] public static extern long CounterpartyCommitmentSecrets_provide_secret(long _this_arg, long _idx, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _secret); // MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_get_secret")] public static extern byte[] CounterpartyCommitmentSecrets_get_secret(long _this_arg, long _idx); // struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_write")] public static extern byte[] CounterpartyCommitmentSecrets_write(long _obj); // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_read")] public static extern long CounterpartyCommitmentSecrets_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyCommitmentSecrets_read")] public static extern long CounterpartyCommitmentSecrets_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_private_key")] public static extern byte[] derive_private_key(byte[] _per_commitment_point, byte[] _base_secret); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_private_key")] public static extern byte[] derive_private_key([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _base_secret); // struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_public_key")] public static extern byte[] derive_public_key(byte[] _per_commitment_point, byte[] _base_point); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_public_key")] public static extern byte[] derive_public_key([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _base_point); // struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_private_revocation_key")] public static extern byte[] derive_private_revocation_key(byte[] _per_commitment_secret, byte[] _countersignatory_revocation_base_secret); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_private_revocation_key")] public static extern byte[] derive_private_revocation_key([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_secret, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _countersignatory_revocation_base_secret); // struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_public_revocation_key")] public static extern byte[] derive_public_revocation_key(byte[] _per_commitment_point, byte[] _countersignatory_revocation_base_point); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_derive_public_revocation_key")] public static extern byte[] derive_public_revocation_key([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _countersignatory_revocation_base_point); // void TxCreationKeys_free(struct LDKTxCreationKeys this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_free")] public static extern void TxCreationKeys_free(long _this_obj); // struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_get_per_commitment_point")] public static extern byte[] TxCreationKeys_get_per_commitment_point(long _this_ptr); // void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_per_commitment_point")] public static extern void TxCreationKeys_set_per_commitment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_per_commitment_point")] public static extern void TxCreationKeys_set_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_get_revocation_key")] public static extern byte[] TxCreationKeys_get_revocation_key(long _this_ptr); // void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_revocation_key")] public static extern void TxCreationKeys_set_revocation_key(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_revocation_key")] public static extern void TxCreationKeys_set_revocation_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_get_broadcaster_htlc_key")] public static extern byte[] TxCreationKeys_get_broadcaster_htlc_key(long _this_ptr); // void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_broadcaster_htlc_key")] public static extern void TxCreationKeys_set_broadcaster_htlc_key(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_broadcaster_htlc_key")] public static extern void TxCreationKeys_set_broadcaster_htlc_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_get_countersignatory_htlc_key")] public static extern byte[] TxCreationKeys_get_countersignatory_htlc_key(long _this_ptr); // void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_countersignatory_htlc_key")] public static extern void TxCreationKeys_set_countersignatory_htlc_key(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_countersignatory_htlc_key")] public static extern void TxCreationKeys_set_countersignatory_htlc_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_get_broadcaster_delayed_payment_key")] public static extern byte[] TxCreationKeys_get_broadcaster_delayed_payment_key(long _this_ptr); // void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_broadcaster_delayed_payment_key")] public static extern void TxCreationKeys_set_broadcaster_delayed_payment_key(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_set_broadcaster_delayed_payment_key")] public static extern void TxCreationKeys_set_broadcaster_delayed_payment_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_new")] public static extern long TxCreationKeys_new(byte[] _per_commitment_point_arg, byte[] _revocation_key_arg, byte[] _broadcaster_htlc_key_arg, byte[] _countersignatory_htlc_key_arg, byte[] _broadcaster_delayed_payment_key_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_new")] public static extern long TxCreationKeys_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_key_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster_htlc_key_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _countersignatory_htlc_key_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster_delayed_payment_key_arg); // bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_eq")] public static extern bool TxCreationKeys_eq(long _a, long _b); // uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg); @@ -6146,31 +7489,31 @@ internal class bindings { // struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_write")] public static extern byte[] TxCreationKeys_write(long _obj); // struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_read")] public static extern long TxCreationKeys_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_read")] public static extern long TxCreationKeys_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_free")] public static extern void ChannelPublicKeys_free(long _this_obj); // struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_get_funding_pubkey")] public static extern byte[] ChannelPublicKeys_get_funding_pubkey(long _this_ptr); // void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_funding_pubkey")] public static extern void ChannelPublicKeys_set_funding_pubkey(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_funding_pubkey")] public static extern void ChannelPublicKeys_set_funding_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_get_revocation_basepoint")] public static extern byte[] ChannelPublicKeys_get_revocation_basepoint(long _this_ptr); // void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_revocation_basepoint")] public static extern void ChannelPublicKeys_set_revocation_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_revocation_basepoint")] public static extern void ChannelPublicKeys_set_revocation_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_get_payment_point")] public static extern byte[] ChannelPublicKeys_get_payment_point(long _this_ptr); // void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_payment_point")] public static extern void ChannelPublicKeys_set_payment_point(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_payment_point")] public static extern void ChannelPublicKeys_set_payment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_get_delayed_payment_basepoint")] public static extern byte[] ChannelPublicKeys_get_delayed_payment_basepoint(long _this_ptr); // void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_delayed_payment_basepoint")] public static extern void ChannelPublicKeys_set_delayed_payment_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_delayed_payment_basepoint")] public static extern void ChannelPublicKeys_set_delayed_payment_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_get_htlc_basepoint")] public static extern byte[] ChannelPublicKeys_get_htlc_basepoint(long _this_ptr); // void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_htlc_basepoint")] public static extern void ChannelPublicKeys_set_htlc_basepoint(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_set_htlc_basepoint")] public static extern void ChannelPublicKeys_set_htlc_basepoint(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_new")] public static extern long ChannelPublicKeys_new(byte[] _funding_pubkey_arg, byte[] _revocation_basepoint_arg, byte[] _payment_point_arg, byte[] _delayed_payment_basepoint_arg, byte[] _htlc_basepoint_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_new")] public static extern long ChannelPublicKeys_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_pubkey_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_point_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _delayed_payment_basepoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_basepoint_arg); // uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_clone_ptr")] public static extern long ChannelPublicKeys_clone_ptr(long _arg); // struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); @@ -6180,13 +7523,13 @@ internal class bindings { // struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_write")] public static extern byte[] ChannelPublicKeys_write(long _obj); // struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_read")] public static extern long ChannelPublicKeys_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelPublicKeys_read")] public static extern long ChannelPublicKeys_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_derive_new")] public static extern long TxCreationKeys_derive_new(byte[] _per_commitment_point, byte[] _broadcaster_delayed_payment_base, byte[] _broadcaster_htlc_base, byte[] _countersignatory_revocation_base, byte[] _countersignatory_htlc_base); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_derive_new")] public static extern long TxCreationKeys_derive_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster_delayed_payment_base, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster_htlc_base, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _countersignatory_revocation_base, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _countersignatory_htlc_base); // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_from_channel_static_keys")] public static extern long TxCreationKeys_from_channel_static_keys(byte[] _per_commitment_point, long _broadcaster_keys, long _countersignatory_keys); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxCreationKeys_from_channel_static_keys")] public static extern long TxCreationKeys_from_channel_static_keys([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point, long _broadcaster_keys, long _countersignatory_keys); // struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_revokeable_redeemscript")] public static extern byte[] get_revokeable_redeemscript(byte[] _revocation_key, short _contest_delay, byte[] _broadcaster_delayed_payment_key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_revokeable_redeemscript")] public static extern byte[] get_revokeable_redeemscript([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_key, short _contest_delay, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster_delayed_payment_key); // void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_free")] public static extern void HTLCOutputInCommitment_free(long _this_obj); // bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); @@ -6204,13 +7547,13 @@ internal class bindings { // const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_get_payment_hash")] public static extern byte[] HTLCOutputInCommitment_get_payment_hash(long _this_ptr); // void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_set_payment_hash")] public static extern void HTLCOutputInCommitment_set_payment_hash(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_set_payment_hash")] public static extern void HTLCOutputInCommitment_set_payment_hash(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_get_transaction_output_index")] public static extern long HTLCOutputInCommitment_get_transaction_output_index(long _this_ptr); // void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_set_transaction_output_index")] public static extern void HTLCOutputInCommitment_set_transaction_output_index(long _this_ptr, long _val); // MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_new")] public static extern long HTLCOutputInCommitment_new(bool _offered_arg, long _amount_msat_arg, int _cltv_expiry_arg, byte[] _payment_hash_arg, long _transaction_output_index_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_new")] public static extern long HTLCOutputInCommitment_new(bool _offered_arg, long _amount_msat_arg, int _cltv_expiry_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash_arg, long _transaction_output_index_arg); // uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_clone_ptr")] public static extern long HTLCOutputInCommitment_clone_ptr(long _arg); // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); @@ -6220,21 +7563,21 @@ internal class bindings { // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_write")] public static extern byte[] HTLCOutputInCommitment_write(long _obj); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_read")] public static extern long HTLCOutputInCommitment_read(byte[] _ser); - // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_htlc_redeemscript")] public static extern byte[] get_htlc_redeemscript(long _htlc, bool _opt_anchors, long _keys); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCOutputInCommitment_read")] public static extern long HTLCOutputInCommitment_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKTxCreationKeys *NONNULL_PTR keys); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_htlc_redeemscript")] public static extern byte[] get_htlc_redeemscript(long _htlc, long _channel_type_features, long _keys); // struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_make_funding_redeemscript")] public static extern byte[] make_funding_redeemscript(byte[] _broadcaster, byte[] _countersignatory); - // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, bool use_non_zero_fee_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_htlc_transaction")] public static extern byte[] build_htlc_transaction(byte[] _commitment_txid, int _feerate_per_kw, short _contest_delay, long _htlc, bool _opt_anchors, bool _use_non_zero_fee_anchors, byte[] _broadcaster_delayed_payment_key, byte[] _revocation_key); - // struct LDKWitness build_htlc_input_witness(struct LDKSignature local_sig, struct LDKSignature remote_sig, struct LDKThirtyTwoBytes preimage, struct LDKu8slice redeem_script, bool opt_anchors); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_htlc_input_witness")] public static extern byte[] build_htlc_input_witness(byte[] _local_sig, byte[] _remote_sig, byte[] _preimage, byte[] _redeem_script, bool _opt_anchors); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_make_funding_redeemscript")] public static extern byte[] make_funding_redeemscript([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _countersignatory); + // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_htlc_transaction")] public static extern byte[] build_htlc_transaction([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _commitment_txid, int _feerate_per_kw, short _contest_delay, long _htlc, long _channel_type_features, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster_delayed_payment_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_key); + // struct LDKWitness build_htlc_input_witness(struct LDKSignature local_sig, struct LDKSignature remote_sig, struct LDKCOption_PaymentPreimageZ preimage, struct LDKu8slice redeem_script, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_htlc_input_witness")] public static extern byte[] build_htlc_input_witness([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _local_sig, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _remote_sig, long _preimage, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _redeem_script, long _channel_type_features); // struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_to_countersignatory_with_anchors_redeemscript")] public static extern byte[] get_to_countersignatory_with_anchors_redeemscript(byte[] _payment_point); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_to_countersignatory_with_anchors_redeemscript")] public static extern byte[] get_to_countersignatory_with_anchors_redeemscript([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_point); // struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_anchor_redeemscript")] public static extern byte[] get_anchor_redeemscript(byte[] _funding_pubkey); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_anchor_redeemscript")] public static extern byte[] get_anchor_redeemscript([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_pubkey); // struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKSignature funding_sig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_anchor_input_witness")] public static extern byte[] build_anchor_input_witness(byte[] _funding_key, byte[] _funding_sig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_anchor_input_witness")] public static extern byte[] build_anchor_input_witness([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_sig); // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_free")] public static extern void ChannelTransactionParameters_free(long _this_obj); // struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); @@ -6257,20 +7600,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_get_funding_outpoint")] public static extern long ChannelTransactionParameters_get_funding_outpoint(long _this_ptr); // void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_set_funding_outpoint")] public static extern void ChannelTransactionParameters_set_funding_outpoint(long _this_ptr, long _val); - // enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_get_opt_anchors")] public static extern COption_NoneZ ChannelTransactionParameters_get_opt_anchors(long _this_ptr); - // void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_set_opt_anchors")] public static extern void ChannelTransactionParameters_set_opt_anchors(long _this_ptr, COption_NoneZ _val); - // enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_non_zero_fee_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_get_opt_non_zero_fee_anchors")] public static extern COption_NoneZ ChannelTransactionParameters_get_opt_non_zero_fee_anchors(long _this_ptr); - // void ChannelTransactionParameters_set_opt_non_zero_fee_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_set_opt_non_zero_fee_anchors")] public static extern void ChannelTransactionParameters_set_opt_non_zero_fee_anchors(long _this_ptr, COption_NoneZ _val); - // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, enum LDKCOption_NoneZ opt_anchors_arg, enum LDKCOption_NoneZ opt_non_zero_fee_anchors_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_new")] public static extern long ChannelTransactionParameters_new(long _holder_pubkeys_arg, short _holder_selected_contest_delay_arg, bool _is_outbound_from_holder_arg, long _counterparty_parameters_arg, long _funding_outpoint_arg, COption_NoneZ _opt_anchors_arg, COption_NoneZ _opt_non_zero_fee_anchors_arg); + // struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_get_channel_type_features")] public static extern long ChannelTransactionParameters_get_channel_type_features(long _this_ptr); + // void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_set_channel_type_features")] public static extern void ChannelTransactionParameters_set_channel_type_features(long _this_ptr, long _val); + // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, struct LDKChannelTypeFeatures channel_type_features_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_new")] public static extern long ChannelTransactionParameters_new(long _holder_pubkeys_arg, short _holder_selected_contest_delay_arg, bool _is_outbound_from_holder_arg, long _counterparty_parameters_arg, long _funding_outpoint_arg, long _channel_type_features_arg); // uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_clone_ptr")] public static extern long ChannelTransactionParameters_clone_ptr(long _arg); // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_clone")] public static extern long ChannelTransactionParameters_clone(long _orig); + // bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_eq")] public static extern bool ChannelTransactionParameters_eq(long _a, long _b); // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyChannelTransactionParameters_free")] public static extern void CounterpartyChannelTransactionParameters_free(long _this_obj); // struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); @@ -6287,6 +7628,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyChannelTransactionParameters_clone_ptr")] public static extern long CounterpartyChannelTransactionParameters_clone_ptr(long _arg); // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyChannelTransactionParameters_clone")] public static extern long CounterpartyChannelTransactionParameters_clone(long _orig); + // bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyChannelTransactionParameters_eq")] public static extern bool CounterpartyChannelTransactionParameters_eq(long _a, long _b); // MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_is_populated")] public static extern bool ChannelTransactionParameters_is_populated(long _this_arg); // MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); @@ -6296,11 +7639,11 @@ internal class bindings { // struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyChannelTransactionParameters_write")] public static extern byte[] CounterpartyChannelTransactionParameters_write(long _obj); // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyChannelTransactionParameters_read")] public static extern long CounterpartyChannelTransactionParameters_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CounterpartyChannelTransactionParameters_read")] public static extern long CounterpartyChannelTransactionParameters_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_write")] public static extern byte[] ChannelTransactionParameters_write(long _obj); // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_read")] public static extern long ChannelTransactionParameters_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTransactionParameters_read")] public static extern long ChannelTransactionParameters_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelTransactionParameters_free")] public static extern void DirectedChannelTransactionParameters_free(long _this_obj); // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); @@ -6313,18 +7656,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelTransactionParameters_is_outbound")] public static extern bool DirectedChannelTransactionParameters_is_outbound(long _this_arg); // MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelTransactionParameters_funding_outpoint")] public static extern long DirectedChannelTransactionParameters_funding_outpoint(long _this_arg); - // MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelTransactionParameters_opt_anchors")] public static extern bool DirectedChannelTransactionParameters_opt_anchors(long _this_arg); + // MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelTransactionParameters_channel_type_features")] public static extern long DirectedChannelTransactionParameters_channel_type_features(long _this_arg); // void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_free")] public static extern void HolderCommitmentTransaction_free(long _this_obj); // struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_get_counterparty_sig")] public static extern byte[] HolderCommitmentTransaction_get_counterparty_sig(long _this_ptr); // void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_set_counterparty_sig")] public static extern void HolderCommitmentTransaction_set_counterparty_sig(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_set_counterparty_sig")] public static extern void HolderCommitmentTransaction_set_counterparty_sig(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_get_counterparty_htlc_sigs")] public static extern byte[][] HolderCommitmentTransaction_get_counterparty_htlc_sigs(long _this_ptr); // void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_set_counterparty_htlc_sigs")] public static extern void HolderCommitmentTransaction_set_counterparty_htlc_sigs(long _this_ptr, byte[][] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_set_counterparty_htlc_sigs")] public static extern void HolderCommitmentTransaction_set_counterparty_htlc_sigs(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _val); // uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_clone_ptr")] public static extern long HolderCommitmentTransaction_clone_ptr(long _arg); // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); @@ -6332,21 +7675,21 @@ internal class bindings { // struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_write")] public static extern byte[] HolderCommitmentTransaction_write(long _obj); // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_read")] public static extern long HolderCommitmentTransaction_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_read")] public static extern long HolderCommitmentTransaction_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_new")] public static extern long HolderCommitmentTransaction_new(long _commitment_tx, byte[] _counterparty_sig, byte[][] _counterparty_htlc_sigs, byte[] _holder_funding_key, byte[] _counterparty_funding_key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HolderCommitmentTransaction_new")] public static extern long HolderCommitmentTransaction_new(long _commitment_tx, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_sig, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _counterparty_htlc_sigs, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _holder_funding_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_funding_key); // void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_free")] public static extern void BuiltCommitmentTransaction_free(long _this_obj); // struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_get_transaction")] public static extern byte[] BuiltCommitmentTransaction_get_transaction(long _this_ptr); // void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_set_transaction")] public static extern void BuiltCommitmentTransaction_set_transaction(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_set_transaction")] public static extern void BuiltCommitmentTransaction_set_transaction(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_get_txid")] public static extern byte[] BuiltCommitmentTransaction_get_txid(long _this_ptr); // void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_set_txid")] public static extern void BuiltCommitmentTransaction_set_txid(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_set_txid")] public static extern void BuiltCommitmentTransaction_set_txid(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_new")] public static extern long BuiltCommitmentTransaction_new(byte[] _transaction_arg, byte[] _txid_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_new")] public static extern long BuiltCommitmentTransaction_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _transaction_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _txid_arg); // uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_clone_ptr")] public static extern long BuiltCommitmentTransaction_clone_ptr(long _arg); // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); @@ -6354,11 +7697,13 @@ internal class bindings { // struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_write")] public static extern byte[] BuiltCommitmentTransaction_write(long _obj); // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_read")] public static extern long BuiltCommitmentTransaction_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_read")] public static extern long BuiltCommitmentTransaction_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_get_sighash_all")] public static extern byte[] BuiltCommitmentTransaction_get_sighash_all(long _this_arg, byte[] _funding_redeemscript, long _channel_value_satoshis); - // MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_sign")] public static extern byte[] BuiltCommitmentTransaction_sign(long _this_arg, byte[] _funding_key, byte[] _funding_redeemscript, long _channel_value_satoshis); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_get_sighash_all")] public static extern byte[] BuiltCommitmentTransaction_get_sighash_all(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_redeemscript, long _channel_value_satoshis); + // MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign_counterparty_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_sign_counterparty_commitment")] public static extern byte[] BuiltCommitmentTransaction_sign_counterparty_commitment(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_redeemscript, long _channel_value_satoshis); + // MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign_holder_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis, const struct LDKEntropySource *NONNULL_PTR entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BuiltCommitmentTransaction_sign_holder_commitment")] public static extern byte[] BuiltCommitmentTransaction_sign_holder_commitment(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_redeemscript, long _channel_value_satoshis, long _entropy_source); // void ClosingTransaction_free(struct LDKClosingTransaction this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingTransaction_free")] public static extern void ClosingTransaction_free(long _this_obj); // uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg); @@ -6370,7 +7715,7 @@ internal class bindings { // bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingTransaction_eq")] public static extern bool ClosingTransaction_eq(long _a, long _b); // MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingTransaction_new")] public static extern long ClosingTransaction_new(long _to_holder_value_sat, long _to_counterparty_value_sat, byte[] _to_holder_script, byte[] _to_counterparty_script, long _funding_outpoint); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingTransaction_new")] public static extern long ClosingTransaction_new(long _to_holder_value_sat, long _to_counterparty_value_sat, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _to_holder_script, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _to_counterparty_script, long _funding_outpoint); // MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingTransaction_trust")] public static extern long ClosingTransaction_trust(long _this_arg); // MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint); @@ -6388,9 +7733,9 @@ internal class bindings { // MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedClosingTransaction_built_transaction")] public static extern byte[] TrustedClosingTransaction_built_transaction(long _this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes TrustedClosingTransaction_get_sighash_all(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedClosingTransaction_get_sighash_all")] public static extern byte[] TrustedClosingTransaction_get_sighash_all(long _this_arg, byte[] _funding_redeemscript, long _channel_value_satoshis); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedClosingTransaction_get_sighash_all")] public static extern byte[] TrustedClosingTransaction_get_sighash_all(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_redeemscript, long _channel_value_satoshis); // MUST_USE_RES struct LDKSignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedClosingTransaction_sign")] public static extern byte[] TrustedClosingTransaction_sign(long _this_arg, byte[] _funding_key, byte[] _funding_redeemscript, long _channel_value_satoshis); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedClosingTransaction_sign")] public static extern byte[] TrustedClosingTransaction_sign(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_redeemscript, long _channel_value_satoshis); // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentTransaction_free")] public static extern void CommitmentTransaction_free(long _this_obj); // uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg); @@ -6400,7 +7745,7 @@ internal class bindings { // struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentTransaction_write")] public static extern byte[] CommitmentTransaction_write(long _obj); // struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentTransaction_read")] public static extern long CommitmentTransaction_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentTransaction_read")] public static extern long CommitmentTransaction_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentTransaction_commitment_number")] public static extern long CommitmentTransaction_commitment_number(long _this_arg); // MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); @@ -6421,24 +7766,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedCommitmentTransaction_built_transaction")] public static extern long TrustedCommitmentTransaction_built_transaction(long _this_arg); // MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedCommitmentTransaction_keys")] public static extern long TrustedCommitmentTransaction_keys(long _this_arg); - // MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedCommitmentTransaction_opt_anchors")] public static extern bool TrustedCommitmentTransaction_opt_anchors(long _this_arg); - // MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedCommitmentTransaction_get_htlc_sigs")] public static extern long TrustedCommitmentTransaction_get_htlc_sigs(long _this_arg, byte[] _htlc_base_key, long _channel_parameters); + // MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedCommitmentTransaction_channel_type_features")] public static extern long TrustedCommitmentTransaction_channel_type_features(long _this_arg); + // MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKEntropySource *NONNULL_PTR entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrustedCommitmentTransaction_get_htlc_sigs")] public static extern long TrustedCommitmentTransaction_get_htlc_sigs(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_base_key, long _channel_parameters, long _entropy_source); // uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_commitment_transaction_number_obscure_factor")] public static extern long get_commitment_transaction_number_obscure_factor(byte[] _broadcaster_payment_basepoint, byte[] _countersignatory_payment_basepoint, bool _outbound_from_broadcaster); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_get_commitment_transaction_number_obscure_factor")] public static extern long get_commitment_transaction_number_obscure_factor([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _broadcaster_payment_basepoint, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _countersignatory_payment_basepoint, bool _outbound_from_broadcaster); // bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_eq")] public static extern bool InitFeatures_eq(long _a, long _b); // bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_eq")] public static extern bool NodeFeatures_eq(long _a, long _b); // bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_eq")] public static extern bool ChannelFeatures_eq(long _a, long _b); - // bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_eq")] public static extern bool InvoiceFeatures_eq(long _a, long _b); + // bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_eq")] public static extern bool Bolt11InvoiceFeatures_eq(long _a, long _b); // bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_eq")] public static extern bool OfferFeatures_eq(long _a, long _b); // bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_eq")] public static extern bool InvoiceRequestFeatures_eq(long _a, long _b); + // bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_eq")] public static extern bool Bolt12InvoiceFeatures_eq(long _a, long _b); + // bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_eq")] public static extern bool BlindedHopFeatures_eq(long _a, long _b); // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_eq")] public static extern bool ChannelTypeFeatures_eq(long _a, long _b); // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); @@ -6453,10 +7802,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_clone_ptr")] public static extern long ChannelFeatures_clone_ptr(long _arg); // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_clone")] public static extern long ChannelFeatures_clone(long _orig); - // uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_clone_ptr")] public static extern long InvoiceFeatures_clone_ptr(long _arg); - // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_clone")] public static extern long InvoiceFeatures_clone(long _orig); + // uint64_t Bolt11InvoiceFeatures_clone_ptr(LDKBolt11InvoiceFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_clone_ptr")] public static extern long Bolt11InvoiceFeatures_clone_ptr(long _arg); + // struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_clone")] public static extern long Bolt11InvoiceFeatures_clone(long _orig); // uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_clone_ptr")] public static extern long OfferFeatures_clone_ptr(long _arg); // struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig); @@ -6465,6 +7814,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_clone_ptr")] public static extern long InvoiceRequestFeatures_clone_ptr(long _arg); // struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_clone")] public static extern long InvoiceRequestFeatures_clone(long _orig); + // uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_clone_ptr")] public static extern long Bolt12InvoiceFeatures_clone_ptr(long _arg); + // struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_clone")] public static extern long Bolt12InvoiceFeatures_clone(long _orig); + // uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_clone_ptr")] public static extern long BlindedHopFeatures_clone_ptr(long _arg); + // struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_clone")] public static extern long BlindedHopFeatures_clone(long _orig); // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clone_ptr")] public static extern long ChannelTypeFeatures_clone_ptr(long _arg); // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig); @@ -6475,70 +7832,136 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_free")] public static extern void NodeFeatures_free(long _this_obj); // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_free")] public static extern void ChannelFeatures_free(long _this_obj); - // void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_free")] public static extern void InvoiceFeatures_free(long _this_obj); + // void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_free")] public static extern void Bolt11InvoiceFeatures_free(long _this_obj); // void OfferFeatures_free(struct LDKOfferFeatures this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_free")] public static extern void OfferFeatures_free(long _this_obj); // void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_free")] public static extern void InvoiceRequestFeatures_free(long _this_obj); + // void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_free")] public static extern void Bolt12InvoiceFeatures_free(long _this_obj); + // void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_free")] public static extern void BlindedHopFeatures_free(long _this_obj); // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_free")] public static extern void ChannelTypeFeatures_free(long _this_obj); // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_empty")] public static extern long InitFeatures_empty(); + // MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_unknown_bits_from")] public static extern bool InitFeatures_requires_unknown_bits_from(long _this_arg, long _other); // MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_unknown_bits")] public static extern bool InitFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_required_custom_bit")] public static extern long InitFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_optional_custom_bit")] public static extern long InitFeatures_set_optional_custom_bit(long _this_arg, long _bit); // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_empty")] public static extern long NodeFeatures_empty(); + // MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_unknown_bits_from")] public static extern bool NodeFeatures_requires_unknown_bits_from(long _this_arg, long _other); // MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_unknown_bits")] public static extern bool NodeFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_required_custom_bit")] public static extern long NodeFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_optional_custom_bit")] public static extern long NodeFeatures_set_optional_custom_bit(long _this_arg, long _bit); // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_empty")] public static extern long ChannelFeatures_empty(); + // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_requires_unknown_bits_from")] public static extern bool ChannelFeatures_requires_unknown_bits_from(long _this_arg, long _other); // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_requires_unknown_bits")] public static extern bool ChannelFeatures_requires_unknown_bits(long _this_arg); - // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_empty")] public static extern long InvoiceFeatures_empty(); - // MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_requires_unknown_bits")] public static extern bool InvoiceFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_required_custom_bit")] public static extern long ChannelFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_set_optional_custom_bit")] public static extern long ChannelFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_empty")] public static extern long Bolt11InvoiceFeatures_empty(); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits_from")] public static extern bool Bolt11InvoiceFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_unknown_bits")] public static extern bool Bolt11InvoiceFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_required_custom_bit")] public static extern long Bolt11InvoiceFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_optional_custom_bit")] public static extern long Bolt11InvoiceFeatures_set_optional_custom_bit(long _this_arg, long _bit); // MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_empty")] public static extern long OfferFeatures_empty(); + // MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_requires_unknown_bits_from")] public static extern bool OfferFeatures_requires_unknown_bits_from(long _this_arg, long _other); // MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_requires_unknown_bits")] public static extern bool OfferFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_required_custom_bit")] public static extern long OfferFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_set_optional_custom_bit")] public static extern long OfferFeatures_set_optional_custom_bit(long _this_arg, long _bit); // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_empty")] public static extern long InvoiceRequestFeatures_empty(); + // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_requires_unknown_bits_from")] public static extern bool InvoiceRequestFeatures_requires_unknown_bits_from(long _this_arg, long _other); // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_requires_unknown_bits")] public static extern bool InvoiceRequestFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_required_custom_bit")] public static extern long InvoiceRequestFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_set_optional_custom_bit")] public static extern long InvoiceRequestFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_empty")] public static extern long Bolt12InvoiceFeatures_empty(); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits_from")] public static extern bool Bolt12InvoiceFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_unknown_bits")] public static extern bool Bolt12InvoiceFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_required_custom_bit")] public static extern long Bolt12InvoiceFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_optional_custom_bit")] public static extern long Bolt12InvoiceFeatures_set_optional_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_empty")] public static extern long BlindedHopFeatures_empty(); + // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_requires_unknown_bits_from")] public static extern bool BlindedHopFeatures_requires_unknown_bits_from(long _this_arg, long _other); + // MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_requires_unknown_bits")] public static extern bool BlindedHopFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_required_custom_bit")] public static extern long BlindedHopFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_set_optional_custom_bit")] public static extern long BlindedHopFeatures_set_optional_custom_bit(long _this_arg, long _bit); // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_empty")] public static extern long ChannelTypeFeatures_empty(); + // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_unknown_bits_from")] public static extern bool ChannelTypeFeatures_requires_unknown_bits_from(long _this_arg, long _other); // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_unknown_bits")] public static extern bool ChannelTypeFeatures_requires_unknown_bits(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_required_custom_bit")] public static extern long ChannelTypeFeatures_set_required_custom_bit(long _this_arg, long _bit); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_optional_custom_bit")] public static extern long ChannelTypeFeatures_set_optional_custom_bit(long _this_arg, long _bit); // struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_write")] public static extern byte[] InitFeatures_write(long _obj); // struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_read")] public static extern long InitFeatures_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_read")] public static extern long InitFeatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_write")] public static extern byte[] ChannelFeatures_write(long _obj); // struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_read")] public static extern long ChannelFeatures_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelFeatures_read")] public static extern long ChannelFeatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_write")] public static extern byte[] NodeFeatures_write(long _obj); // struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_read")] public static extern long NodeFeatures_read(byte[] _ser); - // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_write")] public static extern byte[] InvoiceFeatures_write(long _obj); - // struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_read")] public static extern long InvoiceFeatures_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_read")] public static extern long NodeFeatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_write")] public static extern byte[] Bolt11InvoiceFeatures_write(long _obj); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_read")] public static extern long Bolt11InvoiceFeatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_write")] public static extern byte[] Bolt12InvoiceFeatures_write(long _obj); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_read")] public static extern long Bolt12InvoiceFeatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_write")] public static extern byte[] BlindedHopFeatures_write(long _obj); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHopFeatures_read")] public static extern long BlindedHopFeatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_write")] public static extern byte[] ChannelTypeFeatures_write(long _obj); // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_read")] public static extern long ChannelTypeFeatures_read(byte[] _ser); - // struct LDKCVec_u8Z OfferFeatures_write(const struct LDKOfferFeatures *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_write")] public static extern byte[] OfferFeatures_write(long _obj); - // struct LDKCResult_OfferFeaturesDecodeErrorZ OfferFeatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferFeatures_read")] public static extern long OfferFeatures_read(byte[] _ser); - // struct LDKCVec_u8Z InvoiceRequestFeatures_write(const struct LDKInvoiceRequestFeatures *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_write")] public static extern byte[] InvoiceRequestFeatures_write(long _obj); - // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ InvoiceRequestFeatures_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFeatures_read")] public static extern long InvoiceRequestFeatures_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_read")] public static extern long ChannelTypeFeatures_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_data_loss_protect_optional")] public static extern void InitFeatures_set_data_loss_protect_optional(long _this_arg); // void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg); @@ -6605,18 +8028,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_variable_length_onion_required")] public static extern void NodeFeatures_set_variable_length_onion_required(long _this_arg); // MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_variable_length_onion")] public static extern bool NodeFeatures_supports_variable_length_onion(long _this_arg); - // void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_set_variable_length_onion_optional")] public static extern void InvoiceFeatures_set_variable_length_onion_optional(long _this_arg); - // void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_set_variable_length_onion_required")] public static extern void InvoiceFeatures_set_variable_length_onion_required(long _this_arg); - // MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_supports_variable_length_onion")] public static extern bool InvoiceFeatures_supports_variable_length_onion(long _this_arg); + // void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_optional")] public static extern void Bolt11InvoiceFeatures_set_variable_length_onion_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_variable_length_onion_required")] public static extern void Bolt11InvoiceFeatures_set_variable_length_onion_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_variable_length_onion")] public static extern bool Bolt11InvoiceFeatures_supports_variable_length_onion(long _this_arg); // MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_variable_length_onion")] public static extern bool InitFeatures_requires_variable_length_onion(long _this_arg); // MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_variable_length_onion")] public static extern bool NodeFeatures_requires_variable_length_onion(long _this_arg); - // MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_requires_variable_length_onion")] public static extern bool InvoiceFeatures_requires_variable_length_onion(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_variable_length_onion")] public static extern bool Bolt11InvoiceFeatures_requires_variable_length_onion(long _this_arg); // void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_static_remote_key_optional")] public static extern void InitFeatures_set_static_remote_key_optional(long _this_arg); // void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg); @@ -6653,18 +8076,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_payment_secret_required")] public static extern void NodeFeatures_set_payment_secret_required(long _this_arg); // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_payment_secret")] public static extern bool NodeFeatures_supports_payment_secret(long _this_arg); - // void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_set_payment_secret_optional")] public static extern void InvoiceFeatures_set_payment_secret_optional(long _this_arg); - // void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_set_payment_secret_required")] public static extern void InvoiceFeatures_set_payment_secret_required(long _this_arg); - // MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_supports_payment_secret")] public static extern bool InvoiceFeatures_supports_payment_secret(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_optional")] public static extern void Bolt11InvoiceFeatures_set_payment_secret_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_secret_required")] public static extern void Bolt11InvoiceFeatures_set_payment_secret_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_payment_secret")] public static extern bool Bolt11InvoiceFeatures_supports_payment_secret(long _this_arg); // MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_payment_secret")] public static extern bool InitFeatures_requires_payment_secret(long _this_arg); // MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_payment_secret")] public static extern bool NodeFeatures_requires_payment_secret(long _this_arg); - // MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_requires_payment_secret")] public static extern bool InvoiceFeatures_requires_payment_secret(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_payment_secret")] public static extern bool Bolt11InvoiceFeatures_requires_payment_secret(long _this_arg); // void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_basic_mpp_optional")] public static extern void InitFeatures_set_basic_mpp_optional(long _this_arg); // void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg); @@ -6677,18 +8100,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_basic_mpp_required")] public static extern void NodeFeatures_set_basic_mpp_required(long _this_arg); // MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_basic_mpp")] public static extern bool NodeFeatures_supports_basic_mpp(long _this_arg); - // void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_set_basic_mpp_optional")] public static extern void InvoiceFeatures_set_basic_mpp_optional(long _this_arg); - // void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_set_basic_mpp_required")] public static extern void InvoiceFeatures_set_basic_mpp_required(long _this_arg); - // MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_supports_basic_mpp")] public static extern bool InvoiceFeatures_supports_basic_mpp(long _this_arg); + // void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_optional")] public static extern void Bolt11InvoiceFeatures_set_basic_mpp_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_basic_mpp_required")] public static extern void Bolt11InvoiceFeatures_set_basic_mpp_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_basic_mpp")] public static extern bool Bolt11InvoiceFeatures_supports_basic_mpp(long _this_arg); + // void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_optional")] public static extern void Bolt12InvoiceFeatures_set_basic_mpp_optional(long _this_arg); + // void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_set_basic_mpp_required")] public static extern void Bolt12InvoiceFeatures_set_basic_mpp_required(long _this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_supports_basic_mpp")] public static extern bool Bolt12InvoiceFeatures_supports_basic_mpp(long _this_arg); // MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_basic_mpp")] public static extern bool InitFeatures_requires_basic_mpp(long _this_arg); // MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_basic_mpp")] public static extern bool NodeFeatures_requires_basic_mpp(long _this_arg); - // MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceFeatures_requires_basic_mpp")] public static extern bool InvoiceFeatures_requires_basic_mpp(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_basic_mpp")] public static extern bool Bolt11InvoiceFeatures_requires_basic_mpp(long _this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12InvoiceFeatures_requires_basic_mpp")] public static extern bool Bolt12InvoiceFeatures_requires_basic_mpp(long _this_arg); // void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_wumbo_optional")] public static extern void InitFeatures_set_wumbo_optional(long _this_arg); // void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg); @@ -6705,6 +8136,54 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_wumbo")] public static extern bool InitFeatures_requires_wumbo(long _this_arg); // MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_wumbo")] public static extern bool NodeFeatures_requires_wumbo(long _this_arg); + // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); + // void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); + // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); + // void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); + // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional")] public static extern void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(long _this_arg); + // void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required")] public static extern void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(long _this_arg); + // void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); + // void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void InitFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool InitFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); + // void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); + // void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); + // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional")] public static extern void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(long _this_arg); + // void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required")] public static extern void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool InitFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx")] public static extern bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(long _this_arg); // void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_shutdown_any_segwit_optional")] public static extern void InitFeatures_set_shutdown_any_segwit_optional(long _this_arg); // void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg); @@ -6777,6 +8256,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_scid_privacy")] public static extern bool NodeFeatures_requires_scid_privacy(long _this_arg); // MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_scid_privacy")] public static extern bool ChannelTypeFeatures_requires_scid_privacy(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_optional")] public static extern void Bolt11InvoiceFeatures_set_payment_metadata_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_payment_metadata_required")] public static extern void Bolt11InvoiceFeatures_set_payment_metadata_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_payment_metadata")] public static extern bool Bolt11InvoiceFeatures_supports_payment_metadata(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_payment_metadata")] public static extern bool Bolt11InvoiceFeatures_requires_payment_metadata(long _this_arg); // void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_zero_conf_optional")] public static extern void InitFeatures_set_zero_conf_optional(long _this_arg); // void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg); @@ -6822,9 +8309,9 @@ internal class bindings { // struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvalidShutdownScript_get_script")] public static extern byte[] InvalidShutdownScript_get_script(long _this_ptr); // void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvalidShutdownScript_set_script")] public static extern void InvalidShutdownScript_set_script(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvalidShutdownScript_set_script")] public static extern void InvalidShutdownScript_set_script(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvalidShutdownScript_new")] public static extern long InvalidShutdownScript_new(byte[] _script_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvalidShutdownScript_new")] public static extern long InvalidShutdownScript_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _script_arg); // uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvalidShutdownScript_clone_ptr")] public static extern long InvalidShutdownScript_clone_ptr(long _arg); // struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig); @@ -6832,19 +8319,85 @@ internal class bindings { // struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_write")] public static extern byte[] ShutdownScript_write(long _obj); // struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_read")] public static extern long ShutdownScript_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_read")] public static extern long ShutdownScript_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_new_p2wpkh")] public static extern long ShutdownScript_new_p2wpkh(byte[] _pubkey_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_new_p2wpkh")] public static extern long ShutdownScript_new_p2wpkh([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _pubkey_hash); // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_new_p2wsh")] public static extern long ShutdownScript_new_p2wsh(byte[] _script_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_new_p2wsh")] public static extern long ShutdownScript_new_p2wsh([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _script_hash); // MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_new_witness_program")] public static extern long ShutdownScript_new_witness_program(byte _version, byte[] _program); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_new_witness_program")] public static extern long ShutdownScript_new_witness_program(byte _version, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _program); // MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_into_inner")] public static extern byte[] ShutdownScript_into_inner(long _this_arg); // MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_as_legacy_pubkey")] public static extern byte[] ShutdownScript_as_legacy_pubkey(long _this_arg); // MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_is_compatible")] public static extern bool ShutdownScript_is_compatible(long _this_arg, long _features); + // void Retry_free(struct LDKRetry this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_free")] public static extern void Retry_free(long _this_ptr); + // uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_clone_ptr")] public static extern long Retry_clone_ptr(long _arg); + // struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_clone")] public static extern long Retry_clone(long _orig); + // struct LDKRetry Retry_attempts(uintptr_t a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_attempts")] public static extern long Retry_attempts(long _a); + // struct LDKRetry Retry_timeout(uint64_t a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_timeout")] public static extern long Retry_timeout(long _a); + // bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_eq")] public static extern bool Retry_eq(long _a, long _b); + // uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_hash")] public static extern long Retry_hash(long _o); + // enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_clone")] public static extern RetryableSendFailure RetryableSendFailure_clone(long _orig); + // enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_payment_expired")] public static extern RetryableSendFailure RetryableSendFailure_payment_expired(); + // enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_route_not_found")] public static extern RetryableSendFailure RetryableSendFailure_route_not_found(); + // enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_duplicate_payment")] public static extern RetryableSendFailure RetryableSendFailure_duplicate_payment(); + // bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RetryableSendFailure_eq")] public static extern bool RetryableSendFailure_eq(long _a, long _b); + // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_free")] public static extern void PaymentSendFailure_free(long _this_ptr); + // uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_clone_ptr")] public static extern long PaymentSendFailure_clone_ptr(long _arg); + // struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_clone")] public static extern long PaymentSendFailure_clone(long _orig); + // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_parameter_error")] public static extern long PaymentSendFailure_parameter_error(long _a); + // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_path_parameter_error")] public static extern long PaymentSendFailure_path_parameter_error([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _a); + // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_all_failed_resend_safe")] public static extern long PaymentSendFailure_all_failed_resend_safe([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _a); + // struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_duplicate_payment")] public static extern long PaymentSendFailure_duplicate_payment(); + // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentSendFailure_partial_failure")] public static extern long PaymentSendFailure_partial_failure([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _results, long _failed_paths_retry, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id); + // void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_free")] public static extern void RecipientOnionFields_free(long _this_obj); + // struct LDKCOption_PaymentSecretZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_get_payment_secret")] public static extern long RecipientOnionFields_get_payment_secret(long _this_ptr); + // void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_PaymentSecretZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_set_payment_secret")] public static extern void RecipientOnionFields_set_payment_secret(long _this_ptr, long _val); + // struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_get_payment_metadata")] public static extern long RecipientOnionFields_get_payment_metadata(long _this_ptr); + // void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_set_payment_metadata")] public static extern void RecipientOnionFields_set_payment_metadata(long _this_ptr, long _val); + // MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_new(struct LDKCOption_PaymentSecretZ payment_secret_arg, struct LDKCOption_CVec_u8ZZ payment_metadata_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_new")] public static extern long RecipientOnionFields_new(long _payment_secret_arg, long _payment_metadata_arg); + // uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_clone_ptr")] public static extern long RecipientOnionFields_clone_ptr(long _arg); + // struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_clone")] public static extern long RecipientOnionFields_clone(long _orig); + // bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_eq")] public static extern bool RecipientOnionFields_eq(long _a, long _b); + // struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_write")] public static extern byte[] RecipientOnionFields_write(long _obj); + // struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_read")] public static extern long RecipientOnionFields_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_secret_only")] public static extern long RecipientOnionFields_secret_only([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_secret); + // MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RecipientOnionFields_spontaneous_empty")] public static extern long RecipientOnionFields_spontaneous_empty(); // void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomMessageReader_free")] public static extern void CustomMessageReader_free(long _this_ptr); // uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg); @@ -6853,6 +8406,314 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_clone")] public static extern long Type_clone(long _orig); // void Type_free(struct LDKType this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_free")] public static extern void Type_free(long _this_ptr); + // void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_free")] public static extern void UnsignedBolt12Invoice_free(long _this_obj); + // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_signing_pubkey")] public static extern byte[] UnsignedBolt12Invoice_signing_pubkey(long _this_arg); + // void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_free")] public static extern void Bolt12Invoice_free(long _this_obj); + // uint64_t Bolt12Invoice_clone_ptr(LDKBolt12Invoice *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_clone_ptr")] public static extern long Bolt12Invoice_clone_ptr(long _arg); + // struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_clone")] public static extern long Bolt12Invoice_clone(long _orig); + // MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_description")] public static extern long Bolt12Invoice_description(long _this_arg); + // MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_created_at")] public static extern long Bolt12Invoice_created_at(long _this_arg); + // MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_relative_expiry")] public static extern long Bolt12Invoice_relative_expiry(long _this_arg); + // MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_is_expired")] public static extern bool Bolt12Invoice_is_expired(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_payment_hash")] public static extern byte[] Bolt12Invoice_payment_hash(long _this_arg); + // MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_amount_msats")] public static extern long Bolt12Invoice_amount_msats(long _this_arg); + // MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_features")] public static extern long Bolt12Invoice_features(long _this_arg); + // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_signing_pubkey")] public static extern byte[] Bolt12Invoice_signing_pubkey(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_signable_hash")] public static extern byte[] Bolt12Invoice_signable_hash(long _this_arg); + // MUST_USE_RES bool Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_verify")] public static extern bool Bolt12Invoice_verify(long _this_arg, long _key); + // struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_write")] public static extern byte[] Bolt12Invoice_write(long _obj); + // void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_free")] public static extern void BlindedPayInfo_free(long _this_obj); + // uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_fee_base_msat")] public static extern int BlindedPayInfo_get_fee_base_msat(long _this_ptr); + // void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_fee_base_msat")] public static extern void BlindedPayInfo_set_fee_base_msat(long _this_ptr, int _val); + // uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_fee_proportional_millionths")] public static extern int BlindedPayInfo_get_fee_proportional_millionths(long _this_ptr); + // void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_fee_proportional_millionths")] public static extern void BlindedPayInfo_set_fee_proportional_millionths(long _this_ptr, int _val); + // uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_cltv_expiry_delta")] public static extern short BlindedPayInfo_get_cltv_expiry_delta(long _this_ptr); + // void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_cltv_expiry_delta")] public static extern void BlindedPayInfo_set_cltv_expiry_delta(long _this_ptr, short _val); + // uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_htlc_minimum_msat")] public static extern long BlindedPayInfo_get_htlc_minimum_msat(long _this_ptr); + // void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_htlc_minimum_msat")] public static extern void BlindedPayInfo_set_htlc_minimum_msat(long _this_ptr, long _val); + // uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_htlc_maximum_msat")] public static extern long BlindedPayInfo_get_htlc_maximum_msat(long _this_ptr); + // void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_htlc_maximum_msat")] public static extern void BlindedPayInfo_set_htlc_maximum_msat(long _this_ptr, long _val); + // struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_get_features")] public static extern long BlindedPayInfo_get_features(long _this_ptr); + // void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_set_features")] public static extern void BlindedPayInfo_set_features(long _this_ptr, long _val); + // MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_new")] public static extern long BlindedPayInfo_new(int _fee_base_msat_arg, int _fee_proportional_millionths_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg, long _features_arg); + // uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_clone_ptr")] public static extern long BlindedPayInfo_clone_ptr(long _arg); + // struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_clone")] public static extern long BlindedPayInfo_clone(long _orig); + // uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_hash")] public static extern long BlindedPayInfo_hash(long _o); + // bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_eq")] public static extern bool BlindedPayInfo_eq(long _a, long _b); + // struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_write")] public static extern byte[] BlindedPayInfo_write(long _obj); + // struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPayInfo_read")] public static extern long BlindedPayInfo_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void InvoiceError_free(struct LDKInvoiceError this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_free")] public static extern void InvoiceError_free(long _this_obj); + // struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_get_erroneous_field")] public static extern long InvoiceError_get_erroneous_field(long _this_ptr); + // void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_set_erroneous_field")] public static extern void InvoiceError_set_erroneous_field(long _this_ptr, long _val); + // struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_get_message")] public static extern long InvoiceError_get_message(long _this_ptr); + // void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_set_message")] public static extern void InvoiceError_set_message(long _this_ptr, long _val); + // MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_new")] public static extern long InvoiceError_new(long _erroneous_field_arg, long _message_arg); + // uint64_t InvoiceError_clone_ptr(LDKInvoiceError *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_clone_ptr")] public static extern long InvoiceError_clone_ptr(long _arg); + // struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_clone")] public static extern long InvoiceError_clone(long _orig); + // void ErroneousField_free(struct LDKErroneousField this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_free")] public static extern void ErroneousField_free(long _this_obj); + // uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_get_tlv_fieldnum")] public static extern long ErroneousField_get_tlv_fieldnum(long _this_ptr); + // void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_set_tlv_fieldnum")] public static extern void ErroneousField_set_tlv_fieldnum(long _this_ptr, long _val); + // struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_get_suggested_value")] public static extern long ErroneousField_get_suggested_value(long _this_ptr); + // void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_set_suggested_value")] public static extern void ErroneousField_set_suggested_value(long _this_ptr, long _val); + // MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_new")] public static extern long ErroneousField_new(long _tlv_fieldnum_arg, long _suggested_value_arg); + // uint64_t ErroneousField_clone_ptr(LDKErroneousField *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_clone_ptr")] public static extern long ErroneousField_clone_ptr(long _arg); + // struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErroneousField_clone")] public static extern long ErroneousField_clone(long _orig); + // struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_write")] public static extern byte[] InvoiceError_write(long _obj); + // struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_read")] public static extern long InvoiceError_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_free")] public static extern void UnsignedInvoiceRequest_free(long _this_obj); + // void InvoiceRequest_free(struct LDKInvoiceRequest this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_free")] public static extern void InvoiceRequest_free(long _this_obj); + // uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_clone_ptr")] public static extern long InvoiceRequest_clone_ptr(long _arg); + // struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_clone")] public static extern long InvoiceRequest_clone(long _orig); + // MUST_USE_RES struct LDKu8slice InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_metadata")] public static extern byte[] InvoiceRequest_metadata(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_chain")] public static extern byte[] InvoiceRequest_chain(long _this_arg); + // MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_amount_msats")] public static extern long InvoiceRequest_amount_msats(long _this_arg); + // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_features")] public static extern long InvoiceRequest_features(long _this_arg); + // MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_quantity")] public static extern long InvoiceRequest_quantity(long _this_arg); + // MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_payer_id")] public static extern byte[] InvoiceRequest_payer_id(long _this_arg); + // MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_payer_note")] public static extern long InvoiceRequest_payer_note(long _this_arg); + // MUST_USE_RES struct LDKCResult_COption_KeyPairZNoneZ InvoiceRequest_verify(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_verify")] public static extern long InvoiceRequest_verify(long _this_arg, long _key); + // struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_write")] public static extern byte[] InvoiceRequest_write(long _obj); + // void Offer_free(struct LDKOffer this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_free")] public static extern void Offer_free(long _this_obj); + // uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_clone_ptr")] public static extern long Offer_clone_ptr(long _arg); + // struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_clone")] public static extern long Offer_clone(long _orig); + // MUST_USE_RES struct LDKCVec_ChainHashZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_chains")] public static extern byte[][] Offer_chains(long _this_arg); + // MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_supports_chain")] public static extern bool Offer_supports_chain(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _chain); + // MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_metadata")] public static extern long Offer_metadata(long _this_arg); + // MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_amount")] public static extern long Offer_amount(long _this_arg); + // MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_description")] public static extern long Offer_description(long _this_arg); + // MUST_USE_RES struct LDKOfferFeatures Offer_features(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_features")] public static extern long Offer_features(long _this_arg); + // MUST_USE_RES struct LDKCOption_DurationZ Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_absolute_expiry")] public static extern long Offer_absolute_expiry(long _this_arg); + // MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_is_expired")] public static extern bool Offer_is_expired(long _this_arg); + // MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_issuer")] public static extern long Offer_issuer(long _this_arg); + // MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_paths")] public static extern long[] Offer_paths(long _this_arg); + // MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_supported_quantity")] public static extern long Offer_supported_quantity(long _this_arg); + // MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_is_valid_quantity")] public static extern bool Offer_is_valid_quantity(long _this_arg, long _quantity); + // MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_expects_quantity")] public static extern bool Offer_expects_quantity(long _this_arg); + // MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_signing_pubkey")] public static extern byte[] Offer_signing_pubkey(long _this_arg); + // struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_write")] public static extern byte[] Offer_write(long _obj); + // void Amount_free(struct LDKAmount this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_free")] public static extern void Amount_free(long _this_obj); + // uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_clone_ptr")] public static extern long Amount_clone_ptr(long _arg); + // struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_clone")] public static extern long Amount_clone(long _orig); + // void Quantity_free(struct LDKQuantity this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_free")] public static extern void Quantity_free(long _this_obj); + // uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_clone_ptr")] public static extern long Quantity_clone_ptr(long _arg); + // struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_clone")] public static extern long Quantity_clone(long _orig); + // struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_from_str")] public static extern long Offer_from_str(string _s); + // void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12ParseError_free")] public static extern void Bolt12ParseError_free(long _this_obj); + // uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12ParseError_clone_ptr")] public static extern long Bolt12ParseError_clone_ptr(long _arg); + // struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12ParseError_clone")] public static extern long Bolt12ParseError_clone(long _orig); + // enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_clone")] public static extern Bolt12SemanticError Bolt12SemanticError_clone(long _orig); + // enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_already_expired")] public static extern Bolt12SemanticError Bolt12SemanticError_already_expired(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unsupported_chain")] public static extern Bolt12SemanticError Bolt12SemanticError_unsupported_chain(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_chain")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_chain(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_amount")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_amount(); + // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_invalid_amount")] public static extern Bolt12SemanticError Bolt12SemanticError_invalid_amount(); + // enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_insufficient_amount")] public static extern Bolt12SemanticError Bolt12SemanticError_insufficient_amount(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_amount")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_amount(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unsupported_currency")] public static extern Bolt12SemanticError Bolt12SemanticError_unsupported_currency(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unknown_required_features")] public static extern Bolt12SemanticError Bolt12SemanticError_unknown_required_features(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_features")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_features(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_description")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_description(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_signing_pubkey")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(); + // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_invalid_signing_pubkey")] public static extern Bolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_signing_pubkey")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_quantity")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_quantity(); + // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_invalid_quantity")] public static extern Bolt12SemanticError Bolt12SemanticError_invalid_quantity(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_quantity")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_quantity(); + // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_invalid_metadata")] public static extern Bolt12SemanticError Bolt12SemanticError_invalid_metadata(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_metadata")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_metadata(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_payer_metadata")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_payer_metadata(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_payer_id")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_payer_id(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_paths")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_paths(); + // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_invalid_pay_info")] public static extern Bolt12SemanticError Bolt12SemanticError_invalid_pay_info(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_creation_time")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_creation_time(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_payment_hash")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_payment_hash(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_signature")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_signature(); + // void Refund_free(struct LDKRefund this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_free")] public static extern void Refund_free(long _this_obj); + // uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_clone_ptr")] public static extern long Refund_clone_ptr(long _arg); + // struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_clone")] public static extern long Refund_clone(long _orig); + // MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_description")] public static extern long Refund_description(long _this_arg); + // MUST_USE_RES struct LDKCOption_DurationZ Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_absolute_expiry")] public static extern long Refund_absolute_expiry(long _this_arg); + // MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_is_expired")] public static extern bool Refund_is_expired(long _this_arg); + // MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_issuer")] public static extern long Refund_issuer(long _this_arg); + // MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_paths")] public static extern long[] Refund_paths(long _this_arg); + // MUST_USE_RES struct LDKu8slice Refund_metadata(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_metadata")] public static extern byte[] Refund_metadata(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_chain")] public static extern byte[] Refund_chain(long _this_arg); + // MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_amount_msats")] public static extern long Refund_amount_msats(long _this_arg); + // MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_features")] public static extern long Refund_features(long _this_arg); + // MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_quantity")] public static extern long Refund_quantity(long _this_arg); + // MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_payer_id")] public static extern byte[] Refund_payer_id(long _this_arg); + // MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_payer_note")] public static extern long Refund_payer_note(long _this_arg); + // struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_write")] public static extern byte[] Refund_write(long _obj); + // struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_from_str")] public static extern long Refund_from_str(string _s); + // enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoLookupError_clone")] public static extern UtxoLookupError UtxoLookupError_clone(long _orig); + // enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoLookupError_unknown_chain")] public static extern UtxoLookupError UtxoLookupError_unknown_chain(); + // enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoLookupError_unknown_tx")] public static extern UtxoLookupError UtxoLookupError_unknown_tx(); + // void UtxoResult_free(struct LDKUtxoResult this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoResult_free")] public static extern void UtxoResult_free(long _this_ptr); + // uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoResult_clone_ptr")] public static extern long UtxoResult_clone_ptr(long _arg); + // struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoResult_clone")] public static extern long UtxoResult_clone(long _orig); + // struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoResult_sync")] public static extern long UtxoResult_sync(long _a); + // struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoResult_async")] public static extern long UtxoResult_async(long _a); + // void UtxoLookup_free(struct LDKUtxoLookup this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoLookup_free")] public static extern void UtxoLookup_free(long _this_ptr); + // void UtxoFuture_free(struct LDKUtxoFuture this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoFuture_free")] public static extern void UtxoFuture_free(long _this_obj); + // uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoFuture_clone_ptr")] public static extern long UtxoFuture_clone_ptr(long _arg); + // struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoFuture_clone")] public static extern long UtxoFuture_clone(long _orig); + // MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoFuture_new")] public static extern long UtxoFuture_new(); + // void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoFuture_resolve_without_forwarding")] public static extern void UtxoFuture_resolve_without_forwarding(long _this_arg, long _graph, long _result); + // void UtxoFuture_resolve(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, const struct LDKP2PGossipSync *NONNULL_PTR gossip, struct LDKCResult_TxOutUtxoLookupErrorZ result); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UtxoFuture_resolve")] public static extern void UtxoFuture_resolve(long _this_arg, long _graph, long _gossip, long _result); // void NodeId_free(struct LDKNodeId this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_free")] public static extern void NodeId_free(long _this_obj); // uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg); @@ -6860,15 +8721,17 @@ internal class bindings { // struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_clone")] public static extern long NodeId_clone(long _orig); // MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_from_pubkey")] public static extern long NodeId_from_pubkey(byte[] _pubkey); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_from_pubkey")] public static extern long NodeId_from_pubkey([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _pubkey); // MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_as_slice")] public static extern byte[] NodeId_as_slice(long _this_arg); + // MUST_USE_RES struct LDKCResult_PublicKeyErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_as_pubkey")] public static extern long NodeId_as_pubkey(long _this_arg); // uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_hash")] public static extern long NodeId_hash(long _o); // struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_write")] public static extern byte[] NodeId_write(long _obj); // struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_read")] public static extern long NodeId_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_read")] public static extern long NodeId_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void NetworkGraph_free(struct LDKNetworkGraph this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_free")] public static extern void NetworkGraph_free(long _this_obj); // void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj); @@ -6884,21 +8747,27 @@ internal class bindings { // struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_channel_failure")] public static extern long NetworkUpdate_channel_failure(long _short_channel_id, bool _is_permanent); // struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_node_failure")] public static extern long NetworkUpdate_node_failure(byte[] _node_id, bool _is_permanent); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_node_failure")] public static extern long NetworkUpdate_node_failure([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, bool _is_permanent); // bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_eq")] public static extern bool NetworkUpdate_eq(long _a, long _b); // struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_write")] public static extern byte[] NetworkUpdate_write(long _obj); // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_read")] public static extern long NetworkUpdate_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkUpdate_read")] public static extern long NetworkUpdate_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void P2PGossipSync_free(struct LDKP2PGossipSync this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_P2PGossipSync_free")] public static extern void P2PGossipSync_free(long _this_obj); - // MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_P2PGossipSync_new")] public static extern long P2PGossipSync_new(long _network_graph, long _chain_access, long _logger); - // void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_P2PGossipSync_add_chain_access")] public static extern void P2PGossipSync_add_chain_access(long _this_arg, long _chain_access); + // MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_P2PGossipSync_new")] public static extern long P2PGossipSync_new(long _network_graph, long _utxo_lookup, long _logger); + // void P2PGossipSync_add_utxo_lookup(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_P2PGossipSync_add_utxo_lookup")] public static extern void P2PGossipSync_add_utxo_lookup(long _this_arg, long _utxo_lookup); // void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_handle_network_update")] public static extern void NetworkGraph_handle_network_update(long _this_arg, long _network_update); + // MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_genesis_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_get_genesis_hash")] public static extern byte[] NetworkGraph_get_genesis_hash(long _this_arg); + // struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_verify_node_announcement")] public static extern long verify_node_announcement(long _msg); + // struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_verify_channel_announcement")] public static extern long verify_channel_announcement(long _msg); // struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_P2PGossipSync_as_RoutingMessageHandler")] public static extern long P2PGossipSync_as_RoutingMessageHandler(long _this_arg); // struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg); @@ -6944,7 +8813,7 @@ internal class bindings { // struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_write")] public static extern byte[] ChannelUpdateInfo_write(long _obj); // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_read")] public static extern long ChannelUpdateInfo_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUpdateInfo_read")] public static extern long ChannelUpdateInfo_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void ChannelInfo_free(struct LDKChannelInfo this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_free")] public static extern void ChannelInfo_free(long _this_obj); // struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr); @@ -6986,7 +8855,7 @@ internal class bindings { // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_write")] public static extern byte[] ChannelInfo_write(long _obj); // struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_read")] public static extern long ChannelInfo_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelInfo_read")] public static extern long ChannelInfo_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelInfo_free")] public static extern void DirectedChannelInfo_free(long _this_obj); // uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg); @@ -7007,12 +8876,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_clone")] public static extern long EffectiveCapacity_clone(long _orig); // struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_exact_liquidity")] public static extern long EffectiveCapacity_exact_liquidity(long _liquidity_msat); - // struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_maximum_htlc")] public static extern long EffectiveCapacity_maximum_htlc(long _amount_msat); + // struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_advertised_max_htlc")] public static extern long EffectiveCapacity_advertised_max_htlc(long _amount_msat); // struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_total")] public static extern long EffectiveCapacity_total(long _capacity_msat, long _htlc_maximum_msat); // struct LDKEffectiveCapacity EffectiveCapacity_infinite(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_infinite")] public static extern long EffectiveCapacity_infinite(); + // struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_hint_max_htlc")] public static extern long EffectiveCapacity_hint_max_htlc(long _amount_msat); // struct LDKEffectiveCapacity EffectiveCapacity_unknown(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_unknown")] public static extern long EffectiveCapacity_unknown(); // MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg); @@ -7040,7 +8911,7 @@ internal class bindings { // struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_write")] public static extern byte[] RoutingFees_write(long _obj); // struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_read")] public static extern long RoutingFees_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RoutingFees_read")] public static extern long RoutingFees_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_free")] public static extern void NodeAnnouncementInfo_free(long _this_obj); // struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); @@ -7054,39 +8925,37 @@ internal class bindings { // const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_rgb")] public static extern byte[] NodeAnnouncementInfo_get_rgb(long _this_ptr); // void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_rgb")] public static extern void NodeAnnouncementInfo_set_rgb(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_rgb")] public static extern void NodeAnnouncementInfo_set_rgb(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_alias")] public static extern long NodeAnnouncementInfo_get_alias(long _this_ptr); // void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_alias")] public static extern void NodeAnnouncementInfo_set_alias(long _this_ptr, long _val); - // struct LDKCVec_NetAddressZ NodeAnnouncementInfo_get_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_addresses")] public static extern long[] NodeAnnouncementInfo_get_addresses(long _this_ptr); - // void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_addresses")] public static extern void NodeAnnouncementInfo_set_addresses(long _this_ptr, long[] _val); // struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_get_announcement_message")] public static extern long NodeAnnouncementInfo_get_announcement_message(long _this_ptr); // void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_set_announcement_message")] public static extern void NodeAnnouncementInfo_set_announcement_message(long _this_ptr, long _val); - // MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_new")] public static extern long NodeAnnouncementInfo_new(long _features_arg, int _last_update_arg, byte[] _rgb_arg, long _alias_arg, long[] _addresses_arg, long _announcement_message_arg); + // MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKNodeAnnouncement announcement_message_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_new")] public static extern long NodeAnnouncementInfo_new(long _features_arg, int _last_update_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _rgb_arg, long _alias_arg, long _announcement_message_arg); // uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_clone_ptr")] public static extern long NodeAnnouncementInfo_clone_ptr(long _arg); // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_clone")] public static extern long NodeAnnouncementInfo_clone(long _orig); // bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_eq")] public static extern bool NodeAnnouncementInfo_eq(long _a, long _b); + // MUST_USE_RES struct LDKCVec_NetAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_addresses")] public static extern long[] NodeAnnouncementInfo_addresses(long _this_arg); // struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_write")] public static extern byte[] NodeAnnouncementInfo_write(long _obj); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_read")] public static extern long NodeAnnouncementInfo_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAnnouncementInfo_read")] public static extern long NodeAnnouncementInfo_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void NodeAlias_free(struct LDKNodeAlias this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_free")] public static extern void NodeAlias_free(long _this_obj); // const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_get_a")] public static extern byte[] NodeAlias_get_a(long _this_ptr); // void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_set_a")] public static extern void NodeAlias_set_a(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_set_a")] public static extern void NodeAlias_set_a(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_new")] public static extern long NodeAlias_new(byte[] _a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_new")] public static extern long NodeAlias_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a_arg); // uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_clone_ptr")] public static extern long NodeAlias_clone_ptr(long _arg); // struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig); @@ -7096,23 +8965,19 @@ internal class bindings { // struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_write")] public static extern byte[] NodeAlias_write(long _obj); // struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_read")] public static extern long NodeAlias_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeAlias_read")] public static extern long NodeAlias_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void NodeInfo_free(struct LDKNodeInfo this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_free")] public static extern void NodeInfo_free(long _this_obj); // struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_get_channels")] public static extern long[] NodeInfo_get_channels(long _this_ptr); // void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_set_channels")] public static extern void NodeInfo_set_channels(long _this_ptr, long[] _val); - // struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_get_lowest_inbound_channel_fees")] public static extern long NodeInfo_get_lowest_inbound_channel_fees(long _this_ptr); - // void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_set_lowest_inbound_channel_fees")] public static extern void NodeInfo_set_lowest_inbound_channel_fees(long _this_ptr, long _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_set_channels")] public static extern void NodeInfo_set_channels(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_get_announcement_info")] public static extern long NodeInfo_get_announcement_info(long _this_ptr); // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_set_announcement_info")] public static extern void NodeInfo_set_announcement_info(long _this_ptr, long _val); - // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_new")] public static extern long NodeInfo_new(long[] _channels_arg, long _lowest_inbound_channel_fees_arg, long _announcement_info_arg); + // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_new")] public static extern long NodeInfo_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _channels_arg, long _announcement_info_arg); // uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_clone_ptr")] public static extern long NodeInfo_clone_ptr(long _arg); // struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); @@ -7122,13 +8987,13 @@ internal class bindings { // struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_write")] public static extern byte[] NodeInfo_write(long _obj); // struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_read")] public static extern long NodeInfo_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_read")] public static extern long NodeInfo_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_write")] public static extern byte[] NetworkGraph_write(long _obj); // struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_read")] public static extern long NetworkGraph_read(byte[] _ser, long _arg); - // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_new")] public static extern long NetworkGraph_new(byte[] _genesis_hash, long _logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_read")] public static extern long NetworkGraph_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, long _arg); + // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_new")] public static extern long NetworkGraph_new(Network _network, long _logger); // MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_read_only")] public static extern long NetworkGraph_read_only(long _this_arg); // MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg); @@ -7139,16 +9004,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_update_node_from_announcement")] public static extern long NetworkGraph_update_node_from_announcement(long _this_arg, long _msg); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_update_node_from_unsigned_announcement")] public static extern long NetworkGraph_update_node_from_unsigned_announcement(long _this_arg, long _msg); - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_update_channel_from_announcement")] public static extern long NetworkGraph_update_channel_from_announcement(long _this_arg, long _msg, long _chain_access); - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_update_channel_from_unsigned_announcement")] public static extern long NetworkGraph_update_channel_from_unsigned_announcement(long _this_arg, long _msg, long _chain_access); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_update_channel_from_announcement")] public static extern long NetworkGraph_update_channel_from_announcement(long _this_arg, long _msg, long _utxo_lookup); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement_no_lookup(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_update_channel_from_announcement_no_lookup")] public static extern long NetworkGraph_update_channel_from_announcement_no_lookup(long _this_arg, long _msg); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_update_channel_from_unsigned_announcement")] public static extern long NetworkGraph_update_channel_from_unsigned_announcement(long _this_arg, long _msg, long _utxo_lookup); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_add_channel_from_partial_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t timestamp, struct LDKChannelFeatures features, struct LDKPublicKey node_id_1, struct LDKPublicKey node_id_2); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_add_channel_from_partial_announcement")] public static extern long NetworkGraph_add_channel_from_partial_announcement(long _this_arg, long _short_channel_id, long _timestamp, long _features, byte[] _node_id_1, byte[] _node_id_2); - // void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_channel_failed")] public static extern void NetworkGraph_channel_failed(long _this_arg, long _short_channel_id, bool _is_permanent); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_add_channel_from_partial_announcement")] public static extern long NetworkGraph_add_channel_from_partial_announcement(long _this_arg, long _short_channel_id, long _timestamp, long _features, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id_1, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id_2); + // void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_channel_failed_permanent")] public static extern void NetworkGraph_channel_failed_permanent(long _this_arg, long _short_channel_id); // void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_node_failed_permanent")] public static extern void NetworkGraph_node_failed_permanent(long _this_arg, byte[] _node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_node_failed_permanent")] public static extern void NetworkGraph_node_failed_permanent(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id); // void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NetworkGraph_remove_stale_channels_and_tracking")] public static extern void NetworkGraph_remove_stale_channels_and_tracking(long _this_arg); // void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix); @@ -7166,18 +9033,18 @@ internal class bindings { // MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReadOnlyNetworkGraph_list_nodes")] public static extern long[] ReadOnlyNetworkGraph_list_nodes(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReadOnlyNetworkGraph_get_addresses")] public static extern long ReadOnlyNetworkGraph_get_addresses(long _this_arg, byte[] _pubkey); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReadOnlyNetworkGraph_get_addresses")] public static extern long ReadOnlyNetworkGraph_get_addresses(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _pubkey); // void DefaultRouter_free(struct LDKDefaultRouter this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DefaultRouter_free")] public static extern void DefaultRouter_free(long _this_obj); - // MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DefaultRouter_new")] public static extern long DefaultRouter_new(long _network_graph, long _logger, byte[] _random_seed_bytes, long _scorer); + // MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DefaultRouter_new")] public static extern long DefaultRouter_new(long _network_graph, long _logger, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _random_seed_bytes, long _scorer, long _score_params); // struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DefaultRouter_as_Router")] public static extern long DefaultRouter_as_Router(long _this_arg); // void Router_free(struct LDKRouter this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Router_free")] public static extern void Router_free(long _this_ptr); // void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ScorerAccountingForInFlightHtlcs_free")] public static extern void ScorerAccountingForInFlightHtlcs_free(long _this_obj); - // MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScore scorer, struct LDKInFlightHtlcs inflight_htlcs); + // MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScore scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ScorerAccountingForInFlightHtlcs_new")] public static extern long ScorerAccountingForInFlightHtlcs_new(long _scorer, long _inflight_htlcs); // struct LDKCVec_u8Z ScorerAccountingForInFlightHtlcs_write(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ScorerAccountingForInFlightHtlcs_write")] public static extern byte[] ScorerAccountingForInFlightHtlcs_write(long _obj); @@ -7191,18 +9058,22 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_clone")] public static extern long InFlightHtlcs_clone(long _orig); // MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_new")] public static extern long InFlightHtlcs_new(); + // void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_process_path")] public static extern void InFlightHtlcs_process_path(long _this_arg, long _path, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payer_node_id); + // void InFlightHtlcs_add_inflight_htlc(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid, uint64_t used_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_add_inflight_htlc")] public static extern void InFlightHtlcs_add_inflight_htlc(long _this_arg, long _source, long _target, long _channel_scid, long _used_msat); // MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_used_liquidity_msat")] public static extern long InFlightHtlcs_used_liquidity_msat(long _this_arg, long _source, long _target, long _channel_scid); // struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_write")] public static extern byte[] InFlightHtlcs_write(long _obj); // struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_read")] public static extern long InFlightHtlcs_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InFlightHtlcs_read")] public static extern long InFlightHtlcs_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void RouteHop_free(struct LDKRouteHop this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_free")] public static extern void RouteHop_free(long _this_obj); // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_get_pubkey")] public static extern byte[] RouteHop_get_pubkey(long _this_ptr); // void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_set_pubkey")] public static extern void RouteHop_set_pubkey(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_set_pubkey")] public static extern void RouteHop_set_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_get_node_features")] public static extern long RouteHop_get_node_features(long _this_ptr); // void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); @@ -7224,7 +9095,7 @@ internal class bindings { // void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_set_cltv_expiry_delta")] public static extern void RouteHop_set_cltv_expiry_delta(long _this_ptr, int _val); // MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_new")] public static extern long RouteHop_new(byte[] _pubkey_arg, long _node_features_arg, long _short_channel_id_arg, long _channel_features_arg, long _fee_msat_arg, int _cltv_expiry_delta_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_new")] public static extern long RouteHop_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _pubkey_arg, long _node_features_arg, long _short_channel_id_arg, long _channel_features_arg, long _fee_msat_arg, int _cltv_expiry_delta_arg); // uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_clone_ptr")] public static extern long RouteHop_clone_ptr(long _arg); // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); @@ -7236,19 +9107,77 @@ internal class bindings { // struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_write")] public static extern byte[] RouteHop_write(long _obj); // struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_read")] public static extern long RouteHop_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHop_read")] public static extern long RouteHop_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void BlindedTail_free(struct LDKBlindedTail this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_free")] public static extern void BlindedTail_free(long _this_obj); + // struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_get_hops")] public static extern long[] BlindedTail_get_hops(long _this_ptr); + // void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_set_hops")] public static extern void BlindedTail_set_hops(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); + // struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_get_blinding_point")] public static extern byte[] BlindedTail_get_blinding_point(long _this_ptr); + // void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_set_blinding_point")] public static extern void BlindedTail_set_blinding_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_get_excess_final_cltv_expiry_delta")] public static extern int BlindedTail_get_excess_final_cltv_expiry_delta(long _this_ptr); + // void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_set_excess_final_cltv_expiry_delta")] public static extern void BlindedTail_set_excess_final_cltv_expiry_delta(long _this_ptr, int _val); + // uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_get_final_value_msat")] public static extern long BlindedTail_get_final_value_msat(long _this_ptr); + // void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_set_final_value_msat")] public static extern void BlindedTail_set_final_value_msat(long _this_ptr, long _val); + // MUST_USE_RES struct LDKBlindedTail BlindedTail_new(struct LDKCVec_BlindedHopZ hops_arg, struct LDKPublicKey blinding_point_arg, uint32_t excess_final_cltv_expiry_delta_arg, uint64_t final_value_msat_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_new")] public static extern long BlindedTail_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _hops_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _blinding_point_arg, int _excess_final_cltv_expiry_delta_arg, long _final_value_msat_arg); + // uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_clone_ptr")] public static extern long BlindedTail_clone_ptr(long _arg); + // struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_clone")] public static extern long BlindedTail_clone(long _orig); + // uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_hash")] public static extern long BlindedTail_hash(long _o); + // bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_eq")] public static extern bool BlindedTail_eq(long _a, long _b); + // struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_write")] public static extern byte[] BlindedTail_write(long _obj); + // struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedTail_read")] public static extern long BlindedTail_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void Path_free(struct LDKPath this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_free")] public static extern void Path_free(long _this_obj); + // struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_get_hops")] public static extern long[] Path_get_hops(long _this_ptr); + // void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_set_hops")] public static extern void Path_set_hops(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); + // struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_get_blinded_tail")] public static extern long Path_get_blinded_tail(long _this_ptr); + // void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_set_blinded_tail")] public static extern void Path_set_blinded_tail(long _this_ptr, long _val); + // MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_new")] public static extern long Path_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _hops_arg, long _blinded_tail_arg); + // uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_clone_ptr")] public static extern long Path_clone_ptr(long _arg); + // struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_clone")] public static extern long Path_clone(long _orig); + // uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_hash")] public static extern long Path_hash(long _o); + // bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_eq")] public static extern bool Path_eq(long _a, long _b); + // MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_fee_msat")] public static extern long Path_fee_msat(long _this_arg); + // MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_final_value_msat")] public static extern long Path_final_value_msat(long _this_arg); + // MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Path_final_cltv_expiry_delta")] public static extern long Path_final_cltv_expiry_delta(long _this_arg); // void Route_free(struct LDKRoute this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_free")] public static extern void Route_free(long _this_obj); - // struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_get_paths")] public static extern long[][] Route_get_paths(long _this_ptr); - // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_set_paths")] public static extern void Route_set_paths(long _this_ptr, long[][] _val); + // struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_get_paths")] public static extern long[] Route_get_paths(long _this_ptr); + // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_set_paths")] public static extern void Route_set_paths(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_get_payment_params")] public static extern long Route_get_payment_params(long _this_ptr); // void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_set_payment_params")] public static extern void Route_set_payment_params(long _this_ptr, long _val); - // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_new")] public static extern long Route_new(long[][] _paths_arg, long _payment_params_arg); + // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKPaymentParameters payment_params_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_new")] public static extern long Route_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _paths_arg, long _payment_params_arg); // uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_clone_ptr")] public static extern long Route_clone_ptr(long _arg); // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); @@ -7264,7 +9193,7 @@ internal class bindings { // struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_write")] public static extern byte[] Route_write(long _obj); // struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_read")] public static extern long Route_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Route_read")] public static extern long Route_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void RouteParameters_free(struct LDKRouteParameters this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_free")] public static extern void RouteParameters_free(long _this_obj); // struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr); @@ -7275,34 +9204,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_get_final_value_msat")] public static extern long RouteParameters_get_final_value_msat(long _this_ptr); // void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_set_final_value_msat")] public static extern void RouteParameters_set_final_value_msat(long _this_ptr, long _val); - // uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_get_final_cltv_expiry_delta")] public static extern int RouteParameters_get_final_cltv_expiry_delta(long _this_ptr); - // void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_set_final_cltv_expiry_delta")] public static extern void RouteParameters_set_final_cltv_expiry_delta(long _this_ptr, int _val); - // MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_new")] public static extern long RouteParameters_new(long _payment_params_arg, long _final_value_msat_arg, int _final_cltv_expiry_delta_arg); + // MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_new")] public static extern long RouteParameters_new(long _payment_params_arg, long _final_value_msat_arg); // uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_clone_ptr")] public static extern long RouteParameters_clone_ptr(long _arg); // struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_clone")] public static extern long RouteParameters_clone(long _orig); + // bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_eq")] public static extern bool RouteParameters_eq(long _a, long _b); // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_write")] public static extern byte[] RouteParameters_write(long _obj); // struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_read")] public static extern long RouteParameters_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteParameters_read")] public static extern long RouteParameters_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void PaymentParameters_free(struct LDKPaymentParameters this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_free")] public static extern void PaymentParameters_free(long _this_obj); - // struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_payee_pubkey")] public static extern byte[] PaymentParameters_get_payee_pubkey(long _this_ptr); - // void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_payee_pubkey")] public static extern void PaymentParameters_set_payee_pubkey(long _this_ptr, byte[] _val); - // struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_features")] public static extern long PaymentParameters_get_features(long _this_ptr); - // void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_features")] public static extern void PaymentParameters_set_features(long _this_ptr, long _val); - // struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_route_hints")] public static extern long[] PaymentParameters_get_route_hints(long _this_ptr); - // void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_route_hints")] public static extern void PaymentParameters_set_route_hints(long _this_ptr, long[] _val); + // struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_payee")] public static extern long PaymentParameters_get_payee(long _this_ptr); + // void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_payee")] public static extern void PaymentParameters_set_payee(long _this_ptr, long _val); // struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_expiry_time")] public static extern long PaymentParameters_get_expiry_time(long _this_ptr); // void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); @@ -7322,9 +9241,9 @@ internal class bindings { // struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_get_previously_failed_channels")] public static extern long[] PaymentParameters_get_previously_failed_channels(long _this_ptr); // void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_previously_failed_channels")] public static extern void PaymentParameters_set_previously_failed_channels(long _this_ptr, long[] _val); - // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPublicKey payee_pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_new")] public static extern long PaymentParameters_new(byte[] _payee_pubkey_arg, long _features_arg, long[] _route_hints_arg, long _expiry_time_arg, int _max_total_cltv_expiry_delta_arg, byte _max_path_count_arg, byte _max_channel_saturation_power_of_half_arg, long[] _previously_failed_channels_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_set_previously_failed_channels")] public static extern void PaymentParameters_set_previously_failed_channels(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); + // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_new")] public static extern long PaymentParameters_new(long _payee_arg, long _expiry_time_arg, int _max_total_cltv_expiry_delta_arg, byte _max_path_count_arg, byte _max_channel_saturation_power_of_half_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _previously_failed_channels_arg); // uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_clone_ptr")] public static extern long PaymentParameters_clone_ptr(long _arg); // struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig); @@ -7335,20 +9254,36 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_eq")] public static extern bool PaymentParameters_eq(long _a, long _b); // struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_write")] public static extern byte[] PaymentParameters_write(long _obj); - // struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_read")] public static extern long PaymentParameters_read(byte[] _ser); - // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_from_node_id")] public static extern long PaymentParameters_from_node_id(byte[] _payee_pubkey); - // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_for_keysend")] public static extern long PaymentParameters_for_keysend(byte[] _payee_pubkey); + // struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_read")] public static extern long PaymentParameters_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, int _arg); + // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_from_node_id")] public static extern long PaymentParameters_from_node_id([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payee_pubkey, int _final_cltv_expiry_delta); + // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_for_keysend")] public static extern long PaymentParameters_for_keysend([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payee_pubkey, int _final_cltv_expiry_delta, bool _allow_mpp); + // MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentParameters_from_bolt12_invoice")] public static extern long PaymentParameters_from_bolt12_invoice(long _invoice); + // void Payee_free(struct LDKPayee this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_free")] public static extern void Payee_free(long _this_ptr); + // uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_clone_ptr")] public static extern long Payee_clone_ptr(long _arg); + // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_clone")] public static extern long Payee_clone(long _orig); + // struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_blinded")] public static extern long Payee_blinded([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _route_hints, long _features); + // struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_clear")] public static extern long Payee_clear([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _route_hints, long _features, int _final_cltv_expiry_delta); + // uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_hash")] public static extern long Payee_hash(long _o); + // bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payee_eq")] public static extern bool Payee_eq(long _a, long _b); // void RouteHint_free(struct LDKRouteHint this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_free")] public static extern void RouteHint_free(long _this_obj); // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_get_a")] public static extern long[] RouteHint_get_a(long _this_ptr); // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_set_a")] public static extern void RouteHint_set_a(long _this_ptr, long[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_set_a")] public static extern void RouteHint_set_a(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_new")] public static extern long RouteHint_new(long[] _a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_new")] public static extern long RouteHint_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _a_arg); // uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_clone_ptr")] public static extern long RouteHint_clone_ptr(long _arg); // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); @@ -7360,13 +9295,13 @@ internal class bindings { // struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_write")] public static extern byte[] RouteHint_write(long _obj); // struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_read")] public static extern long RouteHint_read(byte[] _ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHint_read")] public static extern long RouteHint_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); // void RouteHintHop_free(struct LDKRouteHintHop this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_free")] public static extern void RouteHintHop_free(long _this_obj); // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_src_node_id")] public static extern byte[] RouteHintHop_get_src_node_id(long _this_ptr); // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_src_node_id")] public static extern void RouteHintHop_set_src_node_id(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_src_node_id")] public static extern void RouteHintHop_set_src_node_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_get_short_channel_id")] public static extern long RouteHintHop_get_short_channel_id(long _this_ptr); // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); @@ -7388,7 +9323,7 @@ internal class bindings { // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_set_htlc_maximum_msat")] public static extern void RouteHintHop_set_htlc_maximum_msat(long _this_ptr, long _val); // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_new")] public static extern long RouteHintHop_new(byte[] _src_node_id_arg, long _short_channel_id_arg, long _fees_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_new")] public static extern long RouteHintHop_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _src_node_id_arg, long _short_channel_id_arg, long _fees_arg, short _cltv_expiry_delta_arg, long _htlc_minimum_msat_arg, long _htlc_maximum_msat_arg); // uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_clone_ptr")] public static extern long RouteHintHop_clone_ptr(long _arg); // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); @@ -7400,11 +9335,11 @@ internal class bindings { // struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_write")] public static extern byte[] RouteHintHop_write(long _obj); // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_read")] public static extern long RouteHintHop_read(byte[] _ser); - // struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer, const uint8_t (*random_seed_bytes)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_find_route")] public static extern long find_route(byte[] _our_node_pubkey, long _route_params, long _network_graph, long[] _first_hops, long _logger, long _scorer, byte[] _random_seed_bytes); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RouteHintHop_read")] public static extern long RouteHintHop_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params, const uint8_t (*random_seed_bytes)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_find_route")] public static extern long find_route([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _our_node_pubkey, long _route_params, long _network_graph, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _first_hops, long _logger, long _scorer, long _score_params, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _random_seed_bytes); // struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_route_from_hops")] public static extern long build_route_from_hops(byte[] _our_node_pubkey, byte[][] _hops, long _route_params, long _network_graph, long _logger, byte[] _random_seed_bytes); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_build_route_from_hops")] public static extern long build_route_from_hops([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _our_node_pubkey, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _hops, long _route_params, long _network_graph, long _logger, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _random_seed_bytes); // void Score_free(struct LDKScore this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_free")] public static extern void Score_free(long _this_ptr); // void LockableScore_free(struct LDKLockableScore this_ptr); @@ -7413,12 +9348,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableScore_free")] public static extern void WriteableScore_free(long _this_ptr); // void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedLockableScore_free")] public static extern void MultiThreadedLockableScore_free(long _this_obj); - // void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedScoreLock_free")] public static extern void MultiThreadedScoreLock_free(long _this_obj); - // struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedScoreLock_as_Score")] public static extern long MultiThreadedScoreLock_as_Score(long _this_arg); - // struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedScoreLock_write")] public static extern byte[] MultiThreadedScoreLock_write(long _obj); // struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedLockableScore_as_LockableScore")] public static extern long MultiThreadedLockableScore_as_LockableScore(long _this_arg); // struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj); @@ -7427,6 +9356,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedLockableScore_as_WriteableScore")] public static extern long MultiThreadedLockableScore_as_WriteableScore(long _this_arg); // MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedLockableScore_new")] public static extern long MultiThreadedLockableScore_new(long _score); + // void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedScoreLock_free")] public static extern void MultiThreadedScoreLock_free(long _this_obj); + // struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedScoreLock_write")] public static extern byte[] MultiThreadedScoreLock_write(long _obj); + // struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MultiThreadedScoreLock_as_Score")] public static extern long MultiThreadedScoreLock_as_Score(long _this_arg); // void ChannelUsage_free(struct LDKChannelUsage this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelUsage_free")] public static extern void ChannelUsage_free(long _this_obj); // uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr); @@ -7460,105 +9395,331 @@ internal class bindings { // struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FixedPenaltyScorer_write")] public static extern byte[] FixedPenaltyScorer_write(long _obj); // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FixedPenaltyScorer_read")] public static extern long FixedPenaltyScorer_read(byte[] _ser, long _arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FixedPenaltyScorer_read")] public static extern long FixedPenaltyScorer_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, long _arg); // void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_free")] public static extern void ProbabilisticScorer_free(long _this_obj); - // void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_free")] public static extern void ProbabilisticScoringParameters_free(long _this_obj); - // uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_base_penalty_msat")] public static extern long ProbabilisticScoringParameters_get_base_penalty_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_base_penalty_msat")] public static extern void ProbabilisticScoringParameters_set_base_penalty_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat")] public static extern long ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat")] public static extern void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat")] public static extern long ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat")] public static extern void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_liquidity_offset_half_life")] public static extern long ProbabilisticScoringParameters_get_liquidity_offset_half_life(long _this_ptr); - // void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_liquidity_offset_half_life")] public static extern void ProbabilisticScoringParameters_set_liquidity_offset_half_life(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat")] public static extern long ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat")] public static extern void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat")] public static extern long ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat")] public static extern void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat")] public static extern long ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat")] public static extern void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_historical_no_updates_half_life")] public static extern long ProbabilisticScoringParameters_get_historical_no_updates_half_life(long _this_ptr); - // void ProbabilisticScoringParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_historical_no_updates_half_life")] public static extern void ProbabilisticScoringParameters_set_historical_no_updates_half_life(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_anti_probing_penalty_msat")] public static extern long ProbabilisticScoringParameters_get_anti_probing_penalty_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_anti_probing_penalty_msat")] public static extern void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat")] public static extern long ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(long _this_ptr); - // void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_set_considered_impossible_penalty_msat")] public static extern void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(long _this_ptr, long _val); - // uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_clone_ptr")] public static extern long ProbabilisticScoringParameters_clone_ptr(long _arg); - // struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_clone")] public static extern long ProbabilisticScoringParameters_clone(long _orig); - // MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_new")] public static extern long ProbabilisticScorer_new(long _params, long _network_graph, long _logger); + // void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_free")] public static extern void ProbabilisticScoringFeeParameters_free(long _this_obj); + // uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_msat")] public static extern long ProbabilisticScoringFeeParameters_get_base_penalty_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_msat")] public static extern void ProbabilisticScoringFeeParameters_set_base_penalty_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat")] public static extern long ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat")] public static extern void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat")] public static extern long ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat")] public static extern void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat")] public static extern long ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat")] public static extern void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat")] public static extern long ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat")] public static extern void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat")] public static extern long ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat")] public static extern void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat")] public static extern long ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat")] public static extern void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat")] public static extern long ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(long _this_ptr); + // void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat")] public static extern void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringFeeParameters_clone_ptr(LDKProbabilisticScoringFeeParameters *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_clone_ptr")] public static extern long ProbabilisticScoringFeeParameters_clone_ptr(long _arg); + // struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_clone")] public static extern long ProbabilisticScoringFeeParameters_clone(long _orig); + // MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_default")] public static extern long ProbabilisticScoringFeeParameters_default(); + // void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_add_banned")] public static extern void ProbabilisticScoringFeeParameters_add_banned(long _this_arg, long _node_id); + // void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_add_banned_from_list")] public static extern void ProbabilisticScoringFeeParameters_add_banned_from_list(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _node_ids); + // void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_remove_banned")] public static extern void ProbabilisticScoringFeeParameters_remove_banned(long _this_arg, long _node_id); + // void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_set_manual_penalty")] public static extern void ProbabilisticScoringFeeParameters_set_manual_penalty(long _this_arg, long _node_id, long _penalty); + // void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_remove_manual_penalty")] public static extern void ProbabilisticScoringFeeParameters_remove_manual_penalty(long _this_arg, long _node_id); + // void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringFeeParameters_clear_manual_penalties")] public static extern void ProbabilisticScoringFeeParameters_clear_manual_penalties(long _this_arg); + // void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_free")] public static extern void ProbabilisticScoringDecayParameters_free(long _this_obj); + // uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life")] public static extern long ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(long _this_ptr); + // void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life")] public static extern void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(long _this_ptr, long _val); + // uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life")] public static extern long ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(long _this_ptr); + // void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life")] public static extern void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(long _this_ptr, long _val); + // MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_new")] public static extern long ProbabilisticScoringDecayParameters_new(long _historical_no_updates_half_life_arg, long _liquidity_offset_half_life_arg); + // uint64_t ProbabilisticScoringDecayParameters_clone_ptr(LDKProbabilisticScoringDecayParameters *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_clone_ptr")] public static extern long ProbabilisticScoringDecayParameters_clone_ptr(long _arg); + // struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_clone")] public static extern long ProbabilisticScoringDecayParameters_clone(long _orig); + // MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringDecayParameters_default")] public static extern long ProbabilisticScoringDecayParameters_default(); + // MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_new")] public static extern long ProbabilisticScorer_new(long _decay_params, long _network_graph, long _logger); // void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_debug_log_liquidity_stats")] public static extern void ProbabilisticScorer_debug_log_liquidity_stats(long _this_arg); // MUST_USE_RES struct LDKCOption_C2Tuple_u64u64ZZ ProbabilisticScorer_estimated_channel_liquidity_range(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_estimated_channel_liquidity_range")] public static extern long ProbabilisticScorer_estimated_channel_liquidity_range(long _this_arg, long _scid, long _target); - // void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_add_banned")] public static extern void ProbabilisticScorer_add_banned(long _this_arg, long _node_id); - // void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_remove_banned")] public static extern void ProbabilisticScorer_remove_banned(long _this_arg, long _node_id); - // void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_set_manual_penalty")] public static extern void ProbabilisticScorer_set_manual_penalty(long _this_arg, long _node_id, long _penalty); - // void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_remove_manual_penalty")] public static extern void ProbabilisticScorer_remove_manual_penalty(long _this_arg, long _node_id); - // void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_clear_manual_penalties")] public static extern void ProbabilisticScorer_clear_manual_penalties(long _this_arg); - // void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_add_banned_from_list")] public static extern void ProbabilisticScoringParameters_add_banned_from_list(long _this_arg, long[] _node_ids); - // MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScoringParameters_default")] public static extern long ProbabilisticScoringParameters_default(); + // MUST_USE_RES struct LDKCOption_C2Tuple_EightU16sEightU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities")] public static extern long ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(long _this_arg, long _scid, long _target); // struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_as_Score")] public static extern long ProbabilisticScorer_as_Score(long _this_arg); // struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_write")] public static extern byte[] ProbabilisticScorer_write(long _obj); - // struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_read")] public static extern long ProbabilisticScorer_read(byte[] _ser, long _arg_a, long _arg_b, long _arg_c); - // void BlindedPath_free(struct LDKBlindedPath this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_free")] public static extern void BlindedPath_free(long _this_obj); - // uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_clone_ptr")] public static extern long BlindedPath_clone_ptr(long _arg); - // struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_clone")] public static extern long BlindedPath_clone(long _orig); - // void BlindedHop_free(struct LDKBlindedHop this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_free")] public static extern void BlindedHop_free(long _this_obj); - // uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_clone_ptr")] public static extern long BlindedHop_clone_ptr(long _arg); - // struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_clone")] public static extern long BlindedHop_clone(long _orig); - // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new(struct LDKCVec_PublicKeyZ node_pks, const struct LDKKeysInterface *NONNULL_PTR keys_manager); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_new")] public static extern long BlindedPath_new(byte[][] _node_pks, long _keys_manager); - // struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_write")] public static extern byte[] BlindedPath_write(long _obj); - // struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_read")] public static extern long BlindedPath_read(byte[] _ser); - // struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_write")] public static extern byte[] BlindedHop_write(long _obj); - // struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_read")] public static extern long BlindedHop_read(byte[] _ser); + // struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ProbabilisticScorer_read")] public static extern long ProbabilisticScorer_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, long _arg_a, long _arg_b, long _arg_c); + // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_free")] public static extern void DelayedPaymentOutputDescriptor_free(long _this_obj); + // struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_outpoint")] public static extern long DelayedPaymentOutputDescriptor_get_outpoint(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_outpoint")] public static extern void DelayedPaymentOutputDescriptor_set_outpoint(long _this_ptr, long _val); + // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_per_commitment_point")] public static extern byte[] DelayedPaymentOutputDescriptor_get_per_commitment_point(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_per_commitment_point")] public static extern void DelayedPaymentOutputDescriptor_set_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_to_self_delay")] public static extern short DelayedPaymentOutputDescriptor_get_to_self_delay(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_to_self_delay")] public static extern void DelayedPaymentOutputDescriptor_set_to_self_delay(long _this_ptr, short _val); + // struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_output")] public static extern long DelayedPaymentOutputDescriptor_get_output(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_output")] public static extern void DelayedPaymentOutputDescriptor_set_output(long _this_ptr, long _val); + // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey")] public static extern byte[] DelayedPaymentOutputDescriptor_get_revocation_pubkey(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_revocation_pubkey")] public static extern void DelayedPaymentOutputDescriptor_set_revocation_pubkey(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_channel_keys_id")] public static extern byte[] DelayedPaymentOutputDescriptor_get_channel_keys_id(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_channel_keys_id")] public static extern void DelayedPaymentOutputDescriptor_set_channel_keys_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_channel_value_satoshis")] public static extern long DelayedPaymentOutputDescriptor_get_channel_value_satoshis(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis")] public static extern void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(long _this_ptr, long _val); + // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_new")] public static extern long DelayedPaymentOutputDescriptor_new(long _outpoint_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _per_commitment_point_arg, short _to_self_delay_arg, long _output_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_pubkey_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_keys_id_arg, long _channel_value_satoshis_arg); + // uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_clone_ptr")] public static extern long DelayedPaymentOutputDescriptor_clone_ptr(long _arg); + // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_clone")] public static extern long DelayedPaymentOutputDescriptor_clone(long _orig); + // bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_eq")] public static extern bool DelayedPaymentOutputDescriptor_eq(long _a, long _b); + // struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_write")] public static extern byte[] DelayedPaymentOutputDescriptor_write(long _obj); + // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_read")] public static extern long DelayedPaymentOutputDescriptor_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_free")] public static extern void StaticPaymentOutputDescriptor_free(long _this_obj); + // struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_outpoint")] public static extern long StaticPaymentOutputDescriptor_get_outpoint(long _this_ptr); + // void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_outpoint")] public static extern void StaticPaymentOutputDescriptor_set_outpoint(long _this_ptr, long _val); + // struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_output")] public static extern long StaticPaymentOutputDescriptor_get_output(long _this_ptr); + // void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_output")] public static extern void StaticPaymentOutputDescriptor_set_output(long _this_ptr, long _val); + // const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_channel_keys_id")] public static extern byte[] StaticPaymentOutputDescriptor_get_channel_keys_id(long _this_ptr); + // void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_channel_keys_id")] public static extern void StaticPaymentOutputDescriptor_set_channel_keys_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_get_channel_value_satoshis")] public static extern long StaticPaymentOutputDescriptor_get_channel_value_satoshis(long _this_ptr); + // void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_set_channel_value_satoshis")] public static extern void StaticPaymentOutputDescriptor_set_channel_value_satoshis(long _this_ptr, long _val); + // MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_new")] public static extern long StaticPaymentOutputDescriptor_new(long _outpoint_arg, long _output_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_keys_id_arg, long _channel_value_satoshis_arg); + // uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_clone_ptr")] public static extern long StaticPaymentOutputDescriptor_clone_ptr(long _arg); + // struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_clone")] public static extern long StaticPaymentOutputDescriptor_clone(long _orig); + // bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_eq")] public static extern bool StaticPaymentOutputDescriptor_eq(long _a, long _b); + // struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_write")] public static extern byte[] StaticPaymentOutputDescriptor_write(long _obj); + // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_StaticPaymentOutputDescriptor_read")] public static extern long StaticPaymentOutputDescriptor_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_free")] public static extern void SpendableOutputDescriptor_free(long _this_ptr); + // uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_clone_ptr")] public static extern long SpendableOutputDescriptor_clone_ptr(long _arg); + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_clone")] public static extern long SpendableOutputDescriptor_clone(long _orig); + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_static_output")] public static extern long SpendableOutputDescriptor_static_output(long _outpoint, long _output); + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_delayed_payment_output")] public static extern long SpendableOutputDescriptor_delayed_payment_output(long _a); + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_static_payment_output")] public static extern long SpendableOutputDescriptor_static_payment_output(long _a); + // bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_eq")] public static extern bool SpendableOutputDescriptor_eq(long _a, long _b); + // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_write")] public static extern byte[] SpendableOutputDescriptor_write(long _obj); + // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_read")] public static extern long SpendableOutputDescriptor_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // MUST_USE_RES struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_PackedLockTimeZ locktime); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt")] public static extern long SpendableOutputDescriptor_create_spendable_outputs_psbt([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _descriptors, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _outputs, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime); + // void ChannelSigner_free(struct LDKChannelSigner this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelSigner_free")] public static extern void ChannelSigner_free(long _this_ptr); + // void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_free")] public static extern void EcdsaChannelSigner_free(long _this_ptr); + // uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_clone_ptr")] public static extern long WriteableEcdsaChannelSigner_clone_ptr(long _arg); + // struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_clone")] public static extern long WriteableEcdsaChannelSigner_clone(long _orig); + // void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WriteableEcdsaChannelSigner_free")] public static extern void WriteableEcdsaChannelSigner_free(long _this_ptr); + // enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Recipient_clone")] public static extern Recipient Recipient_clone(long _orig); + // enum LDKRecipient Recipient_node(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Recipient_node")] public static extern Recipient Recipient_node(); + // enum LDKRecipient Recipient_phantom_node(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Recipient_phantom_node")] public static extern Recipient Recipient_phantom_node(); + // void EntropySource_free(struct LDKEntropySource this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EntropySource_free")] public static extern void EntropySource_free(long _this_ptr); + // void NodeSigner_free(struct LDKNodeSigner this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_free")] public static extern void NodeSigner_free(long _this_ptr); + // void SignerProvider_free(struct LDKSignerProvider this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_free")] public static extern void SignerProvider_free(long _this_ptr); + // void InMemorySigner_free(struct LDKInMemorySigner this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_free")] public static extern void InMemorySigner_free(long _this_obj); + // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_funding_key")] public static extern byte[] InMemorySigner_get_funding_key(long _this_ptr); + // void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_funding_key")] public static extern void InMemorySigner_set_funding_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_revocation_base_key")] public static extern byte[] InMemorySigner_get_revocation_base_key(long _this_ptr); + // void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_revocation_base_key")] public static extern void InMemorySigner_set_revocation_base_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_payment_key")] public static extern byte[] InMemorySigner_get_payment_key(long _this_ptr); + // void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_payment_key")] public static extern void InMemorySigner_set_payment_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_delayed_payment_base_key")] public static extern byte[] InMemorySigner_get_delayed_payment_base_key(long _this_ptr); + // void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_delayed_payment_base_key")] public static extern void InMemorySigner_set_delayed_payment_base_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_htlc_base_key")] public static extern byte[] InMemorySigner_get_htlc_base_key(long _this_ptr); + // void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_htlc_base_key")] public static extern void InMemorySigner_set_htlc_base_key(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_commitment_seed")] public static extern byte[] InMemorySigner_get_commitment_seed(long _this_ptr); + // void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_set_commitment_seed")] public static extern void InMemorySigner_set_commitment_seed(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_clone_ptr")] public static extern long InMemorySigner_clone_ptr(long _arg); + // struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_clone")] public static extern long InMemorySigner_clone(long _orig); + // MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id, struct LDKThirtyTwoBytes rand_bytes_unique_start); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_new")] public static extern long InMemorySigner_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _funding_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _revocation_base_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _delayed_payment_base_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _htlc_base_key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _commitment_seed, long _channel_value_satoshis, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_keys_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _rand_bytes_unique_start); + // MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_counterparty_pubkeys")] public static extern long InMemorySigner_counterparty_pubkeys(long _this_arg); + // MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_counterparty_selected_contest_delay")] public static extern short InMemorySigner_counterparty_selected_contest_delay(long _this_arg); + // MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_holder_selected_contest_delay")] public static extern short InMemorySigner_holder_selected_contest_delay(long _this_arg); + // MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_is_outbound")] public static extern bool InMemorySigner_is_outbound(long _this_arg); + // MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_funding_outpoint")] public static extern long InMemorySigner_funding_outpoint(long _this_arg); + // MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_get_channel_parameters")] public static extern long InMemorySigner_get_channel_parameters(long _this_arg); + // MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_channel_type_features")] public static extern long InMemorySigner_channel_type_features(long _this_arg); + // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_sign_counterparty_payment_input")] public static extern long InMemorySigner_sign_counterparty_payment_input(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _spend_tx, long _input_idx, long _descriptor); + // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_sign_dynamic_p2wsh_input")] public static extern long InMemorySigner_sign_dynamic_p2wsh_input(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _spend_tx, long _input_idx, long _descriptor); + // struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_EntropySource")] public static extern long InMemorySigner_as_EntropySource(long _this_arg); + // struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_ChannelSigner")] public static extern long InMemorySigner_as_ChannelSigner(long _this_arg); + // struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_EcdsaChannelSigner")] public static extern long InMemorySigner_as_EcdsaChannelSigner(long _this_arg); + // struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_as_WriteableEcdsaChannelSigner")] public static extern long InMemorySigner_as_WriteableEcdsaChannelSigner(long _this_arg); + // struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_write")] public static extern byte[] InMemorySigner_write(long _obj); + // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_read")] public static extern long InMemorySigner_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, long _arg); + // void KeysManager_free(struct LDKKeysManager this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_free")] public static extern void KeysManager_free(long _this_obj); + // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_new")] public static extern long KeysManager_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _seed, long _starting_time_secs, int _starting_time_nanos); + // MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_get_node_secret_key")] public static extern byte[] KeysManager_get_node_secret_key(long _this_arg); + // MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_derive_channel_keys")] public static extern long KeysManager_derive_channel_keys(long _this_arg, long _channel_value_satoshis, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _params); + // MUST_USE_RES struct LDKCResult_PartiallySignedTransactionNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_sign_spendable_outputs_psbt")] public static extern long KeysManager_sign_spendable_outputs_psbt(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _descriptors, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _psbt); + // MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_PackedLockTimeZ locktime); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_spend_spendable_outputs")] public static extern long KeysManager_spend_spendable_outputs(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _descriptors, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _outputs, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime); + // struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_EntropySource")] public static extern long KeysManager_as_EntropySource(long _this_arg); + // struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_NodeSigner")] public static extern long KeysManager_as_NodeSigner(long _this_arg); + // struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_SignerProvider")] public static extern long KeysManager_as_SignerProvider(long _this_arg); + // void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_free")] public static extern void PhantomKeysManager_free(long _this_obj); + // struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_EntropySource")] public static extern long PhantomKeysManager_as_EntropySource(long _this_arg); + // struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_NodeSigner")] public static extern long PhantomKeysManager_as_NodeSigner(long _this_arg); + // struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_SignerProvider")] public static extern long PhantomKeysManager_as_SignerProvider(long _this_arg); + // MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_new")] public static extern long PhantomKeysManager_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _seed, long _starting_time_secs, int _starting_time_nanos, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _cross_node_seed); + // MUST_USE_RES struct LDKCResult_TransactionNoneZ PhantomKeysManager_spend_spendable_outputs(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_PackedLockTimeZ locktime); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_spend_spendable_outputs")] public static extern long PhantomKeysManager_spend_spendable_outputs(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _descriptors, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _outputs, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime); + // MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_derive_channel_keys")] public static extern long PhantomKeysManager_derive_channel_keys(long _this_arg, long _channel_value_satoshis, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _params); + // MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_get_node_secret_key")] public static extern byte[] PhantomKeysManager_get_node_secret_key(long _this_arg); + // MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_get_phantom_node_secret_key")] public static extern byte[] PhantomKeysManager_get_phantom_node_secret_key(long _this_arg); // void OnionMessenger_free(struct LDKOnionMessenger this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_free")] public static extern void OnionMessenger_free(long _this_obj); + // void MessageRouter_free(struct LDKMessageRouter this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageRouter_free")] public static extern void MessageRouter_free(long _this_ptr); + // void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DefaultMessageRouter_free")] public static extern void DefaultMessageRouter_free(long _this_obj); + // MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DefaultMessageRouter_new")] public static extern long DefaultMessageRouter_new(); + // struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DefaultMessageRouter_as_MessageRouter")] public static extern long DefaultMessageRouter_as_MessageRouter(long _this_arg); + // void OnionMessagePath_free(struct LDKOnionMessagePath this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_free")] public static extern void OnionMessagePath_free(long _this_obj); + // struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_get_intermediate_nodes")] public static extern byte[][] OnionMessagePath_get_intermediate_nodes(long _this_ptr); + // void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_set_intermediate_nodes")] public static extern void OnionMessagePath_set_intermediate_nodes(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _val); + // struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_get_destination")] public static extern long OnionMessagePath_get_destination(long _this_ptr); + // void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_set_destination")] public static extern void OnionMessagePath_set_destination(long _this_ptr, long _val); + // MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_new")] public static extern long OnionMessagePath_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _intermediate_nodes_arg, long _destination_arg); + // uint64_t OnionMessagePath_clone_ptr(LDKOnionMessagePath *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_clone_ptr")] public static extern long OnionMessagePath_clone_ptr(long _arg); + // struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessagePath_clone")] public static extern long OnionMessagePath_clone(long _orig); // void Destination_free(struct LDKDestination this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_free")] public static extern void Destination_free(long _this_ptr); // uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg); @@ -7566,7 +9727,7 @@ internal class bindings { // struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_clone")] public static extern long Destination_clone(long _orig); // struct LDKDestination Destination_node(struct LDKPublicKey a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_node")] public static extern long Destination_node(byte[] _a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_node")] public static extern long Destination_node([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a); // struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_blinded_path")] public static extern long Destination_blinded_path(long _a); // void SendError_free(struct LDKSendError this_ptr); @@ -7595,20 +9756,44 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendError_eq")] public static extern bool SendError_eq(long _a, long _b); // void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageHandler_free")] public static extern void CustomOnionMessageHandler_free(long _this_ptr); - // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKKeysInterface keys_manager, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_new")] public static extern long OnionMessenger_new(long _keys_manager, long _logger, long _custom_handler); - // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_send_onion_message")] public static extern long OnionMessenger_send_onion_message(long _this_arg, byte[][] _intermediate_nodes, long _destination, long _message, long _reply_path); + // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_new")] public static extern long OnionMessenger_new(long _entropy_source, long _node_signer, long _logger, long _message_router, long _offers_handler, long _custom_handler); + // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessagePath path, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_send_onion_message")] public static extern long OnionMessenger_send_onion_message(long _this_arg, long _path, long _message, long _reply_path); // struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_as_OnionMessageHandler")] public static extern long OnionMessenger_as_OnionMessageHandler(long _this_arg); // struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_as_OnionMessageProvider")] public static extern long OnionMessenger_as_OnionMessageProvider(long _this_arg); + // void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageHandler_free")] public static extern void OffersMessageHandler_free(long _this_ptr); + // void OffersMessage_free(struct LDKOffersMessage this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_free")] public static extern void OffersMessage_free(long _this_ptr); + // uint64_t OffersMessage_clone_ptr(LDKOffersMessage *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_clone_ptr")] public static extern long OffersMessage_clone_ptr(long _arg); + // struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_clone")] public static extern long OffersMessage_clone(long _orig); + // struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_invoice_request")] public static extern long OffersMessage_invoice_request(long _a); + // struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_invoice")] public static extern long OffersMessage_invoice(long _a); + // struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_invoice_error")] public static extern long OffersMessage_invoice_error(long _a); + // MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_is_known_type")] public static extern bool OffersMessage_is_known_type(long _tlv_type); + // MUST_USE_RES uint64_t OffersMessage_tlv_type(const struct LDKOffersMessage *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_tlv_type")] public static extern long OffersMessage_tlv_type(long _this_arg); + // struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_write")] public static extern byte[] OffersMessage_write(long _obj); + // struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessage_read")] public static extern long OffersMessage_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser, long _arg_a, long _arg_b); // void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_free")] public static extern void OnionMessageContents_free(long _this_ptr); // uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_clone_ptr")] public static extern long OnionMessageContents_clone_ptr(long _arg); // struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_clone")] public static extern long OnionMessageContents_clone(long _orig); + // struct LDKOnionMessageContents OnionMessageContents_offers(struct LDKOffersMessage a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_offers")] public static extern long OnionMessageContents_offers(long _a); // struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_custom")] public static extern long OnionMessageContents_custom(long _a); // uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg); @@ -7617,14 +9802,466 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageContents_clone")] public static extern long CustomOnionMessageContents_clone(long _orig); // void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CustomOnionMessageContents_free")] public static extern void CustomOnionMessageContents_free(long _this_ptr); + // void BlindedPath_free(struct LDKBlindedPath this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_free")] public static extern void BlindedPath_free(long _this_obj); + // uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_clone_ptr")] public static extern long BlindedPath_clone_ptr(long _arg); + // struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_clone")] public static extern long BlindedPath_clone(long _orig); + // uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_hash")] public static extern long BlindedPath_hash(long _o); + // bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_eq")] public static extern bool BlindedPath_eq(long _a, long _b); + // void BlindedHop_free(struct LDKBlindedHop this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_free")] public static extern void BlindedHop_free(long _this_obj); + // uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_clone_ptr")] public static extern long BlindedHop_clone_ptr(long _arg); + // struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_clone")] public static extern long BlindedHop_clone(long _orig); + // uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_hash")] public static extern long BlindedHop_hash(long _o); + // bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_eq")] public static extern bool BlindedHop_eq(long _a, long _b); + // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_new_for_message")] public static extern long BlindedPath_new_for_message([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[][] _node_pks, long _entropy_source); + // struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_write")] public static extern byte[] BlindedPath_write(long _obj); + // struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_read")] public static extern long BlindedPath_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_write")] public static extern byte[] BlindedHop_write(long _obj); + // struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_read")] public static extern long BlindedHop_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_free")] public static extern void PaymentPurpose_free(long _this_ptr); + // uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_clone_ptr")] public static extern long PaymentPurpose_clone_ptr(long _arg); + // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_clone")] public static extern long PaymentPurpose_clone(long _orig); + // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_PaymentPreimageZ payment_preimage, struct LDKThirtyTwoBytes payment_secret); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_invoice_payment")] public static extern long PaymentPurpose_invoice_payment(long _payment_preimage, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_secret); + // struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_spontaneous_payment")] public static extern long PaymentPurpose_spontaneous_payment([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a); + // bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_eq")] public static extern bool PaymentPurpose_eq(long _a, long _b); + // struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_write")] public static extern byte[] PaymentPurpose_write(long _obj); + // struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_read")] public static extern long PaymentPurpose_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void PathFailure_free(struct LDKPathFailure this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_free")] public static extern void PathFailure_free(long _this_ptr); + // uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_clone_ptr")] public static extern long PathFailure_clone_ptr(long _arg); + // struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_clone")] public static extern long PathFailure_clone(long _orig); + // struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_initial_send")] public static extern long PathFailure_initial_send(long _err); + // struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_on_path")] public static extern long PathFailure_on_path(long _network_update); + // bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_eq")] public static extern bool PathFailure_eq(long _a, long _b); + // struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_write")] public static extern byte[] PathFailure_write(long _obj); + // struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PathFailure_read")] public static extern long PathFailure_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void ClosureReason_free(struct LDKClosureReason this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_free")] public static extern void ClosureReason_free(long _this_ptr); + // uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_clone_ptr")] public static extern long ClosureReason_clone_ptr(long _arg); + // struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_clone")] public static extern long ClosureReason_clone(long _orig); + // struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_counterparty_force_closed")] public static extern long ClosureReason_counterparty_force_closed(long _peer_msg); + // struct LDKClosureReason ClosureReason_holder_force_closed(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_holder_force_closed")] public static extern long ClosureReason_holder_force_closed(); + // struct LDKClosureReason ClosureReason_cooperative_closure(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_cooperative_closure")] public static extern long ClosureReason_cooperative_closure(); + // struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_commitment_tx_confirmed")] public static extern long ClosureReason_commitment_tx_confirmed(); + // struct LDKClosureReason ClosureReason_funding_timed_out(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_funding_timed_out")] public static extern long ClosureReason_funding_timed_out(); + // struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_processing_error")] public static extern long ClosureReason_processing_error(string _err); + // struct LDKClosureReason ClosureReason_disconnected_peer(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_disconnected_peer")] public static extern long ClosureReason_disconnected_peer(); + // struct LDKClosureReason ClosureReason_outdated_channel_manager(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_outdated_channel_manager")] public static extern long ClosureReason_outdated_channel_manager(); + // struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_counterparty_coop_closed_unfunded_channel")] public static extern long ClosureReason_counterparty_coop_closed_unfunded_channel(); + // bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_eq")] public static extern bool ClosureReason_eq(long _a, long _b); + // struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_write")] public static extern byte[] ClosureReason_write(long _obj); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_read")] public static extern long ClosureReason_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void HTLCDestination_free(struct LDKHTLCDestination this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_free")] public static extern void HTLCDestination_free(long _this_ptr); + // uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_clone_ptr")] public static extern long HTLCDestination_clone_ptr(long _arg); + // struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_clone")] public static extern long HTLCDestination_clone(long _orig); + // struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_next_hop_channel")] public static extern long HTLCDestination_next_hop_channel([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id); + // struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_unknown_next_hop")] public static extern long HTLCDestination_unknown_next_hop(long _requested_forward_scid); + // struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_invalid_forward")] public static extern long HTLCDestination_invalid_forward(long _requested_forward_scid); + // struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_failed_payment")] public static extern long HTLCDestination_failed_payment([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash); + // bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_eq")] public static extern bool HTLCDestination_eq(long _a, long _b); + // struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_write")] public static extern byte[] HTLCDestination_write(long _obj); + // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_read")] public static extern long HTLCDestination_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_clone")] public static extern PaymentFailureReason PaymentFailureReason_clone(long _orig); + // enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_recipient_rejected")] public static extern PaymentFailureReason PaymentFailureReason_recipient_rejected(); + // enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_user_abandoned")] public static extern PaymentFailureReason PaymentFailureReason_user_abandoned(); + // enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_retries_exhausted")] public static extern PaymentFailureReason PaymentFailureReason_retries_exhausted(); + // enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_payment_expired")] public static extern PaymentFailureReason PaymentFailureReason_payment_expired(); + // enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_route_not_found")] public static extern PaymentFailureReason PaymentFailureReason_route_not_found(); + // enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_unexpected_error")] public static extern PaymentFailureReason PaymentFailureReason_unexpected_error(); + // bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_eq")] public static extern bool PaymentFailureReason_eq(long _a, long _b); + // struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_write")] public static extern byte[] PaymentFailureReason_write(long _obj); + // struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentFailureReason_read")] public static extern long PaymentFailureReason_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void Event_free(struct LDKEvent this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_free")] public static extern void Event_free(long _this_ptr); + // uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_clone_ptr")] public static extern long Event_clone_ptr(long _arg); + // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_clone")] public static extern long Event_clone(long _orig); + // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_funding_generation_ready")] public static extern long Event_funding_generation_ready([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, long _channel_value_satoshis, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _output_script, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id); + // struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKThirtyTwoBytes via_channel_id, struct LDKCOption_u128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_claimable")] public static extern long Event_payment_claimable([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _receiver_node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _onion_fields, long _amount_msat, long _counterparty_skimmed_fee_msat, long _purpose, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _via_channel_id, long _via_user_channel_id, long _claim_deadline); + // struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_claimed")] public static extern long Event_payment_claimed([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _receiver_node_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _amount_msat, long _purpose); + // struct LDKEvent Event_payment_sent(struct LDKCOption_PaymentIdZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_sent")] public static extern long Event_payment_sent(long _payment_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_preimage, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _fee_paid_msat); + // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_failed")] public static extern long Event_payment_failed([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _reason); + // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_PaymentHashZ payment_hash, struct LDKPath path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_path_successful")] public static extern long Event_payment_path_successful([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, long _payment_hash, long _path); + // struct LDKEvent Event_payment_path_failed(struct LDKCOption_PaymentIdZ payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_path_failed")] public static extern long Event_payment_path_failed(long _payment_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, bool _payment_failed_permanently, long _failure, long _path, long _short_channel_id); + // struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_probe_successful")] public static extern long Event_probe_successful([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _path); + // struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_probe_failed")] public static extern long Event_probe_failed([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _path, long _short_channel_id); + // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_pending_htlcs_forwardable")] public static extern long Event_pending_htlcs_forwardable(long _time_forwardable); + // struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_htlcintercepted")] public static extern long Event_htlcintercepted([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _intercept_id, long _requested_next_hop_scid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _inbound_amount_msat, long _expected_outbound_amount_msat); + // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_spendable_outputs")] public static extern long Event_spendable_outputs([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _outputs); + // struct LDKEvent Event_payment_forwarded(struct LDKThirtyTwoBytes prev_channel_id, struct LDKThirtyTwoBytes next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_forwarded")] public static extern long Event_payment_forwarded([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _prev_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _next_channel_id, long _fee_earned_msat, bool _claim_from_onchain_tx, long _outbound_amount_forwarded_msat); + // struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKThirtyTwoBytes former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_pending")] public static extern long Event_channel_pending([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _former_temporary_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, long _funding_txo); + // struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_ready")] public static extern long Event_channel_ready([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, long _channel_type); + // struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_closed")] public static extern long Event_channel_closed([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _user_channel_id, long _reason); + // struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_discard_funding")] public static extern long Event_discard_funding([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _transaction); + // struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_open_channel_request")] public static extern long Event_open_channel_request([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _temporary_channel_id, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _counterparty_node_id, long _funding_satoshis, long _push_msat, long _channel_type); + // struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_htlchandling_failed")] public static extern long Event_htlchandling_failed([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _prev_channel_id, long _failed_next_destination); + // struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_bump_transaction")] public static extern long Event_bump_transaction(long _a); + // bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_eq")] public static extern bool Event_eq(long _a, long _b); + // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_write")] public static extern byte[] Event_write(long _obj); + // struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_read")] public static extern long Event_read([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _ser); + // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_free")] public static extern void MessageSendEvent_free(long _this_ptr); + // uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_clone_ptr")] public static extern long MessageSendEvent_clone_ptr(long _arg); + // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_clone")] public static extern long MessageSendEvent_clone(long _orig); + // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_accept_channel")] public static extern long MessageSendEvent_send_accept_channel([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_accept_channel_v2")] public static extern long MessageSendEvent_send_accept_channel_v2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_open_channel")] public static extern long MessageSendEvent_send_open_channel([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_open_channel_v2")] public static extern long MessageSendEvent_send_open_channel_v2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_funding_created")] public static extern long MessageSendEvent_send_funding_created([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_funding_signed")] public static extern long MessageSendEvent_send_funding_signed([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_add_input")] public static extern long MessageSendEvent_send_tx_add_input([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_add_output")] public static extern long MessageSendEvent_send_tx_add_output([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_remove_input")] public static extern long MessageSendEvent_send_tx_remove_input([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_remove_output")] public static extern long MessageSendEvent_send_tx_remove_output([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_complete")] public static extern long MessageSendEvent_send_tx_complete([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_signatures")] public static extern long MessageSendEvent_send_tx_signatures([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_init_rbf")] public static extern long MessageSendEvent_send_tx_init_rbf([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_ack_rbf")] public static extern long MessageSendEvent_send_tx_ack_rbf([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAddInput msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_tx_abort")] public static extern long MessageSendEvent_send_tx_abort([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_ready")] public static extern long MessageSendEvent_send_channel_ready([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_announcement_signatures")] public static extern long MessageSendEvent_send_announcement_signatures([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_update_htlcs")] public static extern long MessageSendEvent_update_htlcs([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _updates); + // struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_revoke_and_ack")] public static extern long MessageSendEvent_send_revoke_and_ack([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_closing_signed")] public static extern long MessageSendEvent_send_closing_signed([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_shutdown")] public static extern long MessageSendEvent_send_shutdown([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_reestablish")] public static extern long MessageSendEvent_send_channel_reestablish([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_announcement")] public static extern long MessageSendEvent_send_channel_announcement([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg, long _update_msg); + // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_broadcast_channel_announcement")] public static extern long MessageSendEvent_broadcast_channel_announcement(long _msg, long _update_msg); + // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_broadcast_channel_update")] public static extern long MessageSendEvent_broadcast_channel_update(long _msg); + // struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_broadcast_node_announcement")] public static extern long MessageSendEvent_broadcast_node_announcement(long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_update")] public static extern long MessageSendEvent_send_channel_update([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_handle_error")] public static extern long MessageSendEvent_handle_error([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _action); + // struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_channel_range_query")] public static extern long MessageSendEvent_send_channel_range_query([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_short_ids_query")] public static extern long MessageSendEvent_send_short_ids_query([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_reply_channel_range")] public static extern long MessageSendEvent_send_reply_channel_range([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEvent_send_gossip_timestamp_filter")] public static extern long MessageSendEvent_send_gossip_timestamp_filter([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _node_id, long _msg); + // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MessageSendEventsProvider_free")] public static extern void MessageSendEventsProvider_free(long _this_ptr); + // void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageProvider_free")] public static extern void OnionMessageProvider_free(long _this_ptr); + // void EventsProvider_free(struct LDKEventsProvider this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventsProvider_free")] public static extern void EventsProvider_free(long _this_ptr); + // void EventHandler_free(struct LDKEventHandler this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EventHandler_free")] public static extern void EventHandler_free(long _this_ptr); + // void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_free")] public static extern void ChannelDerivationParameters_free(long _this_obj); + // uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_get_value_satoshis")] public static extern long ChannelDerivationParameters_get_value_satoshis(long _this_ptr); + // void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_set_value_satoshis")] public static extern void ChannelDerivationParameters_set_value_satoshis(long _this_ptr, long _val); + // const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_get_keys_id")] public static extern byte[] ChannelDerivationParameters_get_keys_id(long _this_ptr); + // void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_set_keys_id")] public static extern void ChannelDerivationParameters_set_keys_id(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_get_transaction_parameters")] public static extern long ChannelDerivationParameters_get_transaction_parameters(long _this_ptr); + // void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_set_transaction_parameters")] public static extern void ChannelDerivationParameters_set_transaction_parameters(long _this_ptr, long _val); + // MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_new")] public static extern long ChannelDerivationParameters_new(long _value_satoshis_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _keys_id_arg, long _transaction_parameters_arg); + // uint64_t ChannelDerivationParameters_clone_ptr(LDKChannelDerivationParameters *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_clone_ptr")] public static extern long ChannelDerivationParameters_clone_ptr(long _arg); + // struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_clone")] public static extern long ChannelDerivationParameters_clone(long _orig); + // bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_eq")] public static extern bool ChannelDerivationParameters_eq(long _a, long _b); + // void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_free")] public static extern void AnchorDescriptor_free(long _this_obj); + // struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_get_channel_derivation_parameters")] public static extern long AnchorDescriptor_get_channel_derivation_parameters(long _this_ptr); + // void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_set_channel_derivation_parameters")] public static extern void AnchorDescriptor_set_channel_derivation_parameters(long _this_ptr, long _val); + // struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_get_outpoint")] public static extern long AnchorDescriptor_get_outpoint(long _this_ptr); + // void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_set_outpoint")] public static extern void AnchorDescriptor_set_outpoint(long _this_ptr, long _val); + // MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_new")] public static extern long AnchorDescriptor_new(long _channel_derivation_parameters_arg, long _outpoint_arg); + // uint64_t AnchorDescriptor_clone_ptr(LDKAnchorDescriptor *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_clone_ptr")] public static extern long AnchorDescriptor_clone_ptr(long _arg); + // struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_clone")] public static extern long AnchorDescriptor_clone(long _orig); + // bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_eq")] public static extern bool AnchorDescriptor_eq(long _a, long _b); + // MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_previous_utxo")] public static extern long AnchorDescriptor_previous_utxo(long _this_arg); + // MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_unsigned_tx_input")] public static extern long AnchorDescriptor_unsigned_tx_input(long _this_arg); + // MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_witness_script")] public static extern byte[] AnchorDescriptor_witness_script(long _this_arg); + // MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKSignature signature); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_tx_input_witness")] public static extern byte[] AnchorDescriptor_tx_input_witness(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature); + // MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnchorDescriptor_derive_channel_signer")] public static extern long AnchorDescriptor_derive_channel_signer(long _this_arg, long _signer_provider); + // void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_free")] public static extern void HTLCDescriptor_free(long _this_obj); + // struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_channel_derivation_parameters")] public static extern long HTLCDescriptor_get_channel_derivation_parameters(long _this_ptr); + // void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_channel_derivation_parameters")] public static extern void HTLCDescriptor_set_channel_derivation_parameters(long _this_ptr, long _val); + // uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_per_commitment_number")] public static extern long HTLCDescriptor_get_per_commitment_number(long _this_ptr); + // void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_per_commitment_number")] public static extern void HTLCDescriptor_set_per_commitment_number(long _this_ptr, long _val); + // struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_per_commitment_point")] public static extern byte[] HTLCDescriptor_get_per_commitment_point(long _this_ptr); + // void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_per_commitment_point")] public static extern void HTLCDescriptor_set_per_commitment_point(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_htlc")] public static extern long HTLCDescriptor_get_htlc(long _this_ptr); + // void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_htlc")] public static extern void HTLCDescriptor_set_htlc(long _this_ptr, long _val); + // struct LDKCOption_PaymentPreimageZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_preimage")] public static extern long HTLCDescriptor_get_preimage(long _this_ptr); + // void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_PaymentPreimageZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_preimage")] public static extern void HTLCDescriptor_set_preimage(long _this_ptr, long _val); + // struct LDKSignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_counterparty_sig")] public static extern byte[] HTLCDescriptor_get_counterparty_sig(long _this_ptr); + // void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKSignature val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_counterparty_sig")] public static extern void HTLCDescriptor_set_counterparty_sig(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); + // uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_clone_ptr")] public static extern long HTLCDescriptor_clone_ptr(long _arg); + // struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_clone")] public static extern long HTLCDescriptor_clone(long _orig); + // bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_eq")] public static extern bool HTLCDescriptor_eq(long _a, long _b); + // MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_outpoint")] public static extern long HTLCDescriptor_outpoint(long _this_arg); + // MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_previous_utxo")] public static extern long HTLCDescriptor_previous_utxo(long _this_arg); + // MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_unsigned_tx_input")] public static extern long HTLCDescriptor_unsigned_tx_input(long _this_arg); + // MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_tx_output")] public static extern long HTLCDescriptor_tx_output(long _this_arg); + // MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_witness_script")] public static extern byte[] HTLCDescriptor_witness_script(long _this_arg); + // MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKSignature signature, struct LDKu8slice witness_script); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_tx_input_witness")] public static extern byte[] HTLCDescriptor_tx_input_witness(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _signature, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _witness_script); + // MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_derive_channel_signer")] public static extern long HTLCDescriptor_derive_channel_signer(long _this_arg, long _signer_provider); + // void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_free")] public static extern void BumpTransactionEvent_free(long _this_ptr); + // uint64_t BumpTransactionEvent_clone_ptr(LDKBumpTransactionEvent *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_clone_ptr")] public static extern long BumpTransactionEvent_clone_ptr(long _arg); + // struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_clone")] public static extern long BumpTransactionEvent_clone(long _orig); + // struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_channel_close")] public static extern long BumpTransactionEvent_channel_close([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _claim_id, int _package_target_feerate_sat_per_1000_weight, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _commitment_tx, long _commitment_tx_fee_satoshis, long _anchor_descriptor, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _pending_htlcs); + // struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_htlcresolution")] public static extern long BumpTransactionEvent_htlcresolution([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _claim_id, int _target_feerate_sat_per_1000_weight, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _htlc_descriptors, int _tx_lock_time); + // bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_eq")] public static extern bool BumpTransactionEvent_eq(long _a, long _b); + // void Input_free(struct LDKInput this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_free")] public static extern void Input_free(long _this_obj); + // struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_get_outpoint")] public static extern long Input_get_outpoint(long _this_ptr); + // void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_set_outpoint")] public static extern void Input_set_outpoint(long _this_ptr, long _val); + // struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_get_previous_utxo")] public static extern long Input_get_previous_utxo(long _this_ptr); + // void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_set_previous_utxo")] public static extern void Input_set_previous_utxo(long _this_ptr, long _val); + // uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_get_satisfaction_weight")] public static extern long Input_get_satisfaction_weight(long _this_ptr); + // void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_set_satisfaction_weight")] public static extern void Input_set_satisfaction_weight(long _this_ptr, long _val); + // MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_new")] public static extern long Input_new(long _outpoint_arg, long _previous_utxo_arg, long _satisfaction_weight_arg); + // uint64_t Input_clone_ptr(LDKInput *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_clone_ptr")] public static extern long Input_clone_ptr(long _arg); + // struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_clone")] public static extern long Input_clone(long _orig); + // uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_hash")] public static extern long Input_hash(long _o); + // bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Input_eq")] public static extern bool Input_eq(long _a, long _b); + // void Utxo_free(struct LDKUtxo this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_free")] public static extern void Utxo_free(long _this_obj); + // struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_get_outpoint")] public static extern long Utxo_get_outpoint(long _this_ptr); + // void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_set_outpoint")] public static extern void Utxo_set_outpoint(long _this_ptr, long _val); + // struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_get_output")] public static extern long Utxo_get_output(long _this_ptr); + // void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_set_output")] public static extern void Utxo_set_output(long _this_ptr, long _val); + // uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_get_satisfaction_weight")] public static extern long Utxo_get_satisfaction_weight(long _this_ptr); + // void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_set_satisfaction_weight")] public static extern void Utxo_set_satisfaction_weight(long _this_ptr, long _val); + // MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_new")] public static extern long Utxo_new(long _outpoint_arg, long _output_arg, long _satisfaction_weight_arg); + // uint64_t Utxo_clone_ptr(LDKUtxo *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_clone_ptr")] public static extern long Utxo_clone_ptr(long _arg); + // struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_clone")] public static extern long Utxo_clone(long _orig); + // uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_hash")] public static extern long Utxo_hash(long _o); + // bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_eq")] public static extern bool Utxo_eq(long _a, long _b); + // MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Utxo_new_p2pkh")] public static extern long Utxo_new_p2pkh(long _outpoint, long _value, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _pubkey_hash); + // void CoinSelection_free(struct LDKCoinSelection this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_free")] public static extern void CoinSelection_free(long _this_obj); + // struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_get_confirmed_utxos")] public static extern long[] CoinSelection_get_confirmed_utxos(long _this_ptr); + // void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_set_confirmed_utxos")] public static extern void CoinSelection_set_confirmed_utxos(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _val); + // struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_get_change_output")] public static extern long CoinSelection_get_change_output(long _this_ptr); + // void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_set_change_output")] public static extern void CoinSelection_set_change_output(long _this_ptr, long _val); + // MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_new")] public static extern long CoinSelection_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _confirmed_utxos_arg, long _change_output_arg); + // uint64_t CoinSelection_clone_ptr(LDKCoinSelection *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_clone_ptr")] public static extern long CoinSelection_clone_ptr(long _arg); + // struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelection_clone")] public static extern long CoinSelection_clone(long _orig); + // void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CoinSelectionSource_free")] public static extern void CoinSelectionSource_free(long _this_ptr); + // void WalletSource_free(struct LDKWalletSource this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WalletSource_free")] public static extern void WalletSource_free(long _this_ptr); + // void Wallet_free(struct LDKWallet this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Wallet_free")] public static extern void Wallet_free(long _this_obj); + // MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Wallet_new")] public static extern long Wallet_new(long _source, long _logger); + // struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Wallet_as_CoinSelectionSource")] public static extern long Wallet_as_CoinSelectionSource(long _this_arg); + // void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEventHandler_free")] public static extern void BumpTransactionEventHandler_free(long _this_obj); + // MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEventHandler_new")] public static extern long BumpTransactionEventHandler_new(long _broadcaster, long _utxo_source, long _signer_provider, long _logger); + // void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEventHandler_handle_event")] public static extern void BumpTransactionEventHandler_handle_event(long _this_arg, long _event); // void FilesystemPersister_free(struct LDKFilesystemPersister this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FilesystemPersister_free")] public static extern void FilesystemPersister_free(long _this_obj); // MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FilesystemPersister_new")] public static extern long FilesystemPersister_new(string _path_to_channel_data); // MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FilesystemPersister_get_data_dir")] public static extern string FilesystemPersister_get_data_dir(long _this_arg); - // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FilesystemPersister_read_channelmonitors")] public static extern long FilesystemPersister_read_channelmonitors(long _this_arg, long _keys_manager); + // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKEntropySource entropy_source, const struct LDKSignerProvider *NONNULL_PTR signer_provider); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FilesystemPersister_read_channelmonitors")] public static extern long FilesystemPersister_read_channelmonitors(long _this_arg, long _entropy_source, long _signer_provider); // void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BackgroundProcessor_free")] public static extern void BackgroundProcessor_free(long _this_obj); // void GossipSync_free(struct LDKGossipSync this_ptr); @@ -7641,96 +10278,96 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BackgroundProcessor_join")] public static extern long BackgroundProcessor_join(long _this_arg); // MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BackgroundProcessor_stop")] public static extern long BackgroundProcessor_stop(long _this_arg); - // void ParseError_free(struct LDKParseError this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_free")] public static extern void ParseError_free(long _this_ptr); - // uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_clone_ptr")] public static extern long ParseError_clone_ptr(long _arg); - // struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_clone")] public static extern long ParseError_clone(long _orig); - // struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_bech32_error")] public static extern long ParseError_bech32_error(long _a); - // struct LDKParseError ParseError_parse_amount_error(struct LDKError a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_parse_amount_error")] public static extern long ParseError_parse_amount_error(int _a); - // struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_malformed_signature")] public static extern long ParseError_malformed_signature(Secp256k1Error _a); - // struct LDKParseError ParseError_bad_prefix(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_bad_prefix")] public static extern long ParseError_bad_prefix(); - // struct LDKParseError ParseError_unknown_currency(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_unknown_currency")] public static extern long ParseError_unknown_currency(); - // struct LDKParseError ParseError_unknown_si_prefix(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_unknown_si_prefix")] public static extern long ParseError_unknown_si_prefix(); - // struct LDKParseError ParseError_malformed_hrp(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_malformed_hrp")] public static extern long ParseError_malformed_hrp(); - // struct LDKParseError ParseError_too_short_data_part(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_too_short_data_part")] public static extern long ParseError_too_short_data_part(); - // struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_unexpected_end_of_tagged_fields")] public static extern long ParseError_unexpected_end_of_tagged_fields(); - // struct LDKParseError ParseError_description_decode_error(struct LDKError a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_description_decode_error")] public static extern long ParseError_description_decode_error(int _a); - // struct LDKParseError ParseError_padding_error(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_padding_error")] public static extern long ParseError_padding_error(); - // struct LDKParseError ParseError_integer_overflow_error(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_integer_overflow_error")] public static extern long ParseError_integer_overflow_error(); - // struct LDKParseError ParseError_invalid_seg_wit_program_length(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_invalid_seg_wit_program_length")] public static extern long ParseError_invalid_seg_wit_program_length(); - // struct LDKParseError ParseError_invalid_pub_key_hash_length(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_invalid_pub_key_hash_length")] public static extern long ParseError_invalid_pub_key_hash_length(); - // struct LDKParseError ParseError_invalid_script_hash_length(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_invalid_script_hash_length")] public static extern long ParseError_invalid_script_hash_length(); - // struct LDKParseError ParseError_invalid_recovery_id(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_invalid_recovery_id")] public static extern long ParseError_invalid_recovery_id(); - // struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_invalid_slice_length")] public static extern long ParseError_invalid_slice_length(string _a); - // struct LDKParseError ParseError_skip(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_skip")] public static extern long ParseError_skip(); - // bool ParseError_eq(const struct LDKParseError *NONNULL_PTR a, const struct LDKParseError *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_eq")] public static extern bool ParseError_eq(long _a, long _b); + // void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_free")] public static extern void Bolt11ParseError_free(long _this_ptr); + // uint64_t Bolt11ParseError_clone_ptr(LDKBolt11ParseError *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_clone_ptr")] public static extern long Bolt11ParseError_clone_ptr(long _arg); + // struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_clone")] public static extern long Bolt11ParseError_clone(long _orig); + // struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_bech32_error")] public static extern long Bolt11ParseError_bech32_error(long _a); + // struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_parse_amount_error")] public static extern long Bolt11ParseError_parse_amount_error(int _a); + // struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_malformed_signature")] public static extern long Bolt11ParseError_malformed_signature(Secp256k1Error _a); + // struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_bad_prefix")] public static extern long Bolt11ParseError_bad_prefix(); + // struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_unknown_currency")] public static extern long Bolt11ParseError_unknown_currency(); + // struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_unknown_si_prefix")] public static extern long Bolt11ParseError_unknown_si_prefix(); + // struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_malformed_hrp")] public static extern long Bolt11ParseError_malformed_hrp(); + // struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_too_short_data_part")] public static extern long Bolt11ParseError_too_short_data_part(); + // struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_unexpected_end_of_tagged_fields")] public static extern long Bolt11ParseError_unexpected_end_of_tagged_fields(); + // struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_description_decode_error")] public static extern long Bolt11ParseError_description_decode_error(int _a); + // struct LDKBolt11ParseError Bolt11ParseError_padding_error(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_padding_error")] public static extern long Bolt11ParseError_padding_error(); + // struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_integer_overflow_error")] public static extern long Bolt11ParseError_integer_overflow_error(); + // struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_invalid_seg_wit_program_length")] public static extern long Bolt11ParseError_invalid_seg_wit_program_length(); + // struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_invalid_pub_key_hash_length")] public static extern long Bolt11ParseError_invalid_pub_key_hash_length(); + // struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_invalid_script_hash_length")] public static extern long Bolt11ParseError_invalid_script_hash_length(); + // struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_invalid_recovery_id")] public static extern long Bolt11ParseError_invalid_recovery_id(); + // struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_invalid_slice_length")] public static extern long Bolt11ParseError_invalid_slice_length(string _a); + // struct LDKBolt11ParseError Bolt11ParseError_skip(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_skip")] public static extern long Bolt11ParseError_skip(); + // bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_eq")] public static extern bool Bolt11ParseError_eq(long _a, long _b); // void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_free")] public static extern void ParseOrSemanticError_free(long _this_ptr); // uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_clone_ptr")] public static extern long ParseOrSemanticError_clone_ptr(long _arg); // struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_clone")] public static extern long ParseOrSemanticError_clone(long _orig); - // struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a); + // struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_parse_error")] public static extern long ParseOrSemanticError_parse_error(long _a); - // struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_semantic_error")] public static extern long ParseOrSemanticError_semantic_error(SemanticError _a); + // struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_semantic_error")] public static extern long ParseOrSemanticError_semantic_error(Bolt11SemanticError _a); // bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_eq")] public static extern bool ParseOrSemanticError_eq(long _a, long _b); - // void Invoice_free(struct LDKInvoice this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_free")] public static extern void Invoice_free(long _this_obj); - // bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_eq")] public static extern bool Invoice_eq(long _a, long _b); - // uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_clone_ptr")] public static extern long Invoice_clone_ptr(long _arg); - // struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_clone")] public static extern long Invoice_clone(long _orig); - // uint64_t Invoice_hash(const struct LDKInvoice *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_hash")] public static extern long Invoice_hash(long _o); - // void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_free")] public static extern void SignedRawInvoice_free(long _this_obj); - // bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_eq")] public static extern bool SignedRawInvoice_eq(long _a, long _b); - // uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_clone_ptr")] public static extern long SignedRawInvoice_clone_ptr(long _arg); - // struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_clone")] public static extern long SignedRawInvoice_clone(long _orig); - // uint64_t SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_hash")] public static extern long SignedRawInvoice_hash(long _o); - // void RawInvoice_free(struct LDKRawInvoice this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_free")] public static extern void RawInvoice_free(long _this_obj); - // struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_get_data")] public static extern long RawInvoice_get_data(long _this_ptr); - // void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_set_data")] public static extern void RawInvoice_set_data(long _this_ptr, long _val); - // bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_eq")] public static extern bool RawInvoice_eq(long _a, long _b); - // uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_clone_ptr")] public static extern long RawInvoice_clone_ptr(long _arg); - // struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_clone")] public static extern long RawInvoice_clone(long _orig); - // uint64_t RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_hash")] public static extern long RawInvoice_hash(long _o); + // void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_free")] public static extern void Bolt11Invoice_free(long _this_obj); + // bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_eq")] public static extern bool Bolt11Invoice_eq(long _a, long _b); + // uint64_t Bolt11Invoice_clone_ptr(LDKBolt11Invoice *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_clone_ptr")] public static extern long Bolt11Invoice_clone_ptr(long _arg); + // struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_clone")] public static extern long Bolt11Invoice_clone(long _orig); + // uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_hash")] public static extern long Bolt11Invoice_hash(long _o); + // void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_free")] public static extern void SignedRawBolt11Invoice_free(long _this_obj); + // bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_eq")] public static extern bool SignedRawBolt11Invoice_eq(long _a, long _b); + // uint64_t SignedRawBolt11Invoice_clone_ptr(LDKSignedRawBolt11Invoice *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_clone_ptr")] public static extern long SignedRawBolt11Invoice_clone_ptr(long _arg); + // struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_clone")] public static extern long SignedRawBolt11Invoice_clone(long _orig); + // uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_hash")] public static extern long SignedRawBolt11Invoice_hash(long _o); + // void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_free")] public static extern void RawBolt11Invoice_free(long _this_obj); + // struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_get_data")] public static extern long RawBolt11Invoice_get_data(long _this_ptr); + // void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_set_data")] public static extern void RawBolt11Invoice_set_data(long _this_ptr, long _val); + // bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_eq")] public static extern bool RawBolt11Invoice_eq(long _a, long _b); + // uint64_t RawBolt11Invoice_clone_ptr(LDKRawBolt11Invoice *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_clone_ptr")] public static extern long RawBolt11Invoice_clone_ptr(long _arg); + // struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_clone")] public static extern long RawBolt11Invoice_clone(long _orig); + // uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_hash")] public static extern long RawBolt11Invoice_hash(long _o); // void RawDataPart_free(struct LDKRawDataPart this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawDataPart_free")] public static extern void RawDataPart_free(long _this_obj); // struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr); @@ -7797,6 +10434,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sha256_hash")] public static extern long Sha256_hash(long _o); // bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sha256_eq")] public static extern bool Sha256_eq(long _a, long _b); + // MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sha256_from_bytes")] public static extern long Sha256_from_bytes([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _bytes); // void Description_free(struct LDKDescription this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Description_free")] public static extern void Description_free(long _this_obj); // uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg); @@ -7812,9 +10451,9 @@ internal class bindings { // struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PayeePubKey_get_a")] public static extern byte[] PayeePubKey_get_a(long _this_ptr); // void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PayeePubKey_set_a")] public static extern void PayeePubKey_set_a(long _this_ptr, byte[] _val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PayeePubKey_set_a")] public static extern void PayeePubKey_set_a(long _this_ptr, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _val); // MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PayeePubKey_new")] public static extern long PayeePubKey_new(byte[] _a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PayeePubKey_new")] public static extern long PayeePubKey_new([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a_arg); // uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PayeePubKey_clone_ptr")] public static extern long PayeePubKey_clone_ptr(long _arg); // struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig); @@ -7833,48 +10472,48 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ExpiryTime_hash")] public static extern long ExpiryTime_hash(long _o); // bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ExpiryTime_eq")] public static extern bool ExpiryTime_eq(long _a, long _b); - // void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_free")] public static extern void MinFinalCltvExpiry_free(long _this_obj); - // uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_get_a")] public static extern long MinFinalCltvExpiry_get_a(long _this_ptr); - // void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_set_a")] public static extern void MinFinalCltvExpiry_set_a(long _this_ptr, long _val); - // MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_new")] public static extern long MinFinalCltvExpiry_new(long _a_arg); - // uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_clone_ptr")] public static extern long MinFinalCltvExpiry_clone_ptr(long _arg); - // struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_clone")] public static extern long MinFinalCltvExpiry_clone(long _orig); - // uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_hash")] public static extern long MinFinalCltvExpiry_hash(long _o); - // bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiry_eq")] public static extern bool MinFinalCltvExpiry_eq(long _a, long _b); + // void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_free")] public static extern void MinFinalCltvExpiryDelta_free(long _this_obj); + // uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_get_a")] public static extern long MinFinalCltvExpiryDelta_get_a(long _this_ptr); + // void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_set_a")] public static extern void MinFinalCltvExpiryDelta_set_a(long _this_ptr, long _val); + // MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_new")] public static extern long MinFinalCltvExpiryDelta_new(long _a_arg); + // uint64_t MinFinalCltvExpiryDelta_clone_ptr(LDKMinFinalCltvExpiryDelta *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_clone_ptr")] public static extern long MinFinalCltvExpiryDelta_clone_ptr(long _arg); + // struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_clone")] public static extern long MinFinalCltvExpiryDelta_clone(long _orig); + // uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_hash")] public static extern long MinFinalCltvExpiryDelta_hash(long _o); + // bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MinFinalCltvExpiryDelta_eq")] public static extern bool MinFinalCltvExpiryDelta_eq(long _a, long _b); // void Fallback_free(struct LDKFallback this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_free")] public static extern void Fallback_free(long _this_ptr); // uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_clone_ptr")] public static extern long Fallback_clone_ptr(long _arg); // struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_clone")] public static extern long Fallback_clone(long _orig); - // struct LDKFallback Fallback_seg_wit_program(struct LDKU5 version, struct LDKCVec_u8Z program); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_seg_wit_program")] public static extern long Fallback_seg_wit_program(byte _version, byte[] _program); + // struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_seg_wit_program")] public static extern long Fallback_seg_wit_program(byte _version, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _program); // struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_pub_key_hash")] public static extern long Fallback_pub_key_hash(byte[] _a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_pub_key_hash")] public static extern long Fallback_pub_key_hash([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a); // struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_script_hash")] public static extern long Fallback_script_hash(byte[] _a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_script_hash")] public static extern long Fallback_script_hash([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _a); // uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_hash")] public static extern long Fallback_hash(long _o); // bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Fallback_eq")] public static extern bool Fallback_eq(long _a, long _b); - // void InvoiceSignature_free(struct LDKInvoiceSignature this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceSignature_free")] public static extern void InvoiceSignature_free(long _this_obj); - // uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceSignature_clone_ptr")] public static extern long InvoiceSignature_clone_ptr(long _arg); - // struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceSignature_clone")] public static extern long InvoiceSignature_clone(long _orig); - // uint64_t InvoiceSignature_hash(const struct LDKInvoiceSignature *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceSignature_hash")] public static extern long InvoiceSignature_hash(long _o); - // bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceSignature_eq")] public static extern bool InvoiceSignature_eq(long _a, long _b); + // void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_free")] public static extern void Bolt11InvoiceSignature_free(long _this_obj); + // uint64_t Bolt11InvoiceSignature_clone_ptr(LDKBolt11InvoiceSignature *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_clone_ptr")] public static extern long Bolt11InvoiceSignature_clone_ptr(long _arg); + // struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_clone")] public static extern long Bolt11InvoiceSignature_clone(long _orig); + // uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_hash")] public static extern long Bolt11InvoiceSignature_hash(long _o); + // bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceSignature_eq")] public static extern bool Bolt11InvoiceSignature_eq(long _a, long _b); // void PrivateRoute_free(struct LDKPrivateRoute this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrivateRoute_free")] public static extern void PrivateRoute_free(long _this_obj); // uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg); @@ -7885,42 +10524,44 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrivateRoute_hash")] public static extern long PrivateRoute_hash(long _o); // bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrivateRoute_eq")] public static extern bool PrivateRoute_eq(long _a, long _b); - // MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_into_parts")] public static extern long SignedRawInvoice_into_parts(long _this_arg); - // MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_raw_invoice")] public static extern long SignedRawInvoice_raw_invoice(long _this_arg); - // MUST_USE_RES const uint8_t (*SignedRawInvoice_signable_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_signable_hash")] public static extern byte[] SignedRawInvoice_signable_hash(long _this_arg); - // MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_signature")] public static extern long SignedRawInvoice_signature(long _this_arg); - // MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_recover_payee_pub_key")] public static extern long SignedRawInvoice_recover_payee_pub_key(long _this_arg); - // MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_check_signature")] public static extern bool SignedRawInvoice_check_signature(long _this_arg); - // MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_signable_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_signable_hash")] public static extern byte[] RawInvoice_signable_hash(long _this_arg); - // MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_payment_hash")] public static extern long RawInvoice_payment_hash(long _this_arg); - // MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_description")] public static extern long RawInvoice_description(long _this_arg); - // MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_payee_pub_key")] public static extern long RawInvoice_payee_pub_key(long _this_arg); - // MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_description_hash")] public static extern long RawInvoice_description_hash(long _this_arg); - // MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_expiry_time")] public static extern long RawInvoice_expiry_time(long _this_arg); - // MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_min_final_cltv_expiry")] public static extern long RawInvoice_min_final_cltv_expiry(long _this_arg); - // MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_payment_secret")] public static extern byte[] RawInvoice_payment_secret(long _this_arg); - // MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_features")] public static extern long RawInvoice_features(long _this_arg); - // MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_private_routes")] public static extern long[] RawInvoice_private_routes(long _this_arg); - // MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_amount_pico_btc")] public static extern long RawInvoice_amount_pico_btc(long _this_arg); - // MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawInvoice_currency")] public static extern Currency RawInvoice_currency(long _this_arg); + // MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_into_parts")] public static extern long SignedRawBolt11Invoice_into_parts(long _this_arg); + // MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_raw_invoice")] public static extern long SignedRawBolt11Invoice_raw_invoice(long _this_arg); + // MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_signable_hash")] public static extern byte[] SignedRawBolt11Invoice_signable_hash(long _this_arg); + // MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_signature")] public static extern long SignedRawBolt11Invoice_signature(long _this_arg); + // MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_recover_payee_pub_key")] public static extern long SignedRawBolt11Invoice_recover_payee_pub_key(long _this_arg); + // MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_check_signature")] public static extern bool SignedRawBolt11Invoice_check_signature(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_signable_hash")] public static extern byte[] RawBolt11Invoice_signable_hash(long _this_arg); + // MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_payment_hash")] public static extern long RawBolt11Invoice_payment_hash(long _this_arg); + // MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_description")] public static extern long RawBolt11Invoice_description(long _this_arg); + // MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_payee_pub_key")] public static extern long RawBolt11Invoice_payee_pub_key(long _this_arg); + // MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_description_hash")] public static extern long RawBolt11Invoice_description_hash(long _this_arg); + // MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_expiry_time")] public static extern long RawBolt11Invoice_expiry_time(long _this_arg); + // MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_min_final_cltv_expiry_delta")] public static extern long RawBolt11Invoice_min_final_cltv_expiry_delta(long _this_arg); + // MUST_USE_RES struct LDKCOption_PaymentSecretZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_payment_secret")] public static extern long RawBolt11Invoice_payment_secret(long _this_arg); + // MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_payment_metadata")] public static extern long RawBolt11Invoice_payment_metadata(long _this_arg); + // MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_features")] public static extern long RawBolt11Invoice_features(long _this_arg); + // MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_private_routes")] public static extern long[] RawBolt11Invoice_private_routes(long _this_arg); + // MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_amount_pico_btc")] public static extern long RawBolt11Invoice_amount_pico_btc(long _this_arg); + // MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RawBolt11Invoice_currency")] public static extern Currency RawBolt11Invoice_currency(long _this_arg); // MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PositiveTimestamp_from_unix_timestamp")] public static extern long PositiveTimestamp_from_unix_timestamp(long _unix_seconds); // MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time); @@ -7933,42 +10574,54 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PositiveTimestamp_as_duration_since_epoch")] public static extern long PositiveTimestamp_as_duration_since_epoch(long _this_arg); // MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PositiveTimestamp_as_time")] public static extern long PositiveTimestamp_as_time(long _this_arg); - // MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_into_signed_raw")] public static extern long Invoice_into_signed_raw(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_check_signature")] public static extern long Invoice_check_signature(long _this_arg); - // MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_from_signed")] public static extern long Invoice_from_signed(long _signed_invoice); - // MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_timestamp")] public static extern long Invoice_timestamp(long _this_arg); - // MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_duration_since_epoch")] public static extern long Invoice_duration_since_epoch(long _this_arg); - // MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_payment_hash")] public static extern byte[] Invoice_payment_hash(long _this_arg); - // MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_payee_pub_key")] public static extern byte[] Invoice_payee_pub_key(long _this_arg); - // MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_payment_secret")] public static extern byte[] Invoice_payment_secret(long _this_arg); - // MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_features")] public static extern long Invoice_features(long _this_arg); - // MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_recover_payee_pub_key")] public static extern byte[] Invoice_recover_payee_pub_key(long _this_arg); - // MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_expiry_time")] public static extern long Invoice_expiry_time(long _this_arg); - // MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_is_expired")] public static extern bool Invoice_is_expired(long _this_arg); - // MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_would_expire")] public static extern bool Invoice_would_expire(long _this_arg, long _at_time); - // MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_min_final_cltv_expiry")] public static extern long Invoice_min_final_cltv_expiry(long _this_arg); - // MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_private_routes")] public static extern long[] Invoice_private_routes(long _this_arg); - // MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_route_hints")] public static extern long[] Invoice_route_hints(long _this_arg); - // MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_currency")] public static extern Currency Invoice_currency(long _this_arg); - // MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_amount_milli_satoshis")] public static extern long Invoice_amount_milli_satoshis(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_signable_hash")] public static extern byte[] Bolt11Invoice_signable_hash(long _this_arg); + // MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_into_signed_raw")] public static extern long Bolt11Invoice_into_signed_raw(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_check_signature")] public static extern long Bolt11Invoice_check_signature(long _this_arg); + // MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_from_signed")] public static extern long Bolt11Invoice_from_signed(long _signed_invoice); + // MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_timestamp")] public static extern long Bolt11Invoice_timestamp(long _this_arg); + // MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_duration_since_epoch")] public static extern long Bolt11Invoice_duration_since_epoch(long _this_arg); + // MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_payment_hash")] public static extern byte[] Bolt11Invoice_payment_hash(long _this_arg); + // MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_payee_pub_key")] public static extern byte[] Bolt11Invoice_payee_pub_key(long _this_arg); + // MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_payment_secret")] public static extern byte[] Bolt11Invoice_payment_secret(long _this_arg); + // MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_payment_metadata")] public static extern long Bolt11Invoice_payment_metadata(long _this_arg); + // MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_features")] public static extern long Bolt11Invoice_features(long _this_arg); + // MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_recover_payee_pub_key")] public static extern byte[] Bolt11Invoice_recover_payee_pub_key(long _this_arg); + // MUST_USE_RES struct LDKCOption_DurationZ Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_expires_at")] public static extern long Bolt11Invoice_expires_at(long _this_arg); + // MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_expiry_time")] public static extern long Bolt11Invoice_expiry_time(long _this_arg); + // MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_is_expired")] public static extern bool Bolt11Invoice_is_expired(long _this_arg); + // MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_duration_until_expiry")] public static extern long Bolt11Invoice_duration_until_expiry(long _this_arg); + // MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_expiration_remaining_from_epoch")] public static extern long Bolt11Invoice_expiration_remaining_from_epoch(long _this_arg, long _time); + // MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_would_expire")] public static extern bool Bolt11Invoice_would_expire(long _this_arg, long _at_time); + // MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_min_final_cltv_expiry_delta")] public static extern long Bolt11Invoice_min_final_cltv_expiry_delta(long _this_arg); + // MUST_USE_RES struct LDKCVec_AddressZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_fallback_addresses")] public static extern string[] Bolt11Invoice_fallback_addresses(long _this_arg); + // MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_private_routes")] public static extern long[] Bolt11Invoice_private_routes(long _this_arg); + // MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_route_hints")] public static extern long[] Bolt11Invoice_route_hints(long _this_arg); + // MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_currency")] public static extern Currency Bolt11Invoice_currency(long _this_arg); + // MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_amount_milli_satoshis")] public static extern long Bolt11Invoice_amount_milli_satoshis(long _this_arg); // MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Description_new")] public static extern long Description_new(string _description); // MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg); @@ -7997,36 +10650,38 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CreationError_invalid_amount")] public static extern CreationError CreationError_invalid_amount(); // enum LDKCreationError CreationError_missing_route_hints(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CreationError_missing_route_hints")] public static extern CreationError CreationError_missing_route_hints(); + // enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CreationError_min_final_cltv_expiry_delta_too_short")] public static extern CreationError CreationError_min_final_cltv_expiry_delta_too_short(); // bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CreationError_eq")] public static extern bool CreationError_eq(long _a, long _b); // struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CreationError_to_str")] public static extern string CreationError_to_str(long _o); - // enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_clone")] public static extern SemanticError SemanticError_clone(long _orig); - // enum LDKSemanticError SemanticError_no_payment_hash(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_no_payment_hash")] public static extern SemanticError SemanticError_no_payment_hash(); - // enum LDKSemanticError SemanticError_multiple_payment_hashes(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_multiple_payment_hashes")] public static extern SemanticError SemanticError_multiple_payment_hashes(); - // enum LDKSemanticError SemanticError_no_description(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_no_description")] public static extern SemanticError SemanticError_no_description(); - // enum LDKSemanticError SemanticError_multiple_descriptions(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_multiple_descriptions")] public static extern SemanticError SemanticError_multiple_descriptions(); - // enum LDKSemanticError SemanticError_no_payment_secret(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_no_payment_secret")] public static extern SemanticError SemanticError_no_payment_secret(); - // enum LDKSemanticError SemanticError_multiple_payment_secrets(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_multiple_payment_secrets")] public static extern SemanticError SemanticError_multiple_payment_secrets(); - // enum LDKSemanticError SemanticError_invalid_features(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_invalid_features")] public static extern SemanticError SemanticError_invalid_features(); - // enum LDKSemanticError SemanticError_invalid_recovery_id(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_invalid_recovery_id")] public static extern SemanticError SemanticError_invalid_recovery_id(); - // enum LDKSemanticError SemanticError_invalid_signature(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_invalid_signature")] public static extern SemanticError SemanticError_invalid_signature(); - // enum LDKSemanticError SemanticError_imprecise_amount(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_imprecise_amount")] public static extern SemanticError SemanticError_imprecise_amount(); - // bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_eq")] public static extern bool SemanticError_eq(long _a, long _b); - // struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SemanticError_to_str")] public static extern string SemanticError_to_str(long _o); + // enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_clone")] public static extern Bolt11SemanticError Bolt11SemanticError_clone(long _orig); + // enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_no_payment_hash")] public static extern Bolt11SemanticError Bolt11SemanticError_no_payment_hash(); + // enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_multiple_payment_hashes")] public static extern Bolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(); + // enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_no_description")] public static extern Bolt11SemanticError Bolt11SemanticError_no_description(); + // enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_multiple_descriptions")] public static extern Bolt11SemanticError Bolt11SemanticError_multiple_descriptions(); + // enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_no_payment_secret")] public static extern Bolt11SemanticError Bolt11SemanticError_no_payment_secret(); + // enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_multiple_payment_secrets")] public static extern Bolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(); + // enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_invalid_features")] public static extern Bolt11SemanticError Bolt11SemanticError_invalid_features(); + // enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_invalid_recovery_id")] public static extern Bolt11SemanticError Bolt11SemanticError_invalid_recovery_id(); + // enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_invalid_signature")] public static extern Bolt11SemanticError Bolt11SemanticError_invalid_signature(); + // enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_imprecise_amount")] public static extern Bolt11SemanticError Bolt11SemanticError_imprecise_amount(); + // bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_eq")] public static extern bool Bolt11SemanticError_eq(long _a, long _b); + // struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11SemanticError_to_str")] public static extern string Bolt11SemanticError_to_str(long _o); // void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignOrCreationError_free")] public static extern void SignOrCreationError_free(long _this_ptr); // uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg); @@ -8041,24 +10696,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignOrCreationError_eq")] public static extern bool SignOrCreationError_eq(long _a, long _b); // struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignOrCreationError_to_str")] public static extern string SignOrCreationError_to_str(long _o); - // void InvoicePayer_free(struct LDKInvoicePayer this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_free")] public static extern void InvoicePayer_free(long _this_obj); - // void Payer_free(struct LDKPayer this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Payer_free")] public static extern void Payer_free(long _this_ptr); - // void Retry_free(struct LDKRetry this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_free")] public static extern void Retry_free(long _this_ptr); - // uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_clone_ptr")] public static extern long Retry_clone_ptr(long _arg); - // struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_clone")] public static extern long Retry_clone(long _orig); - // struct LDKRetry Retry_attempts(uintptr_t a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_attempts")] public static extern long Retry_attempts(long _a); - // struct LDKRetry Retry_timeout(uint64_t a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_timeout")] public static extern long Retry_timeout(long _a); - // bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_eq")] public static extern bool Retry_eq(long _a, long _b); - // uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_hash")] public static extern long Retry_hash(long _o); + // struct LDKCResult_PaymentIdPaymentErrorZ pay_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_pay_invoice")] public static extern long pay_invoice(long _invoice, long _retry_strategy, long _channelmanager); + // struct LDKCResult_NonePaymentErrorZ pay_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_pay_invoice_with_id")] public static extern long pay_invoice_with_id(long _invoice, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, long _retry_strategy, long _channelmanager); + // struct LDKCResult_PaymentIdPaymentErrorZ pay_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_pay_zero_value_invoice")] public static extern long pay_zero_value_invoice(long _invoice, long _amount_msats, long _retry_strategy, long _channelmanager); + // struct LDKCResult_NonePaymentErrorZ pay_zero_value_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_pay_zero_value_invoice_with_id")] public static extern long pay_zero_value_invoice_with_id(long _invoice, long _amount_msats, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_id, long _retry_strategy, long _channelmanager); // void PaymentError_free(struct LDKPaymentError this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentError_free")] public static extern void PaymentError_free(long _this_ptr); // uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg); @@ -8067,68 +10712,52 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentError_clone")] public static extern long PaymentError_clone(long _orig); // struct LDKPaymentError PaymentError_invoice(struct LDKStr a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentError_invoice")] public static extern long PaymentError_invoice(string _a); - // struct LDKPaymentError PaymentError_routing(struct LDKLightningError a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentError_routing")] public static extern long PaymentError_routing(long _a); - // struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentError_sending")] public static extern long PaymentError_sending(long _a); - // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetry retry); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_new")] public static extern long InvoicePayer_new(long _payer, long _router, long _logger, long _event_handler, long _retry); - // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_pay_invoice")] public static extern long InvoicePayer_pay_invoice(long _this_arg, long _invoice); - // MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_invoice_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_pay_invoice_with_id")] public static extern long InvoicePayer_pay_invoice_with_id(long _this_arg, long _invoice, byte[] _payment_id); - // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_pay_zero_value_invoice")] public static extern long InvoicePayer_pay_zero_value_invoice(long _this_arg, long _invoice, long _amount_msats); - // MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_zero_value_invoice_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_pay_zero_value_invoice_with_id")] public static extern long InvoicePayer_pay_zero_value_invoice_with_id(long _this_arg, long _invoice, long _amount_msats, byte[] _payment_id); - // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_pay_pubkey")] public static extern long InvoicePayer_pay_pubkey(long _this_arg, byte[] _pubkey, byte[] _payment_preimage, long _amount_msats, int _final_cltv_expiry_delta); - // MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_pubkey_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id, uint64_t amount_msats, uint32_t final_cltv_expiry_delta); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_pay_pubkey_with_id")] public static extern long InvoicePayer_pay_pubkey_with_id(long _this_arg, byte[] _pubkey, byte[] _payment_preimage, byte[] _payment_id, long _amount_msats, int _final_cltv_expiry_delta); - // void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_remove_cached_payment")] public static extern void InvoicePayer_remove_cached_payment(long _this_arg, byte[] _payment_hash); - // struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoicePayer_as_EventHandler")] public static extern long InvoicePayer_as_EventHandler(long _this_arg); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice")] public static extern long create_phantom_invoice(long _amt_msat, byte[] _payment_hash, string _description, int _invoice_expiry_delta_secs, long[] _phantom_route_hints, long _keys_manager, long _logger, Currency _network); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice_with_description_hash")] public static extern long create_phantom_invoice_with_description_hash(long _amt_msat, byte[] _payment_hash, int _invoice_expiry_delta_secs, long _description_hash, long[] _phantom_route_hints, long _keys_manager, long _logger, Currency _network); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager")] public static extern long create_invoice_from_channelmanager(long _channelmanager, long _keys_manager, long _logger, Currency _network, long _amt_msat, string _description, int _invoice_expiry_delta_secs); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash")] public static extern long create_invoice_from_channelmanager_with_description_hash(long _channelmanager, long _keys_manager, long _logger, Currency _network, long _amt_msat, long _description_hash, int _invoice_expiry_delta_secs); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long _channelmanager, long _keys_manager, long _logger, Currency _network, long _amt_msat, long _description_hash, long _duration_since_epoch, int _invoice_expiry_delta_secs); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch(long _channelmanager, long _keys_manager, long _logger, Currency _network, long _amt_msat, string _description, long _duration_since_epoch, int _invoice_expiry_delta_secs); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(long _channelmanager, long _keys_manager, long _logger, Currency _network, long _amt_msat, string _description, long _duration_since_epoch, int _invoice_expiry_delta_secs, byte[] _payment_hash); - // struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_Payer")] public static extern long ChannelManager_as_Payer(long _this_arg); - // struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s); + // struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentError_sending")] public static extern long PaymentError_sending(RetryableSendFailure _a); + // bool PaymentError_eq(const struct LDKPaymentError *NONNULL_PTR a, const struct LDKPaymentError *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentError_eq")] public static extern bool PaymentError_eq(long _a, long _b); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_PaymentHashZ payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice")] public static extern long create_phantom_invoice(long _amt_msat, long _payment_hash, string _description, int _invoice_expiry_delta_secs, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _phantom_route_hints, long _entropy_source, long _node_signer, long _logger, Currency _network, long _min_final_cltv_expiry_delta, long _duration_since_epoch); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_PaymentHashZ payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_phantom_invoice_with_description_hash")] public static extern long create_phantom_invoice_with_description_hash(long _amt_msat, long _payment_hash, int _invoice_expiry_delta_secs, long _description_hash, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] long[] _phantom_route_hints, long _entropy_source, long _node_signer, long _logger, Currency _network, long _min_final_cltv_expiry_delta, long _duration_since_epoch); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager")] public static extern long create_invoice_from_channelmanager(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, string _description, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash")] public static extern long create_invoice_from_channelmanager_with_description_hash(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description_hash, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, long _description_hash, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, string _description, long _duration_since_epoch, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash")] public static extern long create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(long _channelmanager, long _node_signer, long _logger, Currency _network, long _amt_msat, string _description, long _duration_since_epoch, int _invoice_expiry_delta_secs, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _payment_hash, long _min_final_cltv_expiry_delta); + // struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SiPrefix_from_str")] public static extern long SiPrefix_from_str(string _s); - // struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_from_str")] public static extern long Invoice_from_str(string _s); - // struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_from_str")] public static extern long SignedRawInvoice_from_str(string _s); - // struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseError_to_str")] public static extern string ParseError_to_str(long _o); + // struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_from_str")] public static extern long Bolt11Invoice_from_str(string _s); + // struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_from_str")] public static extern long SignedRawBolt11Invoice_from_str(string _s); + // struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11ParseError_to_str")] public static extern string Bolt11ParseError_to_str(long _o); // struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ParseOrSemanticError_to_str")] public static extern string ParseOrSemanticError_to_str(long _o); - // struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Invoice_to_str")] public static extern string Invoice_to_str(long _o); - // struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawInvoice_to_str")] public static extern string SignedRawInvoice_to_str(long _o); + // struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_to_str")] public static extern string Bolt11Invoice_to_str(long _o); + // struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignedRawBolt11Invoice_to_str")] public static extern string SignedRawBolt11Invoice_to_str(long _o); // struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Currency_to_str")] public static extern string Currency_to_str(long _o); // struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SiPrefix_to_str")] public static extern string SiPrefix_to_str(long _o); // void RapidGossipSync_free(struct LDKRapidGossipSync this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_free")] public static extern void RapidGossipSync_free(long _this_obj); - // MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_new")] public static extern long RapidGossipSync_new(long _network_graph); + // MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_new")] public static extern long RapidGossipSync_new(long _network_graph, long _logger); + // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_sync_network_graph_with_file_path")] public static extern long RapidGossipSync_sync_network_graph_with_file_path(long _this_arg, string _sync_path); // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_update_network_graph")] public static extern long RapidGossipSync_update_network_graph(long _this_arg, byte[] _update_data); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_update_network_graph")] public static extern long RapidGossipSync_update_network_graph(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _update_data); + // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph_no_std(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data, struct LDKCOption_u64Z current_time_unix); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_update_network_graph_no_std")] public static extern long RapidGossipSync_update_network_graph_no_std(long _this_arg, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType="org.ldk.impl.ArrayCoder")] byte[] _update_data, long _current_time_unix); // MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RapidGossipSync_is_initial_sync_complete")] public static extern bool RapidGossipSync_is_initial_sync_complete(long _this_arg); // void GraphSyncError_free(struct LDKGraphSyncError this_ptr); diff --git a/c_sharp/src/org/ldk/impl/version.cs b/c_sharp/src/org/ldk/impl/version.cs index 46c119fa..4221ca7c 100644 --- a/c_sharp/src/org/ldk/impl/version.cs +++ b/c_sharp/src/org/ldk/impl/version.cs @@ -2,6 +2,6 @@ public class version { public static string get_ldk_java_bindings_version() { - return "v0.0.112.0-16-g370db845-dirty"; + return "v0.0.116.0-3-gc2ad295f-dirty"; } } \ No newline at end of file diff --git a/c_sharp/src/org/ldk/structs/APIError.cs b/c_sharp/src/org/ldk/structs/APIError.cs index b32701c6..bf71371b 100644 --- a/c_sharp/src/org/ldk/structs/APIError.cs +++ b/c_sharp/src/org/ldk/structs/APIError.cs @@ -198,5 +198,14 @@ public class APIError : CommonBase { if (!(o is APIError)) return false; return this.eq((APIError)o); } + /** + * Serialize the APIError object into a byte array which can be read by APIError_read + */ + public byte[] write() { + byte[] ret = bindings.APIError_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/AcceptChannel.cs b/c_sharp/src/org/ldk/structs/AcceptChannel.cs index ba54f5b4..cfc20114 100644 --- a/c_sharp/src/org/ldk/structs/AcceptChannel.cs +++ b/c_sharp/src/org/ldk/structs/AcceptChannel.cs @@ -7,7 +7,11 @@ namespace org { namespace ldk { namespace structs { /** - * An accept_channel message to be sent or received from a peer + * An [`accept_channel`] message to be sent to or received from a peer. + * + * Used in V1 channel establishment + * + * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message */ public class AcceptChannel : CommonBase { internal AcceptChannel(object _dummy, long ptr) : base(ptr) { } @@ -268,10 +272,32 @@ public class AcceptChannel : CommonBase { } /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. + * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close + */ + public Option_ScriptZ get_shutdown_scriptpubkey() { + long ret = bindings.AcceptChannel_get_shutdown_scriptpubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScriptZ ret_hu_conv = org.ldk.structs.Option_ScriptZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close + */ + public void set_shutdown_scriptpubkey(org.ldk.structs.Option_ScriptZ val) { + bindings.AcceptChannel_set_shutdown_scriptpubkey(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The channel type that this channel will represent. * + * If this is `None`, we derive the channel type from the intersection of + * our feature bits with our counterparty's feature bits from the [`Init`] message. * This is required to match the equivalent field in [`OpenChannel::channel_type`]. * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None @@ -286,10 +312,10 @@ public class AcceptChannel : CommonBase { } /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. + * The channel type that this channel will represent. * + * If this is `None`, we derive the channel type from the intersection of + * our feature bits with our counterparty's feature bits from the [`Init`] message. * This is required to match the equivalent field in [`OpenChannel::channel_type`]. * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None @@ -301,6 +327,35 @@ public class AcceptChannel : CommonBase { if (this != null) { this.ptrs_to.AddLast(val); }; } + /** + * Constructs a new AcceptChannel given each field + */ + public static AcceptChannel of(byte[] temporary_channel_id_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long channel_reserve_satoshis_arg, long htlc_minimum_msat_arg, int minimum_depth_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, org.ldk.structs.Option_ScriptZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg) { + long ret = bindings.AcceptChannel_new(InternalUtils.check_arr_len(temporary_channel_id_arg, 32), dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, channel_reserve_satoshis_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_point_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33), InternalUtils.check_arr_len(first_per_commitment_point_arg, 33), shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr); + GC.KeepAlive(temporary_channel_id_arg); + GC.KeepAlive(dust_limit_satoshis_arg); + GC.KeepAlive(max_htlc_value_in_flight_msat_arg); + GC.KeepAlive(channel_reserve_satoshis_arg); + GC.KeepAlive(htlc_minimum_msat_arg); + GC.KeepAlive(minimum_depth_arg); + GC.KeepAlive(to_self_delay_arg); + GC.KeepAlive(max_accepted_htlcs_arg); + GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(revocation_basepoint_arg); + GC.KeepAlive(payment_point_arg); + GC.KeepAlive(delayed_payment_basepoint_arg); + GC.KeepAlive(htlc_basepoint_arg); + GC.KeepAlive(first_per_commitment_point_arg); + GC.KeepAlive(shutdown_scriptpubkey_arg); + GC.KeepAlive(channel_type_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannel(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + return ret_hu_conv; + } + internal long clone_ptr() { long ret = bindings.AcceptChannel_clone_ptr(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs b/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs new file mode 100644 index 00000000..4e287377 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs @@ -0,0 +1,459 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An accept_channel2 message to be sent by or received from the channel accepter. + * + * Used in V2 channel establishment + */ +public class AcceptChannelV2 : CommonBase { + internal AcceptChannelV2(object _dummy, long ptr) : base(ptr) { } + ~AcceptChannelV2() { + if (ptr != 0) { bindings.AcceptChannelV2_free(ptr); } + } + + /** + * The same `temporary_channel_id` received from the initiator's `open_channel2` message. + */ + public byte[] get_temporary_channel_id() { + byte[] ret = bindings.AcceptChannelV2_get_temporary_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The same `temporary_channel_id` received from the initiator's `open_channel2` message. + */ + public void set_temporary_channel_id(byte[] val) { + bindings.AcceptChannelV2_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Part of the channel value contributed by the channel acceptor + */ + public long get_funding_satoshis() { + long ret = bindings.AcceptChannelV2_get_funding_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Part of the channel value contributed by the channel acceptor + */ + public void set_funding_satoshis(long val) { + bindings.AcceptChannelV2_set_funding_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The threshold below which outputs on transactions broadcast by the channel acceptor will be + * omitted + */ + public long get_dust_limit_satoshis() { + long ret = bindings.AcceptChannelV2_get_dust_limit_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The threshold below which outputs on transactions broadcast by the channel acceptor will be + * omitted + */ + public void set_dust_limit_satoshis(long val) { + bindings.AcceptChannelV2_set_dust_limit_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi + */ + public long get_max_htlc_value_in_flight_msat() { + long ret = bindings.AcceptChannelV2_get_max_htlc_value_in_flight_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi + */ + public void set_max_htlc_value_in_flight_msat(long val) { + bindings.AcceptChannelV2_set_max_htlc_value_in_flight_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The minimum HTLC size incoming to channel acceptor, in milli-satoshi + */ + public long get_htlc_minimum_msat() { + long ret = bindings.AcceptChannelV2_get_htlc_minimum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum HTLC size incoming to channel acceptor, in milli-satoshi + */ + public void set_htlc_minimum_msat(long val) { + bindings.AcceptChannelV2_set_htlc_minimum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Minimum depth of the funding transaction before the channel is considered open + */ + public int get_minimum_depth() { + int ret = bindings.AcceptChannelV2_get_minimum_depth(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Minimum depth of the funding transaction before the channel is considered open + */ + public void set_minimum_depth(int val) { + bindings.AcceptChannelV2_set_minimum_depth(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public short get_to_self_delay() { + short ret = bindings.AcceptChannelV2_get_to_self_delay(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public void set_to_self_delay(short val) { + bindings.AcceptChannelV2_set_to_self_delay(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum number of inbound HTLCs towards channel acceptor + */ + public short get_max_accepted_htlcs() { + short ret = bindings.AcceptChannelV2_get_max_accepted_htlcs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum number of inbound HTLCs towards channel acceptor + */ + public void set_max_accepted_htlcs(short val) { + bindings.AcceptChannelV2_set_max_accepted_htlcs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The channel acceptor's key controlling the funding transaction + */ + public byte[] get_funding_pubkey() { + byte[] ret = bindings.AcceptChannelV2_get_funding_pubkey(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel acceptor's key controlling the funding transaction + */ + public void set_funding_pubkey(byte[] val) { + bindings.AcceptChannelV2_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public byte[] get_revocation_basepoint() { + byte[] ret = bindings.AcceptChannelV2_get_revocation_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public void set_revocation_basepoint(byte[] val) { + bindings.AcceptChannelV2_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A payment key to channel acceptor for transactions broadcast by counterparty + */ + public byte[] get_payment_basepoint() { + byte[] ret = bindings.AcceptChannelV2_get_payment_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A payment key to channel acceptor for transactions broadcast by counterparty + */ + public void set_payment_basepoint(byte[] val) { + bindings.AcceptChannelV2_set_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a payment key to channel acceptor for transactions broadcast by channel + * acceptor + */ + public byte[] get_delayed_payment_basepoint() { + byte[] ret = bindings.AcceptChannelV2_get_delayed_payment_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Used to derive a payment key to channel acceptor for transactions broadcast by channel + * acceptor + */ + public void set_delayed_payment_basepoint(byte[] val) { + bindings.AcceptChannelV2_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty + */ + public byte[] get_htlc_basepoint() { + byte[] ret = bindings.AcceptChannelV2_get_htlc_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty + */ + public void set_htlc_basepoint(byte[] val) { + bindings.AcceptChannelV2_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point + */ + public byte[] get_first_per_commitment_point() { + byte[] ret = bindings.AcceptChannelV2_get_first_per_commitment_point(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point + */ + public void set_first_per_commitment_point(byte[] val) { + bindings.AcceptChannelV2_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point + */ + public byte[] get_second_per_commitment_point() { + byte[] ret = bindings.AcceptChannelV2_get_second_per_commitment_point(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point + */ + public void set_second_per_commitment_point(byte[] val) { + bindings.AcceptChannelV2_set_second_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we + * collaboratively close + */ + public Option_ScriptZ get_shutdown_scriptpubkey() { + long ret = bindings.AcceptChannelV2_get_shutdown_scriptpubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScriptZ ret_hu_conv = org.ldk.structs.Option_ScriptZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we + * collaboratively close + */ + public void set_shutdown_scriptpubkey(org.ldk.structs.Option_ScriptZ val) { + bindings.AcceptChannelV2_set_shutdown_scriptpubkey(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * This is required to match the equivalent field in [`OpenChannelV2::channel_type`]. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelTypeFeatures get_channel_type() { + long ret = bindings.AcceptChannelV2_get_channel_type(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * This is required to match the equivalent field in [`OpenChannelV2::channel_type`]. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { + bindings.AcceptChannelV2_set_channel_type(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Optionally, a requirement that only confirmed inputs can be added + */ + public COption_NoneZ get_require_confirmed_inputs() { + COption_NoneZ ret = bindings.AcceptChannelV2_get_require_confirmed_inputs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Optionally, a requirement that only confirmed inputs can be added + */ + public void set_require_confirmed_inputs(COption_NoneZ val) { + bindings.AcceptChannelV2_set_require_confirmed_inputs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new AcceptChannelV2 given each field + */ + public static AcceptChannelV2 of(byte[] temporary_channel_id_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, int minimum_depth_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte[] second_per_commitment_point_arg, org.ldk.structs.Option_ScriptZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.AcceptChannelV2_new(InternalUtils.check_arr_len(temporary_channel_id_arg, 32), funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_basepoint_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33), InternalUtils.check_arr_len(first_per_commitment_point_arg, 33), InternalUtils.check_arr_len(second_per_commitment_point_arg, 33), shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, require_confirmed_inputs_arg); + GC.KeepAlive(temporary_channel_id_arg); + GC.KeepAlive(funding_satoshis_arg); + GC.KeepAlive(dust_limit_satoshis_arg); + GC.KeepAlive(max_htlc_value_in_flight_msat_arg); + GC.KeepAlive(htlc_minimum_msat_arg); + GC.KeepAlive(minimum_depth_arg); + GC.KeepAlive(to_self_delay_arg); + GC.KeepAlive(max_accepted_htlcs_arg); + GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(revocation_basepoint_arg); + GC.KeepAlive(payment_basepoint_arg); + GC.KeepAlive(delayed_payment_basepoint_arg); + GC.KeepAlive(htlc_basepoint_arg); + GC.KeepAlive(first_per_commitment_point_arg); + GC.KeepAlive(second_per_commitment_point_arg); + GC.KeepAlive(shutdown_scriptpubkey_arg); + GC.KeepAlive(channel_type_arg); + GC.KeepAlive(require_confirmed_inputs_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AcceptChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannelV2(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.AcceptChannelV2_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the AcceptChannelV2 + */ + public AcceptChannelV2 clone() { + long ret = bindings.AcceptChannelV2_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AcceptChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannelV2(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two AcceptChannelV2s contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.AcceptChannelV2 b) { + bool ret = bindings.AcceptChannelV2_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is AcceptChannelV2)) return false; + return this.eq((AcceptChannelV2)o); + } + /** + * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read + */ + public byte[] write() { + byte[] ret = bindings.AcceptChannelV2_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write + */ + public static Result_AcceptChannelV2DecodeErrorZ read(byte[] ser) { + long ret = bindings.AcceptChannelV2_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Access.cs b/c_sharp/src/org/ldk/structs/Access.cs deleted file mode 100644 index f9206898..00000000 --- a/c_sharp/src/org/ldk/structs/Access.cs +++ /dev/null @@ -1,68 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -/** - * The `Access` trait defines behavior for accessing chain data and state, such as blocks and - * UTXOs. - */ -public class Access : CommonBase { - internal readonly bindings.LDKAccess bindings_instance; - internal Access(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } - private Access(bindings.LDKAccess arg) : base(bindings.LDKAccess_new(arg)) { - this.ptrs_to.AddLast(arg); - this.bindings_instance = arg; - } - ~Access() { - if (ptr != 0) { bindings.Access_free(ptr); } - } - - public interface AccessInterface { - /** - * Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. - * Returns an error if `genesis_hash` is for a different chain or if such a transaction output - * is unknown. - * - * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id - */ - Result_TxOutAccessErrorZ get_utxo(byte[] _genesis_hash, long _short_channel_id); - } - private class LDKAccessHolder { internal Access held; } - private class LDKAccessImpl : bindings.LDKAccess { - internal LDKAccessImpl(AccessInterface arg, LDKAccessHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } - private AccessInterface arg; - private LDKAccessHolder impl_holder; - public long get_utxo(byte[] _genesis_hash, long _short_channel_id) { - Result_TxOutAccessErrorZ ret = arg.get_utxo(_genesis_hash, _short_channel_id); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - } - public static Access new_impl(AccessInterface arg) { - LDKAccessHolder impl_holder = new LDKAccessHolder(); - impl_holder.held = new Access(new LDKAccessImpl(arg, impl_holder)); - return impl_holder.held; - } - /** - * Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. - * Returns an error if `genesis_hash` is for a different chain or if such a transaction output - * is unknown. - * - * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id - */ - public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) { - long ret = bindings.Access_get_utxo(this.ptr, InternalUtils.check_arr_len(genesis_hash, 32), short_channel_id); - GC.KeepAlive(this); - GC.KeepAlive(genesis_hash); - GC.KeepAlive(short_channel_id); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Amount.cs b/c_sharp/src/org/ldk/structs/Amount.cs new file mode 100644 index 00000000..3450ea90 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Amount.cs @@ -0,0 +1,38 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or + * another currency. + */ +public class Amount : CommonBase { + internal Amount(object _dummy, long ptr) : base(ptr) { } + ~Amount() { + if (ptr != 0) { bindings.Amount_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Amount_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Amount + */ + public Amount clone() { + long ret = bindings.Amount_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs b/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs new file mode 100644 index 00000000..d1821b34 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs @@ -0,0 +1,173 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A descriptor used to sign for a commitment transaction's anchor output. + */ +public class AnchorDescriptor : CommonBase { + internal AnchorDescriptor(object _dummy, long ptr) : base(ptr) { } + ~AnchorDescriptor() { + if (ptr != 0) { bindings.AnchorDescriptor_free(ptr); } + } + + /** + * The parameters required to derive the signer for the anchor input. + */ + public ChannelDerivationParameters get_channel_derivation_parameters() { + long ret = bindings.AnchorDescriptor_get_channel_derivation_parameters(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The parameters required to derive the signer for the anchor input. + */ + public void set_channel_derivation_parameters(org.ldk.structs.ChannelDerivationParameters val) { + bindings.AnchorDescriptor_set_channel_derivation_parameters(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The transaction input's outpoint corresponding to the commitment transaction's anchor + * output. + */ + public OutPoint get_outpoint() { + long ret = bindings.AnchorDescriptor_get_outpoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The transaction input's outpoint corresponding to the commitment transaction's anchor + * output. + */ + public void set_outpoint(org.ldk.structs.OutPoint val) { + bindings.AnchorDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new AnchorDescriptor given each field + */ + public static AnchorDescriptor of(org.ldk.structs.ChannelDerivationParameters channel_derivation_parameters_arg, org.ldk.structs.OutPoint outpoint_arg) { + long ret = bindings.AnchorDescriptor_new(channel_derivation_parameters_arg == null ? 0 : channel_derivation_parameters_arg.ptr, outpoint_arg == null ? 0 : outpoint_arg.ptr); + GC.KeepAlive(channel_derivation_parameters_arg); + GC.KeepAlive(outpoint_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AnchorDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnchorDescriptor(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_derivation_parameters_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.AnchorDescriptor_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the AnchorDescriptor + */ + public AnchorDescriptor clone() { + long ret = bindings.AnchorDescriptor_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AnchorDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnchorDescriptor(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two AnchorDescriptors contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.AnchorDescriptor b) { + bool ret = bindings.AnchorDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is AnchorDescriptor)) return false; + return this.eq((AnchorDescriptor)o); + } + /** + * Returns the UTXO to be spent by the anchor input, which can be obtained via + * [`Self::unsigned_tx_input`]. + */ + public TxOut previous_utxo() { + long ret = bindings.AnchorDescriptor_previous_utxo(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TxOut ret_conv = new TxOut(null, ret); + return ret_conv; + } + + /** + * Returns the unsigned transaction input spending the anchor output in the commitment + * transaction. + */ + public TxIn unsigned_tx_input() { + long ret = bindings.AnchorDescriptor_unsigned_tx_input(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TxIn ret_conv = new TxIn(null, ret); + return ret_conv; + } + + /** + * Returns the witness script of the anchor output in the commitment transaction. + */ + public byte[] witness_script() { + byte[] ret = bindings.AnchorDescriptor_witness_script(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the fully signed witness required to spend the anchor output in the commitment + * transaction. + */ + public byte[] tx_input_witness(byte[] signature) { + byte[] ret = bindings.AnchorDescriptor_tx_input_witness(this.ptr, InternalUtils.check_arr_len(signature, 64)); + GC.KeepAlive(this); + GC.KeepAlive(signature); + return ret; + } + + /** + * Derives the channel signer required to sign the anchor input. + */ + public WriteableEcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { + long ret = bindings.AnchorDescriptor_derive_channel_signer(this.ptr, signer_provider.ptr); + GC.KeepAlive(this); + GC.KeepAlive(signer_provider); + if (ret >= 0 && ret <= 4096) { return null; } + WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(signer_provider); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs b/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs index cd853dd4..6a62b2db 100644 --- a/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs +++ b/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An announcement_signatures message to be sent or received from a peer + * An [`announcement_signatures`] message to be sent to or received from a peer. + * + * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message */ public class AnnouncementSignatures : CommonBase { internal AnnouncementSignatures(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs b/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs index 7d89e523..bd695de7 100644 --- a/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs +++ b/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs @@ -14,8 +14,8 @@ namespace org { namespace ldk { namespace structs { * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so, * writing it to disk/backups by invoking the callback given to it at startup. * [`ChannelManager`] persistence should be done in the background. - * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`] - * at the appropriate intervals. + * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`] + * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals. * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]). * @@ -30,7 +30,9 @@ namespace org { namespace ldk { namespace structs { * unilateral chain closure fees are at risk. * * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor - * [`Event`]: lightning::util::events::Event + * [`Event`]: lightning::events::Event + * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred + * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events * BackgroundProcessor will immediately stop on drop. It should be stored until shutdown. */ public class BackgroundProcessor : CommonBase { @@ -86,7 +88,7 @@ public class BackgroundProcessor : CommonBase { * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable */ public static BackgroundProcessor start(org.ldk.structs.Persister persister, org.ldk.structs.EventHandler event_handler, org.ldk.structs.ChainMonitor chain_monitor, org.ldk.structs.ChannelManager channel_manager, org.ldk.structs.GossipSync gossip_sync, org.ldk.structs.PeerManager peer_manager, org.ldk.structs.Logger logger, org.ldk.structs.Option_WriteableScoreZ scorer) { - long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger == null ? 0 : logger.ptr, scorer.ptr); + long ret = bindings.BackgroundProcessor_start(persister.ptr, event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger.ptr, scorer.ptr); GC.KeepAlive(persister); GC.KeepAlive(event_handler); GC.KeepAlive(chain_monitor); @@ -102,6 +104,7 @@ public class BackgroundProcessor : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(event_handler); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(gossip_sync); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(peer_manager); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); }; diff --git a/c_sharp/src/org/ldk/structs/Balance.cs b/c_sharp/src/org/ldk/structs/Balance.cs index 3214edf0..071fe693 100644 --- a/c_sharp/src/org/ldk/structs/Balance.cs +++ b/c_sharp/src/org/ldk/structs/Balance.cs @@ -37,9 +37,9 @@ public class Balance : CommonBase { * The amount available to claim, in satoshis, excluding the on-chain fees which will be * required to do so. */ - public long claimable_amount_satoshis; + public long amount_satoshis; internal Balance_ClaimableOnChannelClose(long ptr) : base(null, ptr) { - this.claimable_amount_satoshis = bindings.LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(ptr); + this.amount_satoshis = bindings.LDKBalance_ClaimableOnChannelClose_get_amount_satoshis(ptr); } } /** A Balance of type ClaimableAwaitingConfirmations */ @@ -48,14 +48,14 @@ public class Balance : CommonBase { * The amount available to claim, in satoshis, possibly excluding the on-chain fees which * were spent in broadcasting the transaction. */ - public long claimable_amount_satoshis; + public long amount_satoshis; /** * The height at which an [`Event::SpendableOutputs`] event will be generated for this * amount. */ public int confirmation_height; internal Balance_ClaimableAwaitingConfirmations(long ptr) : base(null, ptr) { - this.claimable_amount_satoshis = bindings.LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(ptr); + this.amount_satoshis = bindings.LDKBalance_ClaimableAwaitingConfirmations_get_amount_satoshis(ptr); this.confirmation_height = bindings.LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(ptr); } } @@ -65,15 +65,25 @@ public class Balance : CommonBase { * The amount available to claim, in satoshis, excluding the on-chain fees which will be * required to do so. */ - public long claimable_amount_satoshis; + public long amount_satoshis; /** * The height at which the counterparty may be able to claim the balance if we have not * done so. */ public int timeout_height; + /** + * The payment hash that locks this HTLC. + */ + public byte[] payment_hash; + /** + * The preimage that can be used to claim this HTLC. + */ + public byte[] payment_preimage; internal Balance_ContentiousClaimable(long ptr) : base(null, ptr) { - this.claimable_amount_satoshis = bindings.LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(ptr); + this.amount_satoshis = bindings.LDKBalance_ContentiousClaimable_get_amount_satoshis(ptr); this.timeout_height = bindings.LDKBalance_ContentiousClaimable_get_timeout_height(ptr); + this.payment_hash = bindings.LDKBalance_ContentiousClaimable_get_payment_hash(ptr); + this.payment_preimage = bindings.LDKBalance_ContentiousClaimable_get_payment_preimage(ptr); } } /** A Balance of type MaybeTimeoutClaimableHTLC */ @@ -82,15 +92,20 @@ public class Balance : CommonBase { * The amount potentially available to claim, in satoshis, excluding the on-chain fees * which will be required to do so. */ - public long claimable_amount_satoshis; + public long amount_satoshis; /** * The height at which we will be able to claim the balance if our counterparty has not * done so. */ public int claimable_height; + /** + * The payment hash whose preimage our counterparty needs to claim this HTLC. + */ + public byte[] payment_hash; internal Balance_MaybeTimeoutClaimableHTLC(long ptr) : base(null, ptr) { - this.claimable_amount_satoshis = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis(ptr); + this.amount_satoshis = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_amount_satoshis(ptr); this.claimable_height = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height(ptr); + this.payment_hash = bindings.LDKBalance_MaybeTimeoutClaimableHTLC_get_payment_hash(ptr); } } /** A Balance of type MaybePreimageClaimableHTLC */ @@ -99,15 +114,20 @@ public class Balance : CommonBase { * The amount potentially available to claim, in satoshis, excluding the on-chain fees * which will be required to do so. */ - public long claimable_amount_satoshis; + public long amount_satoshis; /** * The height at which our counterparty will be able to claim the balance if we have not * yet received the preimage and claimed it ourselves. */ public int expiry_height; + /** + * The payment hash whose preimage we need to claim this HTLC. + */ + public byte[] payment_hash; internal Balance_MaybePreimageClaimableHTLC(long ptr) : base(null, ptr) { - this.claimable_amount_satoshis = bindings.LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis(ptr); + this.amount_satoshis = bindings.LDKBalance_MaybePreimageClaimableHTLC_get_amount_satoshis(ptr); this.expiry_height = bindings.LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height(ptr); + this.payment_hash = bindings.LDKBalance_MaybePreimageClaimableHTLC_get_payment_hash(ptr); } } /** A Balance of type CounterpartyRevokedOutputClaimable */ @@ -118,9 +138,9 @@ public class Balance : CommonBase { * Note that for outputs from HTLC balances this may be excluding some on-chain fees that * were already spent. */ - public long claimable_amount_satoshis; + public long amount_satoshis; internal Balance_CounterpartyRevokedOutputClaimable(long ptr) : base(null, ptr) { - this.claimable_amount_satoshis = bindings.LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis(ptr); + this.amount_satoshis = bindings.LDKBalance_CounterpartyRevokedOutputClaimable_get_amount_satoshis(ptr); } } internal long clone_ptr() { @@ -144,9 +164,9 @@ public class Balance : CommonBase { /** * Utility method to constructs a new ClaimableOnChannelClose-variant Balance */ - public static Balance claimable_on_channel_close(long claimable_amount_satoshis) { - long ret = bindings.Balance_claimable_on_channel_close(claimable_amount_satoshis); - GC.KeepAlive(claimable_amount_satoshis); + public static Balance claimable_on_channel_close(long amount_satoshis) { + long ret = bindings.Balance_claimable_on_channel_close(amount_satoshis); + GC.KeepAlive(amount_satoshis); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -156,9 +176,9 @@ public class Balance : CommonBase { /** * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance */ - public static Balance claimable_awaiting_confirmations(long claimable_amount_satoshis, int confirmation_height) { - long ret = bindings.Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); - GC.KeepAlive(claimable_amount_satoshis); + public static Balance claimable_awaiting_confirmations(long amount_satoshis, int confirmation_height) { + long ret = bindings.Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + GC.KeepAlive(amount_satoshis); GC.KeepAlive(confirmation_height); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); @@ -169,10 +189,12 @@ public class Balance : CommonBase { /** * Utility method to constructs a new ContentiousClaimable-variant Balance */ - public static Balance contentious_claimable(long claimable_amount_satoshis, int timeout_height) { - long ret = bindings.Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); - GC.KeepAlive(claimable_amount_satoshis); + public static Balance contentious_claimable(long amount_satoshis, int timeout_height, byte[] payment_hash, byte[] payment_preimage) { + long ret = bindings.Balance_contentious_claimable(amount_satoshis, timeout_height, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_preimage, 32)); + GC.KeepAlive(amount_satoshis); GC.KeepAlive(timeout_height); + GC.KeepAlive(payment_hash); + GC.KeepAlive(payment_preimage); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -182,10 +204,11 @@ public class Balance : CommonBase { /** * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance */ - public static Balance maybe_timeout_claimable_htlc(long claimable_amount_satoshis, int claimable_height) { - long ret = bindings.Balance_maybe_timeout_claimable_htlc(claimable_amount_satoshis, claimable_height); - GC.KeepAlive(claimable_amount_satoshis); + public static Balance maybe_timeout_claimable_htlc(long amount_satoshis, int claimable_height, byte[] payment_hash) { + long ret = bindings.Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, InternalUtils.check_arr_len(payment_hash, 32)); + GC.KeepAlive(amount_satoshis); GC.KeepAlive(claimable_height); + GC.KeepAlive(payment_hash); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -195,10 +218,11 @@ public class Balance : CommonBase { /** * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance */ - public static Balance maybe_preimage_claimable_htlc(long claimable_amount_satoshis, int expiry_height) { - long ret = bindings.Balance_maybe_preimage_claimable_htlc(claimable_amount_satoshis, expiry_height); - GC.KeepAlive(claimable_amount_satoshis); + public static Balance maybe_preimage_claimable_htlc(long amount_satoshis, int expiry_height, byte[] payment_hash) { + long ret = bindings.Balance_maybe_preimage_claimable_htlc(amount_satoshis, expiry_height, InternalUtils.check_arr_len(payment_hash, 32)); + GC.KeepAlive(amount_satoshis); GC.KeepAlive(expiry_height); + GC.KeepAlive(payment_hash); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -208,9 +232,9 @@ public class Balance : CommonBase { /** * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance */ - public static Balance counterparty_revoked_output_claimable(long claimable_amount_satoshis) { - long ret = bindings.Balance_counterparty_revoked_output_claimable(claimable_amount_satoshis); - GC.KeepAlive(claimable_amount_satoshis); + public static Balance counterparty_revoked_output_claimable(long amount_satoshis) { + long ret = bindings.Balance_counterparty_revoked_output_claimable(amount_satoshis); + GC.KeepAlive(amount_satoshis); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Balance ret_hu_conv = org.ldk.structs.Balance.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -232,5 +256,19 @@ public class Balance : CommonBase { if (!(o is Balance)) return false; return this.eq((Balance)o); } + /** + * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able + * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more + * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and + * [`Balance::MaybePreimageClaimableHTLC`]. + * + * On-chain fees required to claim the balance are not included in this amount. + */ + public long claimable_amount_satoshis() { + long ret = bindings.Balance_claimable_amount_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/BaseSign.cs b/c_sharp/src/org/ldk/structs/BaseSign.cs deleted file mode 100644 index 9c908dfa..00000000 --- a/c_sharp/src/org/ldk/structs/BaseSign.cs +++ /dev/null @@ -1,612 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -/** - * A trait to sign Lightning channel transactions as described in - * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md). - * - * Signing services could be implemented on a hardware wallet and should implement signing - * policies in order to be secure. Please refer to the [VLS Policy - * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md) - * for an example of such policies. - */ -public class BaseSign : CommonBase { - internal readonly bindings.LDKBaseSign bindings_instance; - internal BaseSign(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } - private BaseSign(bindings.LDKBaseSign arg, ChannelPublicKeys pubkeys) : base(bindings.LDKBaseSign_new(arg, pubkeys == null ? 0 : pubkeys.clone_ptr())) { - this.ptrs_to.AddLast(arg); - this.bindings_instance = arg; - } - ~BaseSign() { - if (ptr != 0) { bindings.BaseSign_free(ptr); } - } - - public interface BaseSignInterface { - /** - * Gets the per-commitment point for a specific commitment number - * - * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. - */ - byte[] get_per_commitment_point(long _idx); - /** - * Gets the commitment secret for a specific commitment number as part of the revocation process - * - * An external signer implementation should error here if the commitment was already signed - * and should refuse to sign it in the future. - * - * May be called more than once for the same index. - * - * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. - */ - byte[] release_commitment_secret(long _idx); - /** - * Validate the counterparty's signatures on the holder commitment transaction and HTLCs. - * - * This is required in order for the signer to make sure that releasing a commitment - * secret won't leave us without a broadcastable holder transaction. - * Policy checks should be implemented in this function, including checking the amount - * sent to us and checking the HTLCs. - * - * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided. - * A validating signer should ensure that an HTLC output is removed only when the matching - * preimage is provided, or when the value to holder is restored. - * - * Note that all the relevant preimages will be provided, but there may also be additional - * irrelevant or duplicate preimages. - */ - Result_NoneNoneZ validate_holder_commitment(HolderCommitmentTransaction _holder_tx, byte[][] _preimages); - /** - * Returns an arbitrary identifier describing the set of keys which are provided back to you in - * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this - * [`BaseSign`] object uniquely and lookup or re-derive its keys. - */ - byte[] channel_keys_id(); - /** - * 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 outgoing HTLCs that were fulfilled since the last commitment are provided. - * A validating signer should ensure that an HTLC output is removed only when the matching - * preimage is provided, or when the value to holder is restored. - * - * Note that all the relevant preimages will be provided, but there may also be additional - * irrelevant or duplicate preimages. - */ - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction _commitment_tx, byte[][] _preimages); - /** - * Validate the counterparty's revocation. - * - * This is required in order for the signer to make sure that the state has moved - * forward and it is safe to sign the next counterparty commitment. - */ - Result_NoneNoneZ validate_counterparty_revocation(long _idx, byte[] _secret); - /** - * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions. - * - * This will be called - * - with a non-revoked `commitment_tx`. - * - with the latest `commitment_tx` when we initiate a force-close. - * - with the previous `commitment_tx`, just to get claiming HTLC - * signatures, if we are reacting to a [`ChannelMonitor`] - * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) - * that decided to broadcast before it had been updated to the latest `commitment_tx`. - * - * This may be called multiple times for the same transaction. - * - * An external signer implementation should check that the commitment has not been revoked. - * - * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor - */ - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction _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). - */ - Result_SignatureNoneZ sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key); - /** - * 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). - */ - Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, HTLCOutputInCommitment _htlc); - /** - * 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. - */ - Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, HTLCOutputInCommitment _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. - */ - Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction _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`. - */ - Result_SignatureNoneZ sign_holder_anchor_input(byte[] _anchor_tx, long _input); - /** - * Signs a channel announcement message with our funding key and our node secret key (aka - * node_id or network_key), proving it comes from one of the channel participants. - * - * The first returned signature should be from our node secret key, the second from our - * funding key. - * - * 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. - */ - Result_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement(UnsignedChannelAnnouncement _msg); - /** - * Set the counterparty static channel data, including basepoints, - * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. Since these - * are static channel data, they MUST NOT be allowed to change to different values once set, - * as LDK may call this method more than once. - * - * channel_parameters.is_populated() MUST be true. - */ - void provide_channel_parameters(ChannelTransactionParameters _channel_parameters); - } - private class LDKBaseSignHolder { internal BaseSign held; } - private class LDKBaseSignImpl : bindings.LDKBaseSign { - internal LDKBaseSignImpl(BaseSignInterface arg, LDKBaseSignHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } - private BaseSignInterface arg; - private LDKBaseSignHolder impl_holder; - public byte[] get_per_commitment_point(long _idx) { - byte[] ret = arg.get_per_commitment_point(_idx); - GC.KeepAlive(arg); - byte[] result = InternalUtils.check_arr_len(ret, 33); - return result; - } - public byte[] release_commitment_secret(long _idx) { - byte[] ret = arg.release_commitment_secret(_idx); - GC.KeepAlive(arg); - byte[] result = InternalUtils.check_arr_len(ret, 32); - return result; - } - public long validate_holder_commitment(long _holder_tx, byte[][] _preimages) { - org.ldk.structs.HolderCommitmentTransaction _holder_tx_hu_conv = null; if (_holder_tx < 0 || _holder_tx > 4096) { _holder_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, _holder_tx); } - Result_NoneNoneZ ret = arg.validate_holder_commitment(_holder_tx_hu_conv, _preimages); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public byte[] channel_keys_id() { - byte[] ret = arg.channel_keys_id(); - GC.KeepAlive(arg); - byte[] result = InternalUtils.check_arr_len(ret, 32); - return result; - } - public long sign_counterparty_commitment(long _commitment_tx, byte[][] _preimages) { - org.ldk.structs.CommitmentTransaction _commitment_tx_hu_conv = null; if (_commitment_tx < 0 || _commitment_tx > 4096) { _commitment_tx_hu_conv = new org.ldk.structs.CommitmentTransaction(null, _commitment_tx); } - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(_commitment_tx_hu_conv, _preimages); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long validate_counterparty_revocation(long _idx, byte[] _secret) { - Result_NoneNoneZ ret = arg.validate_counterparty_revocation(_idx, _secret); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_holder_commitment_and_htlcs(long _commitment_tx) { - org.ldk.structs.HolderCommitmentTransaction _commitment_tx_hu_conv = null; if (_commitment_tx < 0 || _commitment_tx > 4096) { _commitment_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, _commitment_tx); } - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(_commitment_tx_hu_conv); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key) { - Result_SignatureNoneZ ret = arg.sign_justice_revoked_output(_justice_tx, _input, _amount, _per_commitment_key); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, long _htlc) { - org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); } - Result_SignatureNoneZ ret = arg.sign_justice_revoked_htlc(_justice_tx, _input, _amount, _per_commitment_key, _htlc_hu_conv); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, long _htlc) { - org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); } - Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(_htlc_tx, _input, _amount, _per_commitment_point, _htlc_hu_conv); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_closing_transaction(long _closing_tx) { - org.ldk.structs.ClosingTransaction _closing_tx_hu_conv = null; if (_closing_tx < 0 || _closing_tx > 4096) { _closing_tx_hu_conv = new org.ldk.structs.ClosingTransaction(null, _closing_tx); } - Result_SignatureNoneZ ret = arg.sign_closing_transaction(_closing_tx_hu_conv); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_holder_anchor_input(byte[] _anchor_tx, long _input) { - Result_SignatureNoneZ ret = arg.sign_holder_anchor_input(_anchor_tx, _input); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_channel_announcement(long _msg) { - org.ldk.structs.UnsignedChannelAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, _msg); } - Result_C2Tuple_SignatureSignatureZNoneZ ret = arg.sign_channel_announcement(_msg_hu_conv); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public void provide_channel_parameters(long _channel_parameters) { - org.ldk.structs.ChannelTransactionParameters _channel_parameters_hu_conv = null; if (_channel_parameters < 0 || _channel_parameters > 4096) { _channel_parameters_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, _channel_parameters); } - arg.provide_channel_parameters(_channel_parameters_hu_conv); - GC.KeepAlive(arg); - } - } - public static BaseSign new_impl(BaseSignInterface arg, ChannelPublicKeys pubkeys) { - LDKBaseSignHolder impl_holder = new LDKBaseSignHolder(); - impl_holder.held = new BaseSign(new LDKBaseSignImpl(arg, impl_holder), pubkeys); - return impl_holder.held; - } - /** - * Gets the per-commitment point for a specific commitment number - * - * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. - */ - public byte[] get_per_commitment_point(long idx) { - byte[] ret = bindings.BaseSign_get_per_commitment_point(this.ptr, idx); - GC.KeepAlive(this); - GC.KeepAlive(idx); - return ret; - } - - /** - * Gets the commitment secret for a specific commitment number as part of the revocation process - * - * An external signer implementation should error here if the commitment was already signed - * and should refuse to sign it in the future. - * - * May be called more than once for the same index. - * - * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. - */ - public byte[] release_commitment_secret(long idx) { - byte[] ret = bindings.BaseSign_release_commitment_secret(this.ptr, idx); - GC.KeepAlive(this); - GC.KeepAlive(idx); - return ret; - } - - /** - * Validate the counterparty's signatures on the holder commitment transaction and HTLCs. - * - * This is required in order for the signer to make sure that releasing a commitment - * secret won't leave us without a broadcastable holder transaction. - * Policy checks should be implemented in this function, including checking the amount - * sent to us and checking the HTLCs. - * - * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided. - * A validating signer should ensure that an HTLC output is removed only when the matching - * preimage is provided, or when the value to holder is restored. - * - * Note that all the relevant preimages will be provided, but there may also be additional - * irrelevant or duplicate preimages. - */ - public Result_NoneNoneZ validate_holder_commitment(org.ldk.structs.HolderCommitmentTransaction holder_tx, byte[][] preimages) { - long ret = bindings.BaseSign_validate_holder_commitment(this.ptr, holder_tx == null ? 0 : holder_tx.ptr, preimages != null ? InternalUtils.mapArray(preimages, preimages_conv_8 => InternalUtils.check_arr_len(preimages_conv_8, 32)) : null); - GC.KeepAlive(this); - GC.KeepAlive(holder_tx); - GC.KeepAlive(preimages); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(holder_tx); }; - return ret_hu_conv; - } - - /** - * Returns an arbitrary identifier describing the set of keys which are provided back to you in - * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this - * [`BaseSign`] object uniquely and lookup or re-derive its keys. - */ - public byte[] channel_keys_id() { - byte[] ret = bindings.BaseSign_channel_keys_id(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * 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 outgoing HTLCs that were fulfilled since the last commitment are provided. - * A validating signer should ensure that an HTLC output is removed only when the matching - * preimage is provided, or when the value to holder is restored. - * - * Note that all the relevant preimages will be provided, but there may also be additional - * irrelevant or duplicate preimages. - */ - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] preimages) { - long ret = bindings.BaseSign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr, preimages != null ? InternalUtils.mapArray(preimages, preimages_conv_8 => InternalUtils.check_arr_len(preimages_conv_8, 32)) : null); - GC.KeepAlive(this); - GC.KeepAlive(commitment_tx); - GC.KeepAlive(preimages); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(commitment_tx); }; - return ret_hu_conv; - } - - /** - * Validate the counterparty's revocation. - * - * This is required in order for the signer to make sure that the state has moved - * forward and it is safe to sign the next counterparty commitment. - */ - public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) { - long ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, InternalUtils.check_arr_len(secret, 32)); - GC.KeepAlive(this); - GC.KeepAlive(idx); - GC.KeepAlive(secret); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions. - * - * This will be called - * - with a non-revoked `commitment_tx`. - * - with the latest `commitment_tx` when we initiate a force-close. - * - with the previous `commitment_tx`, just to get claiming HTLC - * signatures, if we are reacting to a [`ChannelMonitor`] - * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) - * that decided to broadcast before it had been updated to the latest `commitment_tx`. - * - * This may be called multiple times for the same transaction. - * - * An external signer implementation should check that the commitment has not been revoked. - * - * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor - */ - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(org.ldk.structs.HolderCommitmentTransaction commitment_tx) { - long ret = bindings.BaseSign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr); - GC.KeepAlive(this); - GC.KeepAlive(commitment_tx); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(commitment_tx); }; - return ret_hu_conv; - } - - /** - * 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). - */ - public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) { - long ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32)); - GC.KeepAlive(this); - GC.KeepAlive(justice_tx); - GC.KeepAlive(input); - GC.KeepAlive(amount); - GC.KeepAlive(per_commitment_key); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * 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). - */ - public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, org.ldk.structs.HTLCOutputInCommitment htlc) { - long ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc == null ? 0 : htlc.ptr); - GC.KeepAlive(this); - GC.KeepAlive(justice_tx); - GC.KeepAlive(input); - GC.KeepAlive(amount); - GC.KeepAlive(per_commitment_key); - GC.KeepAlive(htlc); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(htlc); }; - return ret_hu_conv; - } - - /** - * 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. - */ - public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) { - long ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr); - GC.KeepAlive(this); - GC.KeepAlive(htlc_tx); - GC.KeepAlive(input); - GC.KeepAlive(amount); - GC.KeepAlive(per_commitment_point); - GC.KeepAlive(htlc); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(htlc); }; - return ret_hu_conv; - } - - /** - * 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. - */ - public Result_SignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) { - long ret = bindings.BaseSign_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr); - GC.KeepAlive(this); - GC.KeepAlive(closing_tx); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(closing_tx); }; - return ret_hu_conv; - } - - /** - * 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`. - */ - public Result_SignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) { - long ret = bindings.BaseSign_sign_holder_anchor_input(this.ptr, anchor_tx, input); - GC.KeepAlive(this); - GC.KeepAlive(anchor_tx); - GC.KeepAlive(input); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Signs a channel announcement message with our funding key and our node secret key (aka - * node_id or network_key), proving it comes from one of the channel participants. - * - * The first returned signature should be from our node secret key, the second from our - * funding key. - * - * 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. - */ - public Result_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement(org.ldk.structs.UnsignedChannelAnnouncement msg) { - long ret = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr); - GC.KeepAlive(this); - GC.KeepAlive(msg); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_SignatureSignatureZNoneZ ret_hu_conv = Result_C2Tuple_SignatureSignatureZNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(msg); }; - return ret_hu_conv; - } - - /** - * Set the counterparty static channel data, including basepoints, - * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. Since these - * are static channel data, they MUST NOT be allowed to change to different values once set, - * as LDK may call this method more than once. - * - * channel_parameters.is_populated() MUST be true. - */ - public void provide_channel_parameters(org.ldk.structs.ChannelTransactionParameters channel_parameters) { - bindings.BaseSign_provide_channel_parameters(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr); - GC.KeepAlive(this); - GC.KeepAlive(channel_parameters); - if (this != null) { this.ptrs_to.AddLast(channel_parameters); }; - } - - /** - * Frees any resources associated with this object given its this_arg pointer. - * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. - */ - public ChannelPublicKeys get_pubkeys() { - long ret = bindings.BaseSign_get_pubkeys(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/BestBlock.cs b/c_sharp/src/org/ldk/structs/BestBlock.cs index 60973ab9..9968c9c3 100644 --- a/c_sharp/src/org/ldk/structs/BestBlock.cs +++ b/c_sharp/src/org/ldk/structs/BestBlock.cs @@ -54,8 +54,8 @@ public class BestBlock : CommonBase { * Constructs a `BestBlock` that represents the genesis block at height 0 of the given * network. */ - public static BestBlock from_genesis(Network network) { - long ret = bindings.BestBlock_from_genesis(network); + public static BestBlock from_network(Network network) { + long ret = bindings.BestBlock_from_network(network); GC.KeepAlive(network); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } diff --git a/c_sharp/src/org/ldk/structs/BigSize.cs b/c_sharp/src/org/ldk/structs/BigSize.cs index 315e1b62..9749cfc7 100644 --- a/c_sharp/src/org/ldk/structs/BigSize.cs +++ b/c_sharp/src/org/ldk/structs/BigSize.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's + * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's * variable-length integers except that it is serialized in big-endian instead of little-endian. * * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be @@ -45,5 +45,72 @@ public class BigSize : CommonBase { return ret_hu_conv; } + internal long clone_ptr() { + long ret = bindings.BigSize_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the BigSize + */ + public BigSize clone() { + long ret = bindings.BigSize_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BigSize ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BigSize(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the BigSize. + */ + public long hash() { + long ret = bindings.BigSize_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two BigSizes contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.BigSize b) { + bool ret = bindings.BigSize_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is BigSize)) return false; + return this.eq((BigSize)o); + } + /** + * Serialize the BigSize object into a byte array which can be read by BigSize_read + */ + public byte[] write() { + byte[] ret = bindings.BigSize_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a BigSize from a byte array, created by BigSize_write + */ + public static Result_BigSizeDecodeErrorZ read(byte[] ser) { + long ret = bindings.BigSize_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/BlindedHop.cs b/c_sharp/src/org/ldk/structs/BlindedHop.cs index ecf73764..170decf9 100644 --- a/c_sharp/src/org/ldk/structs/BlindedHop.cs +++ b/c_sharp/src/org/ldk/structs/BlindedHop.cs @@ -34,6 +34,35 @@ public class BlindedHop : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the BlindedHop. + */ + public long hash() { + long ret = bindings.BlindedHop_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedHops contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.BlindedHop b) { + bool ret = bindings.BlindedHop_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is BlindedHop)) return false; + return this.eq((BlindedHop)o); + } /** * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read */ diff --git a/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs b/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs new file mode 100644 index 00000000..c71e11e9 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs @@ -0,0 +1,142 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo + */ +public class BlindedHopFeatures : CommonBase { + internal BlindedHopFeatures(object _dummy, long ptr) : base(ptr) { } + ~BlindedHopFeatures() { + if (ptr != 0) { bindings.BlindedHopFeatures_free(ptr); } + } + + /** + * Checks if two BlindedHopFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.BlindedHopFeatures b) { + bool ret = bindings.BlindedHopFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is BlindedHopFeatures)) return false; + return this.eq((BlindedHopFeatures)o); + } + internal long clone_ptr() { + long ret = bindings.BlindedHopFeatures_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the BlindedHopFeatures + */ + public BlindedHopFeatures clone() { + long ret = bindings.BlindedHopFeatures_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedHopFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedHopFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Create a blank Features with no features set + */ + public static BlindedHopFeatures empty() { + long ret = bindings.BlindedHopFeatures_empty(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedHopFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedHopFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.BlindedHopFeatures other) { + bool ret = bindings.BlindedHopFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ + public bool requires_unknown_bits() { + bool ret = bindings.BlindedHopFeatures_requires_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.BlindedHopFeatures_set_required_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.BlindedHopFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.BlindedHopFeatures_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write + */ + public static Result_BlindedHopFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedHopFeatures_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BlindedPath.cs b/c_sharp/src/org/ldk/structs/BlindedPath.cs index f5abed57..710a4c2e 100644 --- a/c_sharp/src/org/ldk/structs/BlindedPath.cs +++ b/c_sharp/src/org/ldk/structs/BlindedPath.cs @@ -7,8 +7,8 @@ namespace org { namespace ldk { namespace structs { /** - * Onion messages can be sent and received to blinded paths, which serve to hide the identity of - * the recipient. + * Onion messages and payments can be sent and received to blinded paths, which serve to hide the + * identity of the recipient. */ public class BlindedPath : CommonBase { internal BlindedPath(object _dummy, long ptr) : base(ptr) { } @@ -35,18 +35,47 @@ public class BlindedPath : CommonBase { } /** - * Create a blinded path to be forwarded along `node_pks`. The last node pubkey in `node_pks` - * will be the destination node. + * Generates a non-cryptographic 64-bit hash of the BlindedPath. + */ + public long hash() { + long ret = bindings.BlindedPath_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedPaths contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.BlindedPath b) { + bool ret = bindings.BlindedPath_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is BlindedPath)) return false; + return this.eq((BlindedPath)o); + } + /** + * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node + * pubkey in `node_pks` will be the destination node. * * Errors if less than two hops are provided or if `node_pk`(s) are invalid. */ - public static Result_BlindedPathNoneZ of(byte[][] node_pks, org.ldk.structs.KeysInterface keys_manager) { - long ret = bindings.BlindedPath_new(node_pks != null ? InternalUtils.mapArray(node_pks, node_pks_conv_8 => InternalUtils.check_arr_len(node_pks_conv_8, 33)) : null, keys_manager == null ? 0 : keys_manager.ptr); + public static Result_BlindedPathNoneZ new_for_message(byte[][] node_pks, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedPath_new_for_message(node_pks != null ? InternalUtils.mapArray(node_pks, node_pks_conv_8 => InternalUtils.check_arr_len(node_pks_conv_8, 33)) : null, entropy_source.ptr); GC.KeepAlive(node_pks); - GC.KeepAlive(keys_manager); + GC.KeepAlive(entropy_source); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs b/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs new file mode 100644 index 00000000..aba93ece --- /dev/null +++ b/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs @@ -0,0 +1,230 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Information needed to route a payment across a [`BlindedPath`]. + */ +public class BlindedPayInfo : CommonBase { + internal BlindedPayInfo(object _dummy, long ptr) : base(ptr) { } + ~BlindedPayInfo() { + if (ptr != 0) { bindings.BlindedPayInfo_free(ptr); } + } + + /** + * Base fee charged (in millisatoshi) for the entire blinded path. + */ + public int get_fee_base_msat() { + int ret = bindings.BlindedPayInfo_get_fee_base_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Base fee charged (in millisatoshi) for the entire blinded path. + */ + public void set_fee_base_msat(int val) { + bindings.BlindedPayInfo_set_fee_base_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path + * (i.e., 10,000 is 1%). + */ + public int get_fee_proportional_millionths() { + int ret = bindings.BlindedPayInfo_get_fee_proportional_millionths(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path + * (i.e., 10,000 is 1%). + */ + public void set_fee_proportional_millionths(int val) { + bindings.BlindedPayInfo_set_fee_proportional_millionths(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded + * path. + */ + public short get_cltv_expiry_delta() { + short ret = bindings.BlindedPayInfo_get_cltv_expiry_delta(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded + * path. + */ + public void set_cltv_expiry_delta(short val) { + bindings.BlindedPayInfo_set_cltv_expiry_delta(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the + * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as + * seen by the recipient. + */ + public long get_htlc_minimum_msat() { + long ret = bindings.BlindedPayInfo_get_htlc_minimum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the + * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as + * seen by the recipient. + */ + public void set_htlc_minimum_msat(long val) { + bindings.BlindedPayInfo_set_htlc_minimum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the + * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as + * seen by the recipient. + */ + public long get_htlc_maximum_msat() { + long ret = bindings.BlindedPayInfo_get_htlc_maximum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the + * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as + * seen by the recipient. + */ + public void set_htlc_maximum_msat(long val) { + bindings.BlindedPayInfo_set_htlc_maximum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an + * onion payload. + */ + public BlindedHopFeatures get_features() { + long ret = bindings.BlindedPayInfo_get_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedHopFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedHopFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an + * onion payload. + */ + public void set_features(org.ldk.structs.BlindedHopFeatures val) { + bindings.BlindedPayInfo_set_features(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new BlindedPayInfo given each field + */ + public static BlindedPayInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.BlindedHopFeatures features_arg) { + long ret = bindings.BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg == null ? 0 : features_arg.ptr); + GC.KeepAlive(fee_base_msat_arg); + GC.KeepAlive(fee_proportional_millionths_arg); + GC.KeepAlive(cltv_expiry_delta_arg); + GC.KeepAlive(htlc_minimum_msat_arg); + GC.KeepAlive(htlc_maximum_msat_arg); + GC.KeepAlive(features_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.BlindedPayInfo_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the BlindedPayInfo + */ + public BlindedPayInfo clone() { + long ret = bindings.BlindedPayInfo_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo. + */ + public long hash() { + long ret = bindings.BlindedPayInfo_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedPayInfos contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.BlindedPayInfo b) { + bool ret = bindings.BlindedPayInfo_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is BlindedPayInfo)) return false; + return this.eq((BlindedPayInfo)o); + } + /** + * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read + */ + public byte[] write() { + byte[] ret = bindings.BlindedPayInfo_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write + */ + public static Result_BlindedPayInfoDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedPayInfo_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BlindedTail.cs b/c_sharp/src/org/ldk/structs/BlindedTail.cs new file mode 100644 index 00000000..f0fcc39f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/BlindedTail.cs @@ -0,0 +1,196 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in + * their [`Bolt12Invoice`]. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ +public class BlindedTail : CommonBase { + internal BlindedTail(object _dummy, long ptr) : base(ptr) { } + ~BlindedTail() { + if (ptr != 0) { bindings.BlindedTail_free(ptr); } + } + + /** + * The hops of the [`BlindedPath`] provided by the recipient. + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath + */ + public BlindedHop[] get_hops() { + long[] ret = bindings.BlindedTail_get_hops(this.ptr); + GC.KeepAlive(this); + int ret_conv_12_len = ret.Length; + BlindedHop[] ret_conv_12_arr = new BlindedHop[ret_conv_12_len]; + for (int m = 0; m < ret_conv_12_len; m++) { + long ret_conv_12 = ret[m]; + org.ldk.structs.BlindedHop ret_conv_12_hu_conv = null; if (ret_conv_12 < 0 || ret_conv_12 > 4096) { ret_conv_12_hu_conv = new org.ldk.structs.BlindedHop(null, ret_conv_12); } + if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_12_arr[m] = ret_conv_12_hu_conv; + } + return ret_conv_12_arr; + } + + /** + * The hops of the [`BlindedPath`] provided by the recipient. + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath + */ + public void set_hops(BlindedHop[] val) { + bindings.BlindedTail_set_hops(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_12 => val_conv_12 == null ? 0 : val_conv_12.ptr) : null); + GC.KeepAlive(this); + GC.KeepAlive(val); + foreach (BlindedHop val_conv_12 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_12); }; }; + } + + /** + * The blinding point of the [`BlindedPath`] provided by the recipient. + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath + */ + public byte[] get_blinding_point() { + byte[] ret = bindings.BlindedTail_get_blinding_point(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The blinding point of the [`BlindedPath`] provided by the recipient. + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath + */ + public void set_blinding_point(byte[] val) { + bindings.BlindedTail_set_blinding_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from + * inferring the destination. May be 0. + */ + public int get_excess_final_cltv_expiry_delta() { + int ret = bindings.BlindedTail_get_excess_final_cltv_expiry_delta(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from + * inferring the destination. May be 0. + */ + public void set_excess_final_cltv_expiry_delta(int val) { + bindings.BlindedTail_set_excess_final_cltv_expiry_delta(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The total amount paid on this [`Path`], excluding the fees. + */ + public long get_final_value_msat() { + long ret = bindings.BlindedTail_get_final_value_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The total amount paid on this [`Path`], excluding the fees. + */ + public void set_final_value_msat(long val) { + bindings.BlindedTail_set_final_value_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new BlindedTail given each field + */ + public static BlindedTail of(BlindedHop[] hops_arg, byte[] blinding_point_arg, int excess_final_cltv_expiry_delta_arg, long final_value_msat_arg) { + long ret = bindings.BlindedTail_new(hops_arg != null ? InternalUtils.mapArray(hops_arg, hops_arg_conv_12 => hops_arg_conv_12 == null ? 0 : hops_arg_conv_12.ptr) : null, InternalUtils.check_arr_len(blinding_point_arg, 33), excess_final_cltv_expiry_delta_arg, final_value_msat_arg); + GC.KeepAlive(hops_arg); + GC.KeepAlive(blinding_point_arg); + GC.KeepAlive(excess_final_cltv_expiry_delta_arg); + GC.KeepAlive(final_value_msat_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedTail ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedTail(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (BlindedHop hops_arg_conv_12 in hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(hops_arg_conv_12); }; }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.BlindedTail_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the BlindedTail + */ + public BlindedTail clone() { + long ret = bindings.BlindedTail_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedTail ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedTail(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the BlindedTail. + */ + public long hash() { + long ret = bindings.BlindedTail_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two BlindedTails contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.BlindedTail b) { + bool ret = bindings.BlindedTail_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is BlindedTail)) return false; + return this.eq((BlindedTail)o); + } + /** + * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read + */ + public byte[] write() { + byte[] ret = bindings.BlindedTail_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a BlindedTail from a byte array, created by BlindedTail_write + */ + public static Result_BlindedTailDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedTail_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs new file mode 100644 index 00000000..3768dd0d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs @@ -0,0 +1,375 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Represents a syntactically and semantically correct lightning BOLT11 invoice. + * + * There are three ways to construct a `Bolt11Invoice`: + * 1. using [`InvoiceBuilder`] + * 2. using [`Bolt11Invoice::from_signed`] + * 3. using `str::parse::(&str)` (see [`Bolt11Invoice::from_str`]) + * + * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr + */ +public class Bolt11Invoice : CommonBase { + internal Bolt11Invoice(object _dummy, long ptr) : base(ptr) { } + ~Bolt11Invoice() { + if (ptr != 0) { bindings.Bolt11Invoice_free(ptr); } + } + + /** + * Checks if two Bolt11Invoices contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Bolt11Invoice b) { + bool ret = bindings.Bolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt11Invoice)) return false; + return this.eq((Bolt11Invoice)o); + } + internal long clone_ptr() { + long ret = bindings.Bolt11Invoice_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt11Invoice + */ + public Bolt11Invoice clone() { + long ret = bindings.Bolt11Invoice_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice. + */ + public long hash() { + long ret = bindings.Bolt11Invoice_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * The hash of the [`RawBolt11Invoice`] that was signed. + */ + public byte[] signable_hash() { + byte[] ret = bindings.Bolt11Invoice_signable_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Transform the `Bolt11Invoice` into its unchecked version. + */ + public SignedRawBolt11Invoice into_signed_raw() { + long ret = bindings.Bolt11Invoice_into_signed_raw(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SignedRawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawBolt11Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Check that the invoice is signed correctly and that key recovery works + */ + public Result_NoneBolt11SemanticErrorZ check_signature() { + long ret = bindings.Bolt11Invoice_check_signature(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt11SemanticErrorZ ret_hu_conv = Result_NoneBolt11SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants. + * ``` + * use lightning_invoice::*; + * + * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\ + * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\ + * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\ + * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\ + * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\ + * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\ + * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\ + * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\ + * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\ + * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\ + * j5r6drg6k6zcqj0fcwg\"; + * + * let signed = invoice.parse::().unwrap(); + * + * assert!(Bolt11Invoice::from_signed(signed).is_ok()); + * ``` + */ + public static Result_Bolt11InvoiceBolt11SemanticErrorZ from_signed(org.ldk.structs.SignedRawBolt11Invoice signed_invoice) { + long ret = bindings.Bolt11Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr); + GC.KeepAlive(signed_invoice); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(signed_invoice); }; + return ret_hu_conv; + } + + /** + * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time) + */ + public long timestamp() { + long ret = bindings.Bolt11Invoice_timestamp(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch + */ + public long duration_since_epoch() { + long ret = bindings.Bolt11Invoice_duration_since_epoch(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the hash to which we will receive the preimage on completion of the payment + */ + public byte[] payment_hash() { + byte[] ret = bindings.Bolt11Invoice_payment_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Get the payee's public key if one was included in the invoice + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public byte[] payee_pub_key() { + byte[] ret = bindings.Bolt11Invoice_payee_pub_key(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Get the payment secret if one was included in the invoice + */ + public byte[] payment_secret() { + byte[] ret = bindings.Bolt11Invoice_payment_secret(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Get the payment metadata blob if one was included in the invoice + */ + public Option_CVec_u8ZZ payment_metadata() { + long ret = bindings.Bolt11Invoice_payment_metadata(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Get the invoice features if they were included in the invoice + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Bolt11InvoiceFeatures features() { + long ret = bindings.Bolt11Invoice_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Recover the payee's public key (only to be used if none was included in the invoice) + */ + public byte[] recover_payee_pub_key() { + byte[] ret = bindings.Bolt11Invoice_recover_payee_pub_key(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the Duration since the Unix epoch at which the invoice expires. + * Returning None if overflow occurred. + */ + public Option_DurationZ expires_at() { + long ret = bindings.Bolt11Invoice_expires_at(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`]. + */ + public long expiry_time() { + long ret = bindings.Bolt11Invoice_expiry_time(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns whether the invoice has expired. + */ + public bool is_expired() { + bool ret = bindings.Bolt11Invoice_is_expired(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the Duration remaining until the invoice expires. + */ + public long duration_until_expiry() { + long ret = bindings.Bolt11Invoice_duration_until_expiry(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the Duration remaining until the invoice expires given the current time. + * `time` is the timestamp as a duration since the Unix epoch. + */ + public long expiration_remaining_from_epoch(long time) { + long ret = bindings.Bolt11Invoice_expiration_remaining_from_epoch(this.ptr, time); + GC.KeepAlive(this); + GC.KeepAlive(time); + return ret; + } + + /** + * Returns whether the expiry time would pass at the given point in time. + * `at_time` is the timestamp as a duration since the Unix epoch. + */ + public bool would_expire(long at_time) { + bool ret = bindings.Bolt11Invoice_would_expire(this.ptr, at_time); + GC.KeepAlive(this); + GC.KeepAlive(at_time); + return ret; + } + + /** + * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise + * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`]. + */ + public long min_final_cltv_expiry_delta() { + long ret = bindings.Bolt11Invoice_min_final_cltv_expiry_delta(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns a list of all fallback addresses as [`Address`]es + */ + public string[] fallback_addresses() { + string[] ret = bindings.Bolt11Invoice_fallback_addresses(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns a list of all routes included in the invoice + */ + public PrivateRoute[] private_routes() { + long[] ret = bindings.Bolt11Invoice_private_routes(this.ptr); + GC.KeepAlive(this); + int ret_conv_14_len = ret.Length; + PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret_conv_14_len]; + for (int o = 0; o < ret_conv_14_len; o++) { + long ret_conv_14 = ret[o]; + org.ldk.structs.PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.PrivateRoute(null, ret_conv_14); } + if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_14_arr[o] = ret_conv_14_hu_conv; + } + return ret_conv_14_arr; + } + + /** + * Returns a list of all routes included in the invoice as the underlying hints + */ + public RouteHint[] route_hints() { + long[] ret = bindings.Bolt11Invoice_route_hints(this.ptr); + GC.KeepAlive(this); + int ret_conv_11_len = ret.Length; + RouteHint[] ret_conv_11_arr = new RouteHint[ret_conv_11_len]; + for (int l = 0; l < ret_conv_11_len; l++) { + long ret_conv_11 = ret[l]; + org.ldk.structs.RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new org.ldk.structs.RouteHint(null, ret_conv_11); } + if (ret_conv_11_hu_conv != null) { ret_conv_11_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_11_arr[l] = ret_conv_11_hu_conv; + } + return ret_conv_11_arr; + } + + /** + * Returns the currency for which the invoice was issued + */ + public Currency currency() { + Currency ret = bindings.Bolt11Invoice_currency(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the amount if specified in the invoice as millisatoshis. + */ + public Option_u64Z amount_milli_satoshis() { + long ret = bindings.Bolt11Invoice_amount_milli_satoshis(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Read a Bolt11Invoice object from a string + */ + public static Result_Bolt11InvoiceParseOrSemanticErrorZ from_str(string s) { + long ret = bindings.Bolt11Invoice_from_str(s); + GC.KeepAlive(s); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Get the string representation of a Bolt11Invoice object + */ + public string to_str() { + string ret = bindings.Bolt11Invoice_to_str(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs b/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs new file mode 100644 index 00000000..cfbf1287 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs @@ -0,0 +1,278 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Features used within an invoice. + */ +public class Bolt11InvoiceFeatures : CommonBase { + internal Bolt11InvoiceFeatures(object _dummy, long ptr) : base(ptr) { } + ~Bolt11InvoiceFeatures() { + if (ptr != 0) { bindings.Bolt11InvoiceFeatures_free(ptr); } + } + + /** + * Checks if two Bolt11InvoiceFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Bolt11InvoiceFeatures b) { + bool ret = bindings.Bolt11InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt11InvoiceFeatures)) return false; + return this.eq((Bolt11InvoiceFeatures)o); + } + internal long clone_ptr() { + long ret = bindings.Bolt11InvoiceFeatures_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt11InvoiceFeatures + */ + public Bolt11InvoiceFeatures clone() { + long ret = bindings.Bolt11InvoiceFeatures_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Create a blank Features with no features set + */ + public static Bolt11InvoiceFeatures empty() { + long ret = bindings.Bolt11InvoiceFeatures_empty(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.Bolt11InvoiceFeatures other) { + bool ret = bindings.Bolt11InvoiceFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ + public bool requires_unknown_bits() { + bool ret = bindings.Bolt11InvoiceFeatures_requires_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.Bolt11InvoiceFeatures_set_required_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.Bolt11InvoiceFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.Bolt11InvoiceFeatures_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write + */ + public static Result_Bolt11InvoiceFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt11InvoiceFeatures_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Set this feature as optional. + */ + public void set_variable_length_onion_optional() { + bindings.Bolt11InvoiceFeatures_set_variable_length_onion_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_variable_length_onion_required() { + bindings.Bolt11InvoiceFeatures_set_variable_length_onion_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_variable_length_onion() { + bool ret = bindings.Bolt11InvoiceFeatures_supports_variable_length_onion(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_variable_length_onion() { + bool ret = bindings.Bolt11InvoiceFeatures_requires_variable_length_onion(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_payment_secret_optional() { + bindings.Bolt11InvoiceFeatures_set_payment_secret_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_payment_secret_required() { + bindings.Bolt11InvoiceFeatures_set_payment_secret_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_payment_secret() { + bool ret = bindings.Bolt11InvoiceFeatures_supports_payment_secret(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_payment_secret() { + bool ret = bindings.Bolt11InvoiceFeatures_requires_payment_secret(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_basic_mpp_optional() { + bindings.Bolt11InvoiceFeatures_set_basic_mpp_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_basic_mpp_required() { + bindings.Bolt11InvoiceFeatures_set_basic_mpp_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_basic_mpp() { + bool ret = bindings.Bolt11InvoiceFeatures_supports_basic_mpp(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_basic_mpp() { + bool ret = bindings.Bolt11InvoiceFeatures_requires_basic_mpp(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_payment_metadata_optional() { + bindings.Bolt11InvoiceFeatures_set_payment_metadata_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_payment_metadata_required() { + bindings.Bolt11InvoiceFeatures_set_payment_metadata_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_payment_metadata() { + bool ret = bindings.Bolt11InvoiceFeatures_supports_payment_metadata(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_payment_metadata() { + bool ret = bindings.Bolt11InvoiceFeatures_requires_payment_metadata(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs b/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs new file mode 100644 index 00000000..aed040ab --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs @@ -0,0 +1,66 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Recoverable signature + */ +public class Bolt11InvoiceSignature : CommonBase { + internal Bolt11InvoiceSignature(object _dummy, long ptr) : base(ptr) { } + ~Bolt11InvoiceSignature() { + if (ptr != 0) { bindings.Bolt11InvoiceSignature_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Bolt11InvoiceSignature_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt11InvoiceSignature + */ + public Bolt11InvoiceSignature clone() { + long ret = bindings.Bolt11InvoiceSignature_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceSignature(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature. + */ + public long hash() { + long ret = bindings.Bolt11InvoiceSignature_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two Bolt11InvoiceSignatures contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Bolt11InvoiceSignature b) { + bool ret = bindings.Bolt11InvoiceSignature_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt11InvoiceSignature)) return false; + return this.eq((Bolt11InvoiceSignature)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs b/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs new file mode 100644 index 00000000..ad611578 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs @@ -0,0 +1,398 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Errors that indicate what is wrong with the invoice. They have some granularity for debug + * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user. + */ +public class Bolt11ParseError : CommonBase { + protected Bolt11ParseError(object _dummy, long ptr) : base(ptr) { } + ~Bolt11ParseError() { + if (ptr != 0) { bindings.Bolt11ParseError_free(ptr); } + } + + internal static Bolt11ParseError constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKBolt11ParseError_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Bolt11ParseError_Bech32Error(ptr); + case 1: return new Bolt11ParseError_ParseAmountError(ptr); + case 2: return new Bolt11ParseError_MalformedSignature(ptr); + case 3: return new Bolt11ParseError_BadPrefix(ptr); + case 4: return new Bolt11ParseError_UnknownCurrency(ptr); + case 5: return new Bolt11ParseError_UnknownSiPrefix(ptr); + case 6: return new Bolt11ParseError_MalformedHRP(ptr); + case 7: return new Bolt11ParseError_TooShortDataPart(ptr); + case 8: return new Bolt11ParseError_UnexpectedEndOfTaggedFields(ptr); + case 9: return new Bolt11ParseError_DescriptionDecodeError(ptr); + case 10: return new Bolt11ParseError_PaddingError(ptr); + case 11: return new Bolt11ParseError_IntegerOverflowError(ptr); + case 12: return new Bolt11ParseError_InvalidSegWitProgramLength(ptr); + case 13: return new Bolt11ParseError_InvalidPubKeyHashLength(ptr); + case 14: return new Bolt11ParseError_InvalidScriptHashLength(ptr); + case 15: return new Bolt11ParseError_InvalidRecoveryId(ptr); + case 16: return new Bolt11ParseError_InvalidSliceLength(ptr); + case 17: return new Bolt11ParseError_Skip(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Bolt11ParseError of type Bech32Error */ + public class Bolt11ParseError_Bech32Error : Bolt11ParseError { + public Bech32Error bech32_error; + internal Bolt11ParseError_Bech32Error(long ptr) : base(null, ptr) { + long bech32_error = bindings.LDKBolt11ParseError_Bech32Error_get_bech32_error(ptr); + org.ldk.structs.Bech32Error bech32_error_hu_conv = org.ldk.structs.Bech32Error.constr_from_ptr(bech32_error); + if (bech32_error_hu_conv != null) { bech32_error_hu_conv.ptrs_to.AddLast(this); }; + this.bech32_error = bech32_error_hu_conv; + } + } + /** A Bolt11ParseError of type ParseAmountError */ + public class Bolt11ParseError_ParseAmountError : Bolt11ParseError { + public UnqualifiedError parse_amount_error; + internal Bolt11ParseError_ParseAmountError(long ptr) : base(null, ptr) { + int parse_amount_error = bindings.LDKBolt11ParseError_ParseAmountError_get_parse_amount_error(ptr); + UnqualifiedError parse_amount_error_conv = new UnqualifiedError(parse_amount_error); + this.parse_amount_error = parse_amount_error_conv; + } + } + /** A Bolt11ParseError of type MalformedSignature */ + public class Bolt11ParseError_MalformedSignature : Bolt11ParseError { + public Secp256k1Error malformed_signature; + internal Bolt11ParseError_MalformedSignature(long ptr) : base(null, ptr) { + this.malformed_signature = bindings.LDKBolt11ParseError_MalformedSignature_get_malformed_signature(ptr); + } + } + /** A Bolt11ParseError of type BadPrefix */ + public class Bolt11ParseError_BadPrefix : Bolt11ParseError { + internal Bolt11ParseError_BadPrefix(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type UnknownCurrency */ + public class Bolt11ParseError_UnknownCurrency : Bolt11ParseError { + internal Bolt11ParseError_UnknownCurrency(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type UnknownSiPrefix */ + public class Bolt11ParseError_UnknownSiPrefix : Bolt11ParseError { + internal Bolt11ParseError_UnknownSiPrefix(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type MalformedHRP */ + public class Bolt11ParseError_MalformedHRP : Bolt11ParseError { + internal Bolt11ParseError_MalformedHRP(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type TooShortDataPart */ + public class Bolt11ParseError_TooShortDataPart : Bolt11ParseError { + internal Bolt11ParseError_TooShortDataPart(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type UnexpectedEndOfTaggedFields */ + public class Bolt11ParseError_UnexpectedEndOfTaggedFields : Bolt11ParseError { + internal Bolt11ParseError_UnexpectedEndOfTaggedFields(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type DescriptionDecodeError */ + public class Bolt11ParseError_DescriptionDecodeError : Bolt11ParseError { + public UnqualifiedError description_decode_error; + internal Bolt11ParseError_DescriptionDecodeError(long ptr) : base(null, ptr) { + int description_decode_error = bindings.LDKBolt11ParseError_DescriptionDecodeError_get_description_decode_error(ptr); + UnqualifiedError description_decode_error_conv = new UnqualifiedError(description_decode_error); + this.description_decode_error = description_decode_error_conv; + } + } + /** A Bolt11ParseError of type PaddingError */ + public class Bolt11ParseError_PaddingError : Bolt11ParseError { + internal Bolt11ParseError_PaddingError(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type IntegerOverflowError */ + public class Bolt11ParseError_IntegerOverflowError : Bolt11ParseError { + internal Bolt11ParseError_IntegerOverflowError(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type InvalidSegWitProgramLength */ + public class Bolt11ParseError_InvalidSegWitProgramLength : Bolt11ParseError { + internal Bolt11ParseError_InvalidSegWitProgramLength(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type InvalidPubKeyHashLength */ + public class Bolt11ParseError_InvalidPubKeyHashLength : Bolt11ParseError { + internal Bolt11ParseError_InvalidPubKeyHashLength(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type InvalidScriptHashLength */ + public class Bolt11ParseError_InvalidScriptHashLength : Bolt11ParseError { + internal Bolt11ParseError_InvalidScriptHashLength(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type InvalidRecoveryId */ + public class Bolt11ParseError_InvalidRecoveryId : Bolt11ParseError { + internal Bolt11ParseError_InvalidRecoveryId(long ptr) : base(null, ptr) { + } + } + /** A Bolt11ParseError of type InvalidSliceLength */ + public class Bolt11ParseError_InvalidSliceLength : Bolt11ParseError { + public string invalid_slice_length; + internal Bolt11ParseError_InvalidSliceLength(long ptr) : base(null, ptr) { + this.invalid_slice_length = bindings.LDKBolt11ParseError_InvalidSliceLength_get_invalid_slice_length(ptr); + } + } + /** A Bolt11ParseError of type Skip */ + public class Bolt11ParseError_Skip : Bolt11ParseError { + internal Bolt11ParseError_Skip(long ptr) : base(null, ptr) { + } + } + internal long clone_ptr() { + long ret = bindings.Bolt11ParseError_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt11ParseError + */ + public Bolt11ParseError clone() { + long ret = bindings.Bolt11ParseError_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Bech32Error-variant Bolt11ParseError + */ + public static Bolt11ParseError bech32_error(org.ldk.structs.Bech32Error a) { + long ret = bindings.Bolt11ParseError_bech32_error(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError + */ + public static Bolt11ParseError parse_amount_error(org.ldk.util.UnqualifiedError a) { + long ret = bindings.Bolt11ParseError_parse_amount_error(0); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError + */ + public static Bolt11ParseError malformed_signature(Secp256k1Error a) { + long ret = bindings.Bolt11ParseError_malformed_signature(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new BadPrefix-variant Bolt11ParseError + */ + public static Bolt11ParseError bad_prefix() { + long ret = bindings.Bolt11ParseError_bad_prefix(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError + */ + public static Bolt11ParseError unknown_currency() { + long ret = bindings.Bolt11ParseError_unknown_currency(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError + */ + public static Bolt11ParseError unknown_si_prefix() { + long ret = bindings.Bolt11ParseError_unknown_si_prefix(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError + */ + public static Bolt11ParseError malformed_hrp() { + long ret = bindings.Bolt11ParseError_malformed_hrp(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError + */ + public static Bolt11ParseError too_short_data_part() { + long ret = bindings.Bolt11ParseError_too_short_data_part(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError + */ + public static Bolt11ParseError unexpected_end_of_tagged_fields() { + long ret = bindings.Bolt11ParseError_unexpected_end_of_tagged_fields(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError + */ + public static Bolt11ParseError description_decode_error(org.ldk.util.UnqualifiedError a) { + long ret = bindings.Bolt11ParseError_description_decode_error(0); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PaddingError-variant Bolt11ParseError + */ + public static Bolt11ParseError padding_error() { + long ret = bindings.Bolt11ParseError_padding_error(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError + */ + public static Bolt11ParseError integer_overflow_error() { + long ret = bindings.Bolt11ParseError_integer_overflow_error(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError + */ + public static Bolt11ParseError invalid_seg_wit_program_length() { + long ret = bindings.Bolt11ParseError_invalid_seg_wit_program_length(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError + */ + public static Bolt11ParseError invalid_pub_key_hash_length() { + long ret = bindings.Bolt11ParseError_invalid_pub_key_hash_length(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError + */ + public static Bolt11ParseError invalid_script_hash_length() { + long ret = bindings.Bolt11ParseError_invalid_script_hash_length(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError + */ + public static Bolt11ParseError invalid_recovery_id() { + long ret = bindings.Bolt11ParseError_invalid_recovery_id(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError + */ + public static Bolt11ParseError invalid_slice_length(string a) { + long ret = bindings.Bolt11ParseError_invalid_slice_length(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Skip-variant Bolt11ParseError + */ + public static Bolt11ParseError skip() { + long ret = bindings.Bolt11ParseError_skip(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Checks if two Bolt11ParseErrors contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.Bolt11ParseError b) { + bool ret = bindings.Bolt11ParseError_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt11ParseError)) return false; + return this.eq((Bolt11ParseError)o); + } + /** + * Get the string representation of a Bolt11ParseError object + */ + public string to_str() { + string ret = bindings.Bolt11ParseError_to_str(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs b/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs new file mode 100644 index 00000000..85311e31 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs @@ -0,0 +1,153 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`]. + * + * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent + * directly after scanning a refund. It includes all the information needed to pay a recipient. + * + * [`Offer`]: crate::offers::offer::Offer + * [`Refund`]: crate::offers::refund::Refund + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ +public class Bolt12Invoice : CommonBase { + internal Bolt12Invoice(object _dummy, long ptr) : base(ptr) { } + ~Bolt12Invoice() { + if (ptr != 0) { bindings.Bolt12Invoice_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Bolt12Invoice_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt12Invoice + */ + public Bolt12Invoice clone() { + long ret = bindings.Bolt12Invoice_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A complete description of the purpose of the originating offer or refund. Intended to be + * displayed to the user but with the caveat that it has not been verified in any way. + */ + public PrintableString description() { + long ret = bindings.Bolt12Invoice_description(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Duration since the Unix epoch when the invoice was created. + */ + public long created_at() { + long ret = bindings.Bolt12Invoice_created_at(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore + * should no longer be paid. + */ + public long relative_expiry() { + long ret = bindings.Bolt12Invoice_relative_expiry(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Whether the invoice has expired. + */ + public bool is_expired() { + bool ret = bindings.Bolt12Invoice_is_expired(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * SHA256 hash of the payment preimage that will be given in return for paying the invoice. + */ + public byte[] payment_hash() { + byte[] ret = bindings.Bolt12Invoice_payment_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum amount required for a successful payment of the invoice. + */ + public long amount_msats() { + long ret = bindings.Bolt12Invoice_amount_msats(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Features pertaining to paying an invoice. + */ + public Bolt12InvoiceFeatures features() { + long ret = bindings.Bolt12Invoice_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The public key corresponding to the key used to sign the invoice. + */ + public byte[] signing_pubkey() { + byte[] ret = bindings.Bolt12Invoice_signing_pubkey(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Hash that was used for signing the invoice. + */ + public byte[] signable_hash() { + byte[] ret = bindings.Bolt12Invoice_signable_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Verifies that the invoice was for a request or refund created using the given key. + */ + public bool verify(org.ldk.structs.ExpandedKey key) { + bool ret = bindings.Bolt12Invoice_verify(this.ptr, key == null ? 0 : key.ptr); + GC.KeepAlive(this); + GC.KeepAlive(key); + if (this != null) { this.ptrs_to.AddLast(key); }; + return ret; + } + + /** + * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read + */ + public byte[] write() { + byte[] ret = bindings.Bolt12Invoice_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs b/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs new file mode 100644 index 00000000..6695827a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs @@ -0,0 +1,176 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Features used within an `invoice`. + */ +public class Bolt12InvoiceFeatures : CommonBase { + internal Bolt12InvoiceFeatures(object _dummy, long ptr) : base(ptr) { } + ~Bolt12InvoiceFeatures() { + if (ptr != 0) { bindings.Bolt12InvoiceFeatures_free(ptr); } + } + + /** + * Checks if two Bolt12InvoiceFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Bolt12InvoiceFeatures b) { + bool ret = bindings.Bolt12InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt12InvoiceFeatures)) return false; + return this.eq((Bolt12InvoiceFeatures)o); + } + internal long clone_ptr() { + long ret = bindings.Bolt12InvoiceFeatures_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt12InvoiceFeatures + */ + public Bolt12InvoiceFeatures clone() { + long ret = bindings.Bolt12InvoiceFeatures_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Create a blank Features with no features set + */ + public static Bolt12InvoiceFeatures empty() { + long ret = bindings.Bolt12InvoiceFeatures_empty(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.Bolt12InvoiceFeatures other) { + bool ret = bindings.Bolt12InvoiceFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ + public bool requires_unknown_bits() { + bool ret = bindings.Bolt12InvoiceFeatures_requires_unknown_bits(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.Bolt12InvoiceFeatures_set_required_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.Bolt12InvoiceFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.Bolt12InvoiceFeatures_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write + */ + public static Result_Bolt12InvoiceFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt12InvoiceFeatures_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Set this feature as optional. + */ + public void set_basic_mpp_optional() { + bindings.Bolt12InvoiceFeatures_set_basic_mpp_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_basic_mpp_required() { + bindings.Bolt12InvoiceFeatures_set_basic_mpp_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_basic_mpp() { + bool ret = bindings.Bolt12InvoiceFeatures_supports_basic_mpp(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_basic_mpp() { + bool ret = bindings.Bolt12InvoiceFeatures_requires_basic_mpp(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt12ParseError.cs b/c_sharp/src/org/ldk/structs/Bolt12ParseError.cs new file mode 100644 index 00000000..ee1f06e2 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt12ParseError.cs @@ -0,0 +1,37 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Error when parsing a bech32 encoded message using [`str::parse`]. + */ +public class Bolt12ParseError : CommonBase { + internal Bolt12ParseError(object _dummy, long ptr) : base(ptr) { } + ~Bolt12ParseError() { + if (ptr != 0) { bindings.Bolt12ParseError_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Bolt12ParseError_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt12ParseError + */ + public Bolt12ParseError clone() { + long ret = bindings.Bolt12ParseError_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12ParseError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12ParseError(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs b/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs index 9e0dd04f..5d791dd6 100644 --- a/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs +++ b/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs @@ -21,17 +21,29 @@ public class BroadcasterInterface : CommonBase { public interface BroadcasterInterfaceInterface { /** - * Sends a transaction out to (hopefully) be mined. + * Sends a list of transactions out to (hopefully) be mined. + * This only needs to handle the actual broadcasting of transactions, LDK will automatically + * rebroadcast transactions that haven't made it into a block. + * + * In some cases LDK may attempt to broadcast a transaction which double-spends another + * and this isn't a bug and can be safely ignored. + * + * If more than one transaction is given, these transactions should be considered to be a + * package and broadcast together. Some of the transactions may or may not depend on each other, + * be sure to manage both cases correctly. + * + * Bitcoin transaction packages are defined in BIP 331 and here: + * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md */ - void broadcast_transaction(byte[] _tx); + void broadcast_transactions(byte[][] _txs); } private class LDKBroadcasterInterfaceHolder { internal BroadcasterInterface held; } private class LDKBroadcasterInterfaceImpl : bindings.LDKBroadcasterInterface { internal LDKBroadcasterInterfaceImpl(BroadcasterInterfaceInterface arg, LDKBroadcasterInterfaceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private BroadcasterInterfaceInterface arg; private LDKBroadcasterInterfaceHolder impl_holder; - public void broadcast_transaction(byte[] _tx) { - arg.broadcast_transaction(_tx); + public void broadcast_transactions(byte[][] _txs) { + arg.broadcast_transactions(_txs); GC.KeepAlive(arg); } } @@ -41,12 +53,24 @@ public class BroadcasterInterface : CommonBase { return impl_holder.held; } /** - * Sends a transaction out to (hopefully) be mined. + * Sends a list of transactions out to (hopefully) be mined. + * This only needs to handle the actual broadcasting of transactions, LDK will automatically + * rebroadcast transactions that haven't made it into a block. + * + * In some cases LDK may attempt to broadcast a transaction which double-spends another + * and this isn't a bug and can be safely ignored. + * + * If more than one transaction is given, these transactions should be considered to be a + * package and broadcast together. Some of the transactions may or may not depend on each other, + * be sure to manage both cases correctly. + * + * Bitcoin transaction packages are defined in BIP 331 and here: + * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md */ - public void broadcast_transaction(byte[] tx) { - bindings.BroadcasterInterface_broadcast_transaction(this.ptr, tx); + public void broadcast_transactions(byte[][] txs) { + bindings.BroadcasterInterface_broadcast_transactions(this.ptr, txs); GC.KeepAlive(this); - GC.KeepAlive(tx); + GC.KeepAlive(txs); } } diff --git a/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs index 9dc21c50..f5452bee 100644 --- a/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs @@ -122,11 +122,10 @@ public class BuiltCommitmentTransaction : CommonBase { } /** - * Sign a transaction, either because we are counter-signing the counterparty's transaction or - * because we are about to broadcast a holder transaction. + * Signs the counterparty's commitment transaction. */ - public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { - byte[] ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); + public byte[] sign_counterparty_commitment(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { + byte[] ret = bindings.BuiltCommitmentTransaction_sign_counterparty_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); GC.KeepAlive(this); GC.KeepAlive(funding_key); GC.KeepAlive(funding_redeemscript); @@ -134,5 +133,19 @@ public class BuiltCommitmentTransaction : CommonBase { return ret; } + /** + * Signs the holder commitment transaction because we are about to broadcast it. + */ + public byte[] sign_holder_commitment(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis, org.ldk.structs.EntropySource entropy_source) { + byte[] ret = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis, entropy_source.ptr); + GC.KeepAlive(this); + GC.KeepAlive(funding_key); + GC.KeepAlive(funding_redeemscript); + GC.KeepAlive(channel_value_satoshis); + GC.KeepAlive(entropy_source); + if (this != null) { this.ptrs_to.AddLast(entropy_source); }; + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs b/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs new file mode 100644 index 00000000..655ad08b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs @@ -0,0 +1,193 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Represents the different types of transactions, originating from LDK, to be bumped. + */ +public class BumpTransactionEvent : CommonBase { + protected BumpTransactionEvent(object _dummy, long ptr) : base(ptr) { } + ~BumpTransactionEvent() { + if (ptr != 0) { bindings.BumpTransactionEvent_free(ptr); } + } + + internal static BumpTransactionEvent constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKBumpTransactionEvent_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new BumpTransactionEvent_ChannelClose(ptr); + case 1: return new BumpTransactionEvent_HTLCResolution(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A BumpTransactionEvent of type ChannelClose */ + public class BumpTransactionEvent_ChannelClose : BumpTransactionEvent { + /** + * The unique identifier for the claim of the anchor output in the commitment transaction. + * + * The identifier must map to the set of external UTXOs assigned to the claim, such that + * they can be reused when a new claim with the same identifier needs to be made, resulting + * in a fee-bumping attempt. + */ + public byte[] claim_id; + /** + * The target feerate that the transaction package, which consists of the commitment + * transaction and the to-be-crafted child anchor transaction, must meet. + */ + public int package_target_feerate_sat_per_1000_weight; + /** + * The channel's commitment transaction to bump the fee of. This transaction should be + * broadcast along with the anchor transaction constructed as a result of consuming this + * event. + */ + public byte[] commitment_tx; + /** + * The absolute fee in satoshis of the commitment transaction. This can be used along the + * with weight of the commitment transaction to determine its feerate. + */ + public long commitment_tx_fee_satoshis; + /** + * The descriptor to sign the anchor input of the anchor transaction constructed as a + * result of consuming this event. + */ + public AnchorDescriptor anchor_descriptor; + /** + * The set of pending HTLCs on the commitment transaction that need to be resolved once the + * commitment transaction confirms. + */ + public HTLCOutputInCommitment[] pending_htlcs; + internal BumpTransactionEvent_ChannelClose(long ptr) : base(null, ptr) { + this.claim_id = bindings.LDKBumpTransactionEvent_ChannelClose_get_claim_id(ptr); + this.package_target_feerate_sat_per_1000_weight = bindings.LDKBumpTransactionEvent_ChannelClose_get_package_target_feerate_sat_per_1000_weight(ptr); + this.commitment_tx = bindings.LDKBumpTransactionEvent_ChannelClose_get_commitment_tx(ptr); + this.commitment_tx_fee_satoshis = bindings.LDKBumpTransactionEvent_ChannelClose_get_commitment_tx_fee_satoshis(ptr); + long anchor_descriptor = bindings.LDKBumpTransactionEvent_ChannelClose_get_anchor_descriptor(ptr); + org.ldk.structs.AnchorDescriptor anchor_descriptor_hu_conv = null; if (anchor_descriptor < 0 || anchor_descriptor > 4096) { anchor_descriptor_hu_conv = new org.ldk.structs.AnchorDescriptor(null, anchor_descriptor); } + if (anchor_descriptor_hu_conv != null) { anchor_descriptor_hu_conv.ptrs_to.AddLast(this); }; + this.anchor_descriptor = anchor_descriptor_hu_conv; + long[] pending_htlcs = bindings.LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs(ptr); + int pending_htlcs_conv_24_len = pending_htlcs.Length; + HTLCOutputInCommitment[] pending_htlcs_conv_24_arr = new HTLCOutputInCommitment[pending_htlcs_conv_24_len]; + for (int y = 0; y < pending_htlcs_conv_24_len; y++) { + long pending_htlcs_conv_24 = pending_htlcs[y]; + org.ldk.structs.HTLCOutputInCommitment pending_htlcs_conv_24_hu_conv = null; if (pending_htlcs_conv_24 < 0 || pending_htlcs_conv_24 > 4096) { pending_htlcs_conv_24_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, pending_htlcs_conv_24); } + if (pending_htlcs_conv_24_hu_conv != null) { pending_htlcs_conv_24_hu_conv.ptrs_to.AddLast(this); }; + pending_htlcs_conv_24_arr[y] = pending_htlcs_conv_24_hu_conv; + } + this.pending_htlcs = pending_htlcs_conv_24_arr; + } + } + /** A BumpTransactionEvent of type HTLCResolution */ + public class BumpTransactionEvent_HTLCResolution : BumpTransactionEvent { + /** + * The unique identifier for the claim of the HTLCs in the confirmed commitment + * transaction. + * + * The identifier must map to the set of external UTXOs assigned to the claim, such that + * they can be reused when a new claim with the same identifier needs to be made, resulting + * in a fee-bumping attempt. + */ + public byte[] claim_id; + /** + * The target feerate that the resulting HTLC transaction must meet. + */ + public int target_feerate_sat_per_1000_weight; + /** + * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably + * by the same transaction. + */ + public HTLCDescriptor[] htlc_descriptors; + /** + * The locktime required for the resulting HTLC transaction. + */ + public int tx_lock_time; + internal BumpTransactionEvent_HTLCResolution(long ptr) : base(null, ptr) { + this.claim_id = bindings.LDKBumpTransactionEvent_HTLCResolution_get_claim_id(ptr); + this.target_feerate_sat_per_1000_weight = bindings.LDKBumpTransactionEvent_HTLCResolution_get_target_feerate_sat_per_1000_weight(ptr); + long[] htlc_descriptors = bindings.LDKBumpTransactionEvent_HTLCResolution_get_htlc_descriptors(ptr); + int htlc_descriptors_conv_16_len = htlc_descriptors.Length; + HTLCDescriptor[] htlc_descriptors_conv_16_arr = new HTLCDescriptor[htlc_descriptors_conv_16_len]; + for (int q = 0; q < htlc_descriptors_conv_16_len; q++) { + long htlc_descriptors_conv_16 = htlc_descriptors[q]; + org.ldk.structs.HTLCDescriptor htlc_descriptors_conv_16_hu_conv = null; if (htlc_descriptors_conv_16 < 0 || htlc_descriptors_conv_16 > 4096) { htlc_descriptors_conv_16_hu_conv = new org.ldk.structs.HTLCDescriptor(null, htlc_descriptors_conv_16); } + if (htlc_descriptors_conv_16_hu_conv != null) { htlc_descriptors_conv_16_hu_conv.ptrs_to.AddLast(this); }; + htlc_descriptors_conv_16_arr[q] = htlc_descriptors_conv_16_hu_conv; + } + this.htlc_descriptors = htlc_descriptors_conv_16_arr; + this.tx_lock_time = bindings.LDKBumpTransactionEvent_HTLCResolution_get_tx_lock_time(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.BumpTransactionEvent_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the BumpTransactionEvent + */ + public BumpTransactionEvent clone() { + long ret = bindings.BumpTransactionEvent_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BumpTransactionEvent ret_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent + */ + public static BumpTransactionEvent channel_close(byte[] claim_id, int package_target_feerate_sat_per_1000_weight, byte[] commitment_tx, long commitment_tx_fee_satoshis, org.ldk.structs.AnchorDescriptor anchor_descriptor, HTLCOutputInCommitment[] pending_htlcs) { + long ret = bindings.BumpTransactionEvent_channel_close(InternalUtils.check_arr_len(claim_id, 32), package_target_feerate_sat_per_1000_weight, commitment_tx, commitment_tx_fee_satoshis, anchor_descriptor == null ? 0 : anchor_descriptor.ptr, pending_htlcs != null ? InternalUtils.mapArray(pending_htlcs, pending_htlcs_conv_24 => pending_htlcs_conv_24 == null ? 0 : pending_htlcs_conv_24.ptr) : null); + GC.KeepAlive(claim_id); + GC.KeepAlive(package_target_feerate_sat_per_1000_weight); + GC.KeepAlive(commitment_tx); + GC.KeepAlive(commitment_tx_fee_satoshis); + GC.KeepAlive(anchor_descriptor); + GC.KeepAlive(pending_htlcs); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BumpTransactionEvent ret_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(anchor_descriptor); }; + foreach (HTLCOutputInCommitment pending_htlcs_conv_24 in pending_htlcs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(pending_htlcs_conv_24); }; }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent + */ + public static BumpTransactionEvent htlcresolution(byte[] claim_id, int target_feerate_sat_per_1000_weight, HTLCDescriptor[] htlc_descriptors, int tx_lock_time) { + long ret = bindings.BumpTransactionEvent_htlcresolution(InternalUtils.check_arr_len(claim_id, 32), target_feerate_sat_per_1000_weight, htlc_descriptors != null ? InternalUtils.mapArray(htlc_descriptors, htlc_descriptors_conv_16 => htlc_descriptors_conv_16 == null ? 0 : htlc_descriptors_conv_16.ptr) : null, tx_lock_time); + GC.KeepAlive(claim_id); + GC.KeepAlive(target_feerate_sat_per_1000_weight); + GC.KeepAlive(htlc_descriptors); + GC.KeepAlive(tx_lock_time); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BumpTransactionEvent ret_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (HTLCDescriptor htlc_descriptors_conv_16 in htlc_descriptors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_descriptors_conv_16); }; }; + return ret_hu_conv; + } + + /** + * Checks if two BumpTransactionEvents contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.BumpTransactionEvent b) { + bool ret = bindings.BumpTransactionEvent_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is BumpTransactionEvent)) return false; + return this.eq((BumpTransactionEvent)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BumpTransactionEventHandler.cs b/c_sharp/src/org/ldk/structs/BumpTransactionEventHandler.cs new file mode 100644 index 00000000..08202f7b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/BumpTransactionEventHandler.cs @@ -0,0 +1,53 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a + * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or + * Replace-By-Fee (RBF). + * + * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction + */ +public class BumpTransactionEventHandler : CommonBase { + internal BumpTransactionEventHandler(object _dummy, long ptr) : base(ptr) { } + ~BumpTransactionEventHandler() { + if (ptr != 0) { bindings.BumpTransactionEventHandler_free(ptr); } + } + + /** + * Returns a new instance capable of handling [`Event::BumpTransaction`] events. + * + * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction + */ + public static BumpTransactionEventHandler of(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.CoinSelectionSource utxo_source, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.Logger logger) { + long ret = bindings.BumpTransactionEventHandler_new(broadcaster.ptr, utxo_source.ptr, signer_provider.ptr, logger.ptr); + GC.KeepAlive(broadcaster); + GC.KeepAlive(utxo_source); + GC.KeepAlive(signer_provider); + GC.KeepAlive(logger); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BumpTransactionEventHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BumpTransactionEventHandler(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(utxo_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(signer_provider); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + return ret_hu_conv; + } + + /** + * Handles all variants of [`BumpTransactionEvent`]. + */ + public void handle_event(org.ldk.structs.BumpTransactionEvent _event) { + bindings.BumpTransactionEventHandler_handle_event(this.ptr, _event == null ? 0 : _event.ptr); + GC.KeepAlive(this); + GC.KeepAlive(_event); + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ChainMonitor.cs b/c_sharp/src/org/ldk/structs/ChainMonitor.cs index 9ed40b58..074b1ca9 100644 --- a/c_sharp/src/org/ldk/structs/ChainMonitor.cs +++ b/c_sharp/src/org/ldk/structs/ChainMonitor.cs @@ -14,8 +14,15 @@ namespace org { namespace ldk { namespace structs { * or used independently to monitor channels remotely. See the [module-level documentation] for * details. * + * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from + * a force-closed channel. This is crucial in preventing certain classes of pinning attacks, + * detecting substantial mempool feerate changes between blocks, and ensuring reliability if + * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an + * environment with spotty connections, like on mobile. + * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [module-level documentation]: crate::chain::chainmonitor + * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims */ public class ChainMonitor : CommonBase { internal ChainMonitor(object _dummy, long ptr) : base(ptr) { } @@ -33,7 +40,7 @@ public class ChainMonitor : CommonBase { * transactions relevant to the watched channels. */ public static ChainMonitor of(org.ldk.structs.Option_FilterZ chain_source, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.FeeEstimator feeest, org.ldk.structs.Persist persister) { - long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr); + long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster.ptr, logger.ptr, feeest.ptr, persister.ptr); GC.KeepAlive(chain_source); GC.KeepAlive(broadcaster); GC.KeepAlive(logger); @@ -158,6 +165,37 @@ public class ChainMonitor : CommonBase { return ret_hu_conv; } + /** + * Gets a [`Future`] that completes when an event is available either via + * [`chain::Watch::release_pending_monitor_events`] or + * [`EventsProvider::process_pending_events`]. + * + * Note that callbacks registered on the [`Future`] MUST NOT call back into this + * [`ChainMonitor`] and should instead register actions to be taken later. + * + * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events + */ + public Future get_update_future() { + long ret = bindings.ChainMonitor_get_update_future(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Future ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Future(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is + * crucial in preventing certain classes of pinning attacks, detecting substantial mempool + * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend + * invoking this every 30 seconds, or lower if running in an environment with spotty + * connections, like on mobile. + */ + public void rebroadcast_pending_claims() { + bindings.ChainMonitor_rebroadcast_pending_claims(this.ptr); + GC.KeepAlive(this); + } + /** * Constructs a new Listen which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is diff --git a/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs b/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs index e87ab57d..aa30a3a1 100644 --- a/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A channel_announcement message to be sent or received from a peer + * A [`channel_announcement`] message to be sent to or received from a peer. + * + * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message */ public class ChannelAnnouncement : CommonBase { internal ChannelAnnouncement(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/ChannelConfig.cs b/c_sharp/src/org/ldk/structs/ChannelConfig.cs index 197e2ad7..05c0e313 100644 --- a/c_sharp/src/org/ldk/structs/ChannelConfig.cs +++ b/c_sharp/src/org/ldk/structs/ChannelConfig.cs @@ -152,19 +152,22 @@ public class ChannelConfig : CommonBase { * channel negotiated throughout the channel open process, along with the fees required to have * a broadcastable HTLC spending transaction. When a channel supports anchor outputs * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into - * account the HTLC transaction fee as it is zero. + * account the HTLC transaction fee as it is zero. Because of this, you may want to set this + * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier + * variant is primarily intended for use with pre-anchor channels. * - * This limit is applied for sent, forwarded, and received HTLCs and limits the total - * exposure across all three types per-channel. Setting this too low may prevent the - * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very - * important to prevent stealing of dust HTLCs by miners. + * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total + * exposure across all three types per-channel. * - * Default value: 5_000_000 msat. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000. */ - public long get_max_dust_htlc_exposure_msat() { - long ret = bindings.ChannelConfig_get_max_dust_htlc_exposure_msat(this.ptr); + public MaxDustHTLCExposure get_max_dust_htlc_exposure() { + long ret = bindings.ChannelConfig_get_max_dust_htlc_exposure(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MaxDustHTLCExposure ret_hu_conv = org.ldk.structs.MaxDustHTLCExposure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** @@ -181,19 +184,20 @@ public class ChannelConfig : CommonBase { * channel negotiated throughout the channel open process, along with the fees required to have * a broadcastable HTLC spending transaction. When a channel supports anchor outputs * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into - * account the HTLC transaction fee as it is zero. + * account the HTLC transaction fee as it is zero. Because of this, you may want to set this + * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier + * variant is primarily intended for use with pre-anchor channels. * - * This limit is applied for sent, forwarded, and received HTLCs and limits the total - * exposure across all three types per-channel. Setting this too low may prevent the - * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very - * important to prevent stealing of dust HTLCs by miners. + * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total + * exposure across all three types per-channel. * - * Default value: 5_000_000 msat. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000. */ - public void set_max_dust_htlc_exposure_msat(long val) { - bindings.ChannelConfig_set_max_dust_htlc_exposure_msat(this.ptr, val); + public void set_max_dust_htlc_exposure(org.ldk.structs.MaxDustHTLCExposure val) { + bindings.ChannelConfig_set_max_dust_htlc_exposure(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -256,19 +260,95 @@ public class ChannelConfig : CommonBase { GC.KeepAlive(val); } + /** + * If set, allows this channel's counterparty to skim an additional fee off this node's inbound + * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. + * + * Usage: + * - The payee will set this option and set its invoice route hints to use [intercept scids] + * generated by this channel's counterparty. + * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call + * [`forward_intercepted_htlc`] with less than the amount provided in + * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and + * actual forward amounts is their fee. + * + * # Note + * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is + * as-expected if this feature is activated, otherwise they may lose money! + * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the + * counterparty. + * + * # Note + * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. + * Unsetting this flag between restarts may lead to payment receive failures. + * + * Default value: false. + * + * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc + * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted + * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat + * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat + * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat + */ + public bool get_accept_underpaying_htlcs() { + bool ret = bindings.ChannelConfig_get_accept_underpaying_htlcs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * If set, allows this channel's counterparty to skim an additional fee off this node's inbound + * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. + * + * Usage: + * - The payee will set this option and set its invoice route hints to use [intercept scids] + * generated by this channel's counterparty. + * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call + * [`forward_intercepted_htlc`] with less than the amount provided in + * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and + * actual forward amounts is their fee. + * + * # Note + * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is + * as-expected if this feature is activated, otherwise they may lose money! + * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the + * counterparty. + * + * # Note + * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. + * Unsetting this flag between restarts may lead to payment receive failures. + * + * Default value: false. + * + * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc + * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted + * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat + * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat + * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat + */ + public void set_accept_underpaying_htlcs(bool val) { + bindings.ChannelConfig_set_accept_underpaying_htlcs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * Constructs a new ChannelConfig given each field */ - public static ChannelConfig of(int forwarding_fee_proportional_millionths_arg, int forwarding_fee_base_msat_arg, short cltv_expiry_delta_arg, long max_dust_htlc_exposure_msat_arg, long force_close_avoidance_max_fee_satoshis_arg) { - long ret = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); + public static ChannelConfig of(int forwarding_fee_proportional_millionths_arg, int forwarding_fee_base_msat_arg, short cltv_expiry_delta_arg, org.ldk.structs.MaxDustHTLCExposure max_dust_htlc_exposure_arg, long force_close_avoidance_max_fee_satoshis_arg, bool accept_underpaying_htlcs_arg) { + long ret = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_arg.ptr, force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); GC.KeepAlive(forwarding_fee_proportional_millionths_arg); GC.KeepAlive(forwarding_fee_base_msat_arg); GC.KeepAlive(cltv_expiry_delta_arg); - GC.KeepAlive(max_dust_htlc_exposure_msat_arg); + GC.KeepAlive(max_dust_htlc_exposure_arg); GC.KeepAlive(force_close_avoidance_max_fee_satoshis_arg); + GC.KeepAlive(accept_underpaying_htlcs_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(max_dust_htlc_exposure_arg); }; return ret_hu_conv; } @@ -307,6 +387,16 @@ public class ChannelConfig : CommonBase { if (!(o is ChannelConfig)) return false; return this.eq((ChannelConfig)o); } + /** + * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`]. + */ + public void apply(org.ldk.structs.ChannelConfigUpdate update) { + bindings.ChannelConfig_apply(this.ptr, update == null ? 0 : update.ptr); + GC.KeepAlive(this); + GC.KeepAlive(update); + if (this != null) { this.ptrs_to.AddLast(update); }; + } + /** * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used. */ diff --git a/c_sharp/src/org/ldk/structs/ChannelConfigUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelConfigUpdate.cs new file mode 100644 index 00000000..03dcff3f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ChannelConfigUpdate.cs @@ -0,0 +1,134 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A parallel struct to [`ChannelConfig`] to define partial updates. + */ +public class ChannelConfigUpdate : CommonBase { + internal ChannelConfigUpdate(object _dummy, long ptr) : base(ptr) { } + ~ChannelConfigUpdate() { + if (ptr != 0) { bindings.ChannelConfigUpdate_free(ptr); } + } + + public Option_u32Z get_forwarding_fee_proportional_millionths() { + long ret = bindings.ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public void set_forwarding_fee_proportional_millionths(org.ldk.structs.Option_u32Z val) { + bindings.ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + public Option_u32Z get_forwarding_fee_base_msat() { + long ret = bindings.ChannelConfigUpdate_get_forwarding_fee_base_msat(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public void set_forwarding_fee_base_msat(org.ldk.structs.Option_u32Z val) { + bindings.ChannelConfigUpdate_set_forwarding_fee_base_msat(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + public Option_u16Z get_cltv_expiry_delta() { + long ret = bindings.ChannelConfigUpdate_get_cltv_expiry_delta(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public void set_cltv_expiry_delta(org.ldk.structs.Option_u16Z val) { + bindings.ChannelConfigUpdate_set_cltv_expiry_delta(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Returns a copy of the field. + */ + public Option_MaxDustHTLCExposureZ get_max_dust_htlc_exposure_msat() { + long ret = bindings.ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MaxDustHTLCExposureZ ret_hu_conv = org.ldk.structs.Option_MaxDustHTLCExposureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public void set_max_dust_htlc_exposure_msat(org.ldk.structs.Option_MaxDustHTLCExposureZ val) { + bindings.ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + public Option_u64Z get_force_close_avoidance_max_fee_satoshis() { + long ret = bindings.ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public void set_force_close_avoidance_max_fee_satoshis(org.ldk.structs.Option_u64Z val) { + bindings.ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new ChannelConfigUpdate given each field + */ + public static ChannelConfigUpdate of(org.ldk.structs.Option_u32Z forwarding_fee_proportional_millionths_arg, org.ldk.structs.Option_u32Z forwarding_fee_base_msat_arg, org.ldk.structs.Option_u16Z cltv_expiry_delta_arg, org.ldk.structs.Option_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, org.ldk.structs.Option_u64Z force_close_avoidance_max_fee_satoshis_arg) { + long ret = bindings.ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg.ptr, forwarding_fee_base_msat_arg.ptr, cltv_expiry_delta_arg.ptr, max_dust_htlc_exposure_msat_arg.ptr, force_close_avoidance_max_fee_satoshis_arg.ptr); + GC.KeepAlive(forwarding_fee_proportional_millionths_arg); + GC.KeepAlive(forwarding_fee_base_msat_arg); + GC.KeepAlive(cltv_expiry_delta_arg); + GC.KeepAlive(max_dust_htlc_exposure_msat_arg); + GC.KeepAlive(force_close_avoidance_max_fee_satoshis_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(forwarding_fee_proportional_millionths_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(forwarding_fee_base_msat_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(cltv_expiry_delta_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(max_dust_htlc_exposure_msat_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(force_close_avoidance_max_fee_satoshis_arg); }; + return ret_hu_conv; + } + + /** + * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used. + */ + public static ChannelConfigUpdate with_default() { + long ret = bindings.ChannelConfigUpdate_default(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs b/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs index 58f5710c..b8fb5ad7 100644 --- a/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs +++ b/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs @@ -141,6 +141,7 @@ public class ChannelCounterparty : CommonBase { bindings.ChannelCounterparty_set_outbound_htlc_minimum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -162,6 +163,7 @@ public class ChannelCounterparty : CommonBase { bindings.ChannelCounterparty_set_outbound_htlc_maximum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -180,6 +182,8 @@ public class ChannelCounterparty : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(forwarding_info_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_htlc_minimum_msat_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_htlc_maximum_msat_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs b/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs new file mode 100644 index 00000000..3dcf3f4a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs @@ -0,0 +1,133 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The parameters required to derive a channel signer via [`SignerProvider`]. + */ +public class ChannelDerivationParameters : CommonBase { + internal ChannelDerivationParameters(object _dummy, long ptr) : base(ptr) { } + ~ChannelDerivationParameters() { + if (ptr != 0) { bindings.ChannelDerivationParameters_free(ptr); } + } + + /** + * The value in satoshis of the channel we're attempting to spend the anchor output of. + */ + public long get_value_satoshis() { + long ret = bindings.ChannelDerivationParameters_get_value_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The value in satoshis of the channel we're attempting to spend the anchor output of. + */ + public void set_value_satoshis(long val) { + bindings.ChannelDerivationParameters_set_value_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The unique identifier to re-derive the signer for the associated channel. + */ + public byte[] get_keys_id() { + byte[] ret = bindings.ChannelDerivationParameters_get_keys_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The unique identifier to re-derive the signer for the associated channel. + */ + public void set_keys_id(byte[] val) { + bindings.ChannelDerivationParameters_set_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The necessary channel parameters that need to be provided to the re-derived signer through + * [`ChannelSigner::provide_channel_parameters`]. + * + * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters + */ + public ChannelTransactionParameters get_transaction_parameters() { + long ret = bindings.ChannelDerivationParameters_get_transaction_parameters(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The necessary channel parameters that need to be provided to the re-derived signer through + * [`ChannelSigner::provide_channel_parameters`]. + * + * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters + */ + public void set_transaction_parameters(org.ldk.structs.ChannelTransactionParameters val) { + bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new ChannelDerivationParameters given each field + */ + public static ChannelDerivationParameters of(long value_satoshis_arg, byte[] keys_id_arg, org.ldk.structs.ChannelTransactionParameters transaction_parameters_arg) { + long ret = bindings.ChannelDerivationParameters_new(value_satoshis_arg, InternalUtils.check_arr_len(keys_id_arg, 32), transaction_parameters_arg == null ? 0 : transaction_parameters_arg.ptr); + GC.KeepAlive(value_satoshis_arg); + GC.KeepAlive(keys_id_arg); + GC.KeepAlive(transaction_parameters_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(transaction_parameters_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.ChannelDerivationParameters_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ChannelDerivationParameters + */ + public ChannelDerivationParameters clone() { + long ret = bindings.ChannelDerivationParameters_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two ChannelDerivationParameterss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.ChannelDerivationParameters b) { + bool ret = bindings.ChannelDerivationParameters_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is ChannelDerivationParameters)) return false; + return this.eq((ChannelDerivationParameters)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ChannelDetails.cs b/c_sharp/src/org/ldk/structs/ChannelDetails.cs index eb84c835..b806226b 100644 --- a/c_sharp/src/org/ldk/structs/ChannelDetails.cs +++ b/c_sharp/src/org/ldk/structs/ChannelDetails.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels + * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`] */ public class ChannelDetails : CommonBase { internal ChannelDetails(object _dummy, long ptr) : base(ptr) { } @@ -170,6 +170,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -207,6 +208,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -244,6 +246,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -299,6 +302,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -324,6 +328,34 @@ public class ChannelDetails : CommonBase { GC.KeepAlive(val); } + /** + * The currently negotiated fee rate denominated in satoshi per 1000 weight units, + * which is applied to commitment and HTLC transactions. + * + * This value will be `None` for objects serialized with LDK versions prior to 0.0.115. + */ + public Option_u32Z get_feerate_sat_per_1000_weight() { + long ret = bindings.ChannelDetails_get_feerate_sat_per_1000_weight(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The currently negotiated fee rate denominated in satoshi per 1000 weight units, + * which is applied to commitment and HTLC transactions. + * + * This value will be `None` for objects serialized with LDK versions prior to 0.0.115. + */ + public void set_feerate_sat_per_1000_weight(org.ldk.structs.Option_u32Z val) { + bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + /** * Our total balance. This is the amount we would get if we close the channel. * This value is not exact. Due to various in-flight changes and feerate changes, exactly this @@ -402,7 +434,8 @@ public class ChannelDetails : CommonBase { * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us * to use a limit as close as possible to the HTLC limit we can currently send. * - * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`]. + * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`], + * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`]. */ public long get_next_outbound_htlc_limit_msat() { long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr); @@ -416,7 +449,8 @@ public class ChannelDetails : CommonBase { * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us * to use a limit as close as possible to the HTLC limit we can currently send. * - * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`]. + * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`], + * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`]. */ public void set_next_outbound_htlc_limit_msat(long val) { bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val); @@ -424,6 +458,30 @@ public class ChannelDetails : CommonBase { GC.KeepAlive(val); } + /** + * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of + * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than + * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a + * route which is valid. + */ + public long get_next_outbound_htlc_minimum_msat() { + long ret = bindings.ChannelDetails_get_next_outbound_htlc_minimum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of + * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than + * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a + * route which is valid. + */ + public void set_next_outbound_htlc_minimum_msat(long val) { + bindings.ChannelDetails_set_next_outbound_htlc_minimum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * The available inbound capacity for the remote peer to send HTLCs to us. This does not * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not @@ -497,6 +555,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -522,6 +581,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -555,6 +615,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -605,6 +666,32 @@ public class ChannelDetails : CommonBase { GC.KeepAlive(val); } + /** + * The stage of the channel's shutdown. + * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116. + * + * Returns a copy of the field. + */ + public Option_ChannelShutdownStateZ get_channel_shutdown_state() { + long ret = bindings.ChannelDetails_get_channel_shutdown_state(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The stage of the channel's shutdown. + * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116. + */ + public void set_channel_shutdown_state(org.ldk.structs.Option_ChannelShutdownStateZ val) { + bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + /** * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b) * the peer is connected, and (c) the channel is not currently negotiating a shutdown. @@ -668,6 +755,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -689,6 +777,7 @@ public class ChannelDetails : CommonBase { bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -724,8 +813,8 @@ public class ChannelDetails : CommonBase { /** * Constructs a new ChannelDetails given each field */ - public static ChannelDetails of(byte[] channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, org.ldk.structs.OutPoint funding_txo_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, bool is_usable_arg, bool is_public_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, org.ldk.structs.ChannelConfig config_arg) { - long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg.getLEBytes(), balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr); + public static ChannelDetails of(byte[] channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, org.ldk.structs.OutPoint funding_txo_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, org.ldk.structs.Option_u32Z feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, org.ldk.structs.Option_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, org.ldk.structs.ChannelConfig config_arg) { + long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg.getLEBytes(), feerate_sat_per_1000_weight_arg.ptr, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg.ptr, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(counterparty_arg); GC.KeepAlive(funding_txo_arg); @@ -736,15 +825,18 @@ public class ChannelDetails : CommonBase { GC.KeepAlive(channel_value_satoshis_arg); GC.KeepAlive(unspendable_punishment_reserve_arg); GC.KeepAlive(user_channel_id_arg); + GC.KeepAlive(feerate_sat_per_1000_weight_arg); GC.KeepAlive(balance_msat_arg); GC.KeepAlive(outbound_capacity_msat_arg); GC.KeepAlive(next_outbound_htlc_limit_msat_arg); + GC.KeepAlive(next_outbound_htlc_minimum_msat_arg); GC.KeepAlive(inbound_capacity_msat_arg); GC.KeepAlive(confirmations_required_arg); GC.KeepAlive(confirmations_arg); GC.KeepAlive(force_close_spend_delay_arg); GC.KeepAlive(is_outbound_arg); GC.KeepAlive(is_channel_ready_arg); + GC.KeepAlive(channel_shutdown_state_arg); GC.KeepAlive(is_usable_arg); GC.KeepAlive(is_public_arg); GC.KeepAlive(inbound_htlc_minimum_msat_arg); @@ -756,6 +848,17 @@ public class ChannelDetails : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(counterparty_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_scid_alias_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_scid_alias_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(unspendable_punishment_reserve_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(feerate_sat_per_1000_weight_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_required_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(force_close_spend_delay_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_shutdown_state_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_minimum_msat_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_maximum_msat_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelFeatures.cs b/c_sharp/src/org/ldk/structs/ChannelFeatures.cs index c6232af3..097e54c9 100644 --- a/c_sharp/src/org/ldk/structs/ChannelFeatures.cs +++ b/c_sharp/src/org/ldk/structs/ChannelFeatures.cs @@ -61,6 +61,17 @@ public class ChannelFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.ChannelFeatures other) { + bool ret = bindings.ChannelFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -71,6 +82,42 @@ public class ChannelFeatures : CommonBase { return ret; } + /** + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.ChannelFeatures_set_required_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.ChannelFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read */ diff --git a/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs b/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs index de0fc75a..dc7f352f 100644 --- a/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs +++ b/c_sharp/src/org/ldk/structs/ChannelHandshakeConfig.cs @@ -298,11 +298,11 @@ public class ChannelHandshakeConfig : CommonBase { * any attacker who is able to take control of a channel can just as easily send the funds via * lightning payments, so we never require that our counterparties support this option. * - * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`]. + * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`]. * * Default value: true. * - * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey + * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey */ public bool get_commit_upfront_shutdown_pubkey() { bool ret = bindings.ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(this.ptr); @@ -319,11 +319,11 @@ public class ChannelHandshakeConfig : CommonBase { * any attacker who is able to take control of a channel can just as easily send the funds via * lightning payments, so we never require that our counterparties support this option. * - * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`]. + * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`]. * * Default value: true. * - * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey + * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey */ public void set_commit_upfront_shutdown_pubkey(bool val) { bindings.ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val); @@ -391,11 +391,121 @@ public class ChannelHandshakeConfig : CommonBase { GC.KeepAlive(val); } + /** + * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future + * channels. This feature requires having a reserve of onchain funds readily available to bump + * transactions in the event of a channel force close to avoid the possibility of losing funds. + * + * Note that if you wish accept inbound channels with anchor outputs, you must enable + * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with + * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check + * whether your reserve of onchain funds is enough to cover the fees for all existing and new + * channels featuring anchor outputs in the event of a force close. + * + * If this option is set, channels may be created that will not be readable by LDK versions + * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a + * [`DecodeError::InvalidValue`]. + * + * Note that setting this to true does *not* prevent us from opening channels with + * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply + * fall back to a `static_remote_key` channel. + * + * LDK will not support the legacy `option_anchors` commitment version due to a discovered + * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee + * Considered Harmful`] mailing list post. + * + * Default value: false. This value is likely to change to true in the future. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue + * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html + */ + public bool get_negotiate_anchors_zero_fee_htlc_tx() { + bool ret = bindings.ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future + * channels. This feature requires having a reserve of onchain funds readily available to bump + * transactions in the event of a channel force close to avoid the possibility of losing funds. + * + * Note that if you wish accept inbound channels with anchor outputs, you must enable + * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with + * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check + * whether your reserve of onchain funds is enough to cover the fees for all existing and new + * channels featuring anchor outputs in the event of a force close. + * + * If this option is set, channels may be created that will not be readable by LDK versions + * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a + * [`DecodeError::InvalidValue`]. + * + * Note that setting this to true does *not* prevent us from opening channels with + * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply + * fall back to a `static_remote_key` channel. + * + * LDK will not support the legacy `option_anchors` commitment version due to a discovered + * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee + * Considered Harmful`] mailing list post. + * + * Default value: false. This value is likely to change to true in the future. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue + * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html + */ + public void set_negotiate_anchors_zero_fee_htlc_tx(bool val) { + bindings.ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum number of HTLCs in-flight from our counterparty towards us at the same time. + * + * Increasing the value can help improve liquidity and stability in + * routing at the cost of higher long term disk / DB usage. + * + * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration + * other than the default value. + * + * Default value: 50 + * Maximum value: 483, any values larger will be treated as 483. + * This is the BOLT #2 spec limit on `max_accepted_htlcs`. + */ + public short get_our_max_accepted_htlcs() { + short ret = bindings.ChannelHandshakeConfig_get_our_max_accepted_htlcs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum number of HTLCs in-flight from our counterparty towards us at the same time. + * + * Increasing the value can help improve liquidity and stability in + * routing at the cost of higher long term disk / DB usage. + * + * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration + * other than the default value. + * + * Default value: 50 + * Maximum value: 483, any values larger will be treated as 483. + * This is the BOLT #2 spec limit on `max_accepted_htlcs`. + */ + public void set_our_max_accepted_htlcs(short val) { + bindings.ChannelHandshakeConfig_set_our_max_accepted_htlcs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * Constructs a new ChannelHandshakeConfig given each field */ - public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg) { - long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg); + public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg) { + long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg); GC.KeepAlive(minimum_depth_arg); GC.KeepAlive(our_to_self_delay_arg); GC.KeepAlive(our_htlc_minimum_msat_arg); @@ -404,6 +514,8 @@ public class ChannelHandshakeConfig : CommonBase { GC.KeepAlive(announced_channel_arg); GC.KeepAlive(commit_upfront_shutdown_pubkey_arg); GC.KeepAlive(their_channel_reserve_proportional_millionths_arg); + GC.KeepAlive(negotiate_anchors_zero_fee_htlc_tx_arg); + GC.KeepAlive(our_max_accepted_htlcs_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs b/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs index 408bc248..89360fba 100644 --- a/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs +++ b/c_sharp/src/org/ldk/structs/ChannelHandshakeLimits.cs @@ -11,7 +11,7 @@ namespace org { namespace ldk { namespace structs { * * These limits are only applied to our counterparty's limits, not our own. * - * Use 0/::max_value() as appropriate to skip checking. + * Use 0/`::max_value()` as appropriate to skip checking. * * Provides sane defaults for most configurations. * diff --git a/c_sharp/src/org/ldk/structs/ChannelInfo.cs b/c_sharp/src/org/ldk/structs/ChannelInfo.cs index fc0554c2..9e841cc2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelInfo.cs +++ b/c_sharp/src/org/ldk/structs/ChannelInfo.cs @@ -153,6 +153,7 @@ public class ChannelInfo : CommonBase { bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** diff --git a/c_sharp/src/org/ldk/structs/ChannelManager.cs b/c_sharp/src/org/ldk/structs/ChannelManager.cs index afb6d30b..9ec10d69 100644 --- a/c_sharp/src/org/ldk/structs/ChannelManager.cs +++ b/c_sharp/src/org/ldk/structs/ChannelManager.cs @@ -10,39 +10,55 @@ namespace org { namespace ldk { namespace structs { * Manager which keeps track of a number of channels and sends messages to the appropriate * channel, also tracking HTLC preimages and forwarding onion packets appropriately. * - * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through + * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through * to individual Channels. * - * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for + * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for * all peers during write/read (though does not modify this instance, only the instance being - * serialized). This will result in any channels which have not yet exchanged funding_created (ie - * called funding_transaction_generated for outbound channels). + * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e., + * called [`funding_transaction_generated`] for outbound channels) being closed. * - * Note that you can be a bit lazier about writing out ChannelManager than you can be with - * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before - * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates - * happens out-of-band (and will prevent any other ChannelManager operations from occurring during + * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with + * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST write each monitor update out to disk before + * returning from [`chain::Watch::watch_channel`]/[`update_channel`], with ChannelManagers, writing updates + * happens out-of-band (and will prevent any other `ChannelManager` operations from occurring during * the serialization process). If the deserialized version is out-of-date compared to the - * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the - * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees). + * [`ChannelMonitor`] passed by reference to [`read`], those channels will be force-closed based on the + * `ChannelMonitor` state and no funds will be lost (mod on-chain transaction fees). * - * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which - * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along - * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call - * block_connected() to step towards your best block) upon deserialization before using the - * object! + * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which + * tells you the last block hash which was connected. You should get the best block tip before using the manager. + * See [`chain::Listen`] and [`chain::Confirm`] for more details. * - * Note that ChannelManager is responsible for tracking liveness of its channels and generating - * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid + * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating + * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid * spam due to quick disconnection/reconnection, updates are not sent until the channel has been * offline for a full minute. In order to track this, you must call - * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect. + * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect. * - * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager - * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but - * essentially you should default to using a SimpleRefChannelManager, and use a - * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when + * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and + * inbound channels without confirmed funding transactions. This may result in nodes which we do + * not have a channel with being unable to connect to us or open new channels with us if we have + * many peers with unfunded channels. + * + * Because it is an indication of trust, inbound channels which we've accepted as 0conf are + * exempted from the count of unfunded channels. Similarly, outbound channels and connections are + * never limited. Please ensure you limit the count of such channels yourself. + * + * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`] + * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but + * essentially you should default to using a [`SimpleRefChannelManager`], and use a + * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when * you're using lightning-net-tokio. + * + * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected + * [`funding_created`]: msgs::FundingCreated + * [`funding_transaction_generated`]: Self::funding_transaction_generated + * [`BlockHash`]: bitcoin::hash_types::BlockHash + * [`update_channel`]: chain::Watch::update_channel + * [`ChannelUpdate`]: msgs::ChannelUpdate + * [`timer_tick_occurred`]: Self::timer_tick_occurred + * [`read`]: ReadableArgs::read */ public class ChannelManager : CommonBase { internal ChannelManager(object _dummy, long ptr) : base(ptr) { } @@ -51,34 +67,48 @@ public class ChannelManager : CommonBase { } /** - * Constructs a new ChannelManager to hold several channels and route between them. + * Constructs a new `ChannelManager` to hold several channels and route between them. + * + * The current time or latest block header time can be provided as the `current_timestamp`. * * This is the main \"logic hub\" for all channel-related actions, and implements - * ChannelMessageHandler. + * [`ChannelMessageHandler`]. * * Non-proportional fees are fixed according to our risk using the provided fee estimator. * - * Users need to notify the new ChannelManager when a new block is connected or - * disconnected using its `block_connected` and `block_disconnected` methods, starting - * from after `params.latest_hash`. + * Users need to notify the new `ChannelManager` when a new block is connected or + * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting + * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for + * more details. + * + * [`block_connected`]: chain::Listen::block_connected + * [`block_disconnected`]: chain::Listen::block_disconnected + * [`params.best_block.block_hash`]: chain::BestBlock::block_hash */ - public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters _params) { - long ret = bindings.ChannelManager_new(fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, keys_manager == null ? 0 : keys_manager.ptr, config == null ? 0 : config.ptr, _params == null ? 0 : _params.ptr); + public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters _params, int current_timestamp) { + long ret = bindings.ChannelManager_new(fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, entropy_source.ptr, node_signer.ptr, signer_provider.ptr, config == null ? 0 : config.ptr, _params == null ? 0 : _params.ptr, current_timestamp); GC.KeepAlive(fee_est); GC.KeepAlive(chain_monitor); GC.KeepAlive(tx_broadcaster); + GC.KeepAlive(router); GC.KeepAlive(logger); - GC.KeepAlive(keys_manager); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); + GC.KeepAlive(signer_provider); GC.KeepAlive(config); GC.KeepAlive(_params); + GC.KeepAlive(current_timestamp); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelManager(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_est); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(tx_broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(signer_provider); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(_params); }; return ret_hu_conv; @@ -108,6 +138,10 @@ public class ChannelManager : CommonBase { * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`. * + * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to + * generate a shutdown scriptpubkey or destination script set by + * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`]. + * * Note that we do not check if you are currently connected to the given peer. If no * connection is available, the outbound `open_channel` message may fail to send, resulting in * the channel eventually being silently forgotten (dropped on reload). @@ -140,7 +174,7 @@ public class ChannelManager : CommonBase { } /** - * Gets the list of open channels, in random order. See ChannelDetail field documentation for + * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for * more information. */ public ChannelDetails[] list_channels() { @@ -158,14 +192,12 @@ public class ChannelManager : CommonBase { } /** - * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`] - * to ensure non-announced channels are used. + * Gets the list of usable channels, in random order. Useful as an argument to + * [`Router::find_route`] to ensure non-announced channels are used. * * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria * are. - * - * [`find_route`]: crate::routing::router::find_route */ public ChannelDetails[] list_usable_channels() { long[] ret = bindings.ChannelManager_list_usable_channels(this.ptr); @@ -181,6 +213,48 @@ public class ChannelManager : CommonBase { return ret_conv_16_arr; } + /** + * Gets the list of channels we have with a given counterparty, in random order. + */ + public ChannelDetails[] list_channels_with_counterparty(byte[] counterparty_node_id) { + long[] ret = bindings.ChannelManager_list_channels_with_counterparty(this.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33)); + GC.KeepAlive(this); + GC.KeepAlive(counterparty_node_id); + int ret_conv_16_len = ret.Length; + ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret_conv_16_len]; + for (int q = 0; q < ret_conv_16_len; q++) { + long ret_conv_16 = ret[q]; + org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } + if (ret_conv_16_hu_conv != null) { ret_conv_16_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_16_arr[q] = ret_conv_16_hu_conv; + } + return ret_conv_16_arr; + } + + /** + * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a + * successful path, or have unresolved HTLCs. + * + * This can be useful for payments that may have been prepared, but ultimately not sent, as a + * result of a crash. If such a payment exists, is not listed here, and an + * [`Event::PaymentSent`] has not been received, you may consider resending the payment. + * + * [`Event::PaymentSent`]: events::Event::PaymentSent + */ + public RecentPaymentDetails[] list_recent_payments() { + long[] ret = bindings.ChannelManager_list_recent_payments(this.ptr); + GC.KeepAlive(this); + int ret_conv_22_len = ret.Length; + RecentPaymentDetails[] ret_conv_22_arr = new RecentPaymentDetails[ret_conv_22_len]; + for (int w = 0; w < ret_conv_22_len; w++) { + long ret_conv_22 = ret[w]; + org.ldk.structs.RecentPaymentDetails ret_conv_22_hu_conv = org.ldk.structs.RecentPaymentDetails.constr_from_ptr(ret_conv_22); + if (ret_conv_22_hu_conv != null) { ret_conv_22_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_22_arr[w] = ret_conv_22_hu_conv; + } + return ret_conv_22_arr; + } + /** * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs * will be accepted on the given channel, and after additional timeout/the closing of all @@ -194,11 +268,17 @@ public class ChannelManager : CommonBase { * would appear on a force-closure transaction, whichever is lower. We will allow our * counterparty to pay as much fee as they'd like, however. * - * May generate a SendShutdown message event on success, which should be relayed. + * May generate a [`SendShutdown`] message event on success, which should be relayed. + * + * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to + * generate a shutdown scriptpubkey or destination script set by + * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the + * channel. * * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal + * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown */ public Result_NoneAPIErrorZ close_channel(byte[] channel_id, byte[] counterparty_node_id) { long ret = bindings.ChannelManager_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33)); @@ -225,20 +305,36 @@ public class ChannelManager : CommonBase { * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which * will appear on a force-closure transaction, whichever is lower). * - * May generate a SendShutdown message event on success, which should be relayed. + * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction. + * Will fail if a shutdown script has already been set for this channel by + * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must + * also be compatible with our and the counterparty's features. + * + * May generate a [`SendShutdown`] message event on success, which should be relayed. + * + * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to + * generate a shutdown scriptpubkey or destination script set by + * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the + * channel. * * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal + * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown + * + * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_NoneAPIErrorZ close_channel_with_target_feerate(byte[] channel_id, byte[] counterparty_node_id, int target_feerate_sats_per_1000_weight) { - long ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, InternalUtils.check_arr_len(channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), target_feerate_sats_per_1000_weight); + public Result_NoneAPIErrorZ close_channel_with_feerate_and_script(byte[] channel_id, byte[] counterparty_node_id, org.ldk.structs.Option_u32Z target_feerate_sats_per_1000_weight, org.ldk.structs.ShutdownScript shutdown_script) { + long ret = bindings.ChannelManager_close_channel_with_feerate_and_script(this.ptr, InternalUtils.check_arr_len(channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), target_feerate_sats_per_1000_weight.ptr, shutdown_script == null ? 0 : shutdown_script.ptr); GC.KeepAlive(this); GC.KeepAlive(channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(target_feerate_sats_per_1000_weight); + GC.KeepAlive(shutdown_script); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(target_feerate_sats_per_1000_weight); }; + if (this != null) { this.ptrs_to.AddLast(shutdown_script); }; return ret_hu_conv; } @@ -297,14 +393,19 @@ public class ChannelManager : CommonBase { /** * Sends a payment along a given route. * - * Value parameters are provided via the last hop in route, see documentation for RouteHop + * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`] * fields for more info. * + * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via + * [`PeerManager::process_events`]). + * + * # Avoiding Duplicate Payments + * * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an - * [`Event::PaymentSent`]) LDK will not stop you from sending a second payment with the same - * [`PaymentId`]. + * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a + * second payment with the same [`PaymentId`]. * * Thus, in order to ensure duplicate payments are not sent, you should implement your own * tracking of payments, including state to indicate once a payment has completed. Because you @@ -312,12 +413,16 @@ public class ChannelManager : CommonBase { * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes. * - * May generate SendHTLCs message(s) event on success, which should be relayed (e.g. via - * [`PeerManager::process_events`]). + * Additionally, in the scenario where we begin the process of sending a payment, but crash + * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're + * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See + * [`ChannelManager::list_recent_payments`] for more information. + * + * # Possible Error States on [`PaymentSendFailure`] * - * Each path may have a different return value, and PaymentSendValue may return a Vec with + * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with * each entry matching the corresponding-index entry in the route paths, see - * PaymentSendFailure for more info. + * [`PaymentSendFailure`] for more info. * * In general, a path may raise: * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee, @@ -328,80 +433,66 @@ public class ChannelManager : CommonBase { * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the * relevant updates. * - * Note that depending on the type of the PaymentSendFailure the HTLC may have been + * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been * irrevocably committed to on our end. In such a case, do NOT retry the payment with a * different route unless you intend to pay twice! * - * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate - * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For - * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route - * must not contain multiple paths as multi-path payments require a recipient-provided - * payment_secret. - * - * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature - * bit set (either as required or as available). If multiple paths are present in the Route, - * we assume the invoice had the basic_mpp feature set. - * + * [`RouteHop`]: crate::routing::router::RouteHop * [`Event::PaymentSent`]: events::Event::PaymentSent + * [`Event::PaymentFailed`]: events::Event::PaymentFailed + * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events - * - * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None + * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress */ - public Result_NonePaymentSendFailureZ send_payment(org.ldk.structs.Route route, byte[] payment_hash, byte[] payment_secret, byte[] payment_id) { - long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32), InternalUtils.check_arr_len(payment_id, 32)); + public Result_NonePaymentSendFailureZ send_payment_with_route(org.ldk.structs.Route route, byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) { + long ret = bindings.ChannelManager_send_payment_with_route(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32)); GC.KeepAlive(this); GC.KeepAlive(route); GC.KeepAlive(payment_hash); - GC.KeepAlive(payment_secret); + GC.KeepAlive(recipient_onion); GC.KeepAlive(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(route); }; + if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; return ret_hu_conv; } /** - * Retries a payment along the given [`Route`]. - * - * Errors returned are a superset of those returned from [`send_payment`], so see - * [`send_payment`] documentation for more details on errors. This method will also error if the - * retry amount puts the payment more than 10% over the payment's total amount, if the payment - * for the given `payment_id` cannot be found (likely due to timeout or success), or if - * further retries have been disabled with [`abandon_payment`]. - * - * [`send_payment`]: [`ChannelManager::send_payment`] - * [`abandon_payment`]: [`ChannelManager::abandon_payment`] + * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on + * `route_params` and retry failed payment paths based on `retry_strategy`. */ - public Result_NonePaymentSendFailureZ retry_payment(org.ldk.structs.Route route, byte[] payment_id) { - long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_id, 32)); + public Result_NoneRetryableSendFailureZ send_payment(byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { + long ret = bindings.ChannelManager_send_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32), route_params == null ? 0 : route_params.ptr, retry_strategy.ptr); GC.KeepAlive(this); - GC.KeepAlive(route); + GC.KeepAlive(payment_hash); + GC.KeepAlive(recipient_onion); GC.KeepAlive(payment_id); + GC.KeepAlive(route_params); + GC.KeepAlive(retry_strategy); if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(route); }; + Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; + if (this != null) { this.ptrs_to.AddLast(route_params); }; + if (this != null) { this.ptrs_to.AddLast(retry_strategy); }; return ret_hu_conv; } /** - * Signals that no further retries for the given payment will occur. + * Signals that no further retries for the given payment should occur. Useful if you have a + * pending outbound payment with retries remaining, but wish to stop retrying the payment before + * retries are exhausted. * - * After this method returns, no future calls to [`retry_payment`] for the given `payment_id` - * are allowed. If no [`Event::PaymentFailed`] event had been generated before, one will be - * generated as soon as there are no remaining pending HTLCs for this payment. + * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon + * as there are no remaining pending HTLCs for this payment. * * Note that calling this method does *not* prevent a payment from succeeding. You must still * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to * determine the ultimate status of a payment. * * If an [`Event::PaymentFailed`] event is generated and we restart without this - * [`ChannelManager`] having been persisted, the payment may still be in the pending state - * upon restart. This allows further calls to [`retry_payment`] (and requiring a second call - * to [`abandon_payment`] to mark the payment as failed again). Otherwise, future calls to - * [`retry_payment`] will fail with [`PaymentSendFailure::ParameterError`]. + * [`ChannelManager`] having been persisted, another [`Event::PaymentFailed`] may be generated. * - * [`abandon_payment`]: Self::abandon_payment - * [`retry_payment`]: Self::retry_payment * [`Event::PaymentFailed`]: events::Event::PaymentFailed * [`Event::PaymentSent`]: events::Event::PaymentSent */ @@ -424,21 +515,46 @@ public class ChannelManager : CommonBase { * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See * [`send_payment`] for more information about the risks of duplicate preimage usage. * - * Note that `route` must have exactly one path. - * * [`send_payment`]: Self::send_payment - * - * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_PaymentHashPaymentSendFailureZ send_spontaneous_payment(org.ldk.structs.Route route, byte[] payment_preimage, byte[] payment_id) { - long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_id, 32)); + public Result_PaymentHashPaymentSendFailureZ send_spontaneous_payment(org.ldk.structs.Route route, org.ldk.structs.Option_PaymentPreimageZ payment_preimage, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) { + long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, payment_preimage.ptr, recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32)); GC.KeepAlive(this); GC.KeepAlive(route); GC.KeepAlive(payment_preimage); + GC.KeepAlive(recipient_onion); GC.KeepAlive(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(route); }; + if (this != null) { this.ptrs_to.AddLast(payment_preimage); }; + if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; + return ret_hu_conv; + } + + /** + * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route + * based on `route_params` and retry failed payment paths based on `retry_strategy`. + * + * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous + * payments. + * + * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend + */ + public Result_PaymentHashRetryableSendFailureZ send_spontaneous_payment_with_retry(org.ldk.structs.Option_PaymentPreimageZ payment_preimage, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { + long ret = bindings.ChannelManager_send_spontaneous_payment_with_retry(this.ptr, payment_preimage.ptr, recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32), route_params == null ? 0 : route_params.ptr, retry_strategy.ptr); + GC.KeepAlive(this); + GC.KeepAlive(payment_preimage); + GC.KeepAlive(recipient_onion); + GC.KeepAlive(payment_id); + GC.KeepAlive(route_params); + GC.KeepAlive(retry_strategy); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(payment_preimage); }; + if (this != null) { this.ptrs_to.AddLast(recipient_onion); }; + if (this != null) { this.ptrs_to.AddLast(route_params); }; + if (this != null) { this.ptrs_to.AddLast(retry_strategy); }; return ret_hu_conv; } @@ -447,13 +563,13 @@ public class ChannelManager : CommonBase { * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows * us to easily discern them from real payments. */ - public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ send_probe(RouteHop[] hops) { - long ret = bindings.ChannelManager_send_probe(this.ptr, hops != null ? InternalUtils.mapArray(hops, hops_conv_10 => hops_conv_10 == null ? 0 : hops_conv_10.ptr) : null); + public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ send_probe(org.ldk.structs.Path path) { + long ret = bindings.ChannelManager_send_probe(this.ptr, path == null ? 0 : path.ptr); GC.KeepAlive(this); - GC.KeepAlive(hops); + GC.KeepAlive(path); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); - foreach (RouteHop hops_conv_10 in hops) { if (this != null) { this.ptrs_to.AddLast(hops_conv_10); }; }; + if (this != null) { this.ptrs_to.AddLast(path); }; return ret_hu_conv; } @@ -486,8 +602,8 @@ public class ChannelManager : CommonBase { * implemented by Bitcoin Core wallet. See * for more details. * - * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady - * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed + * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady + * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed */ public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] counterparty_node_id, byte[] funding_transaction) { long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), funding_transaction); @@ -500,6 +616,42 @@ public class ChannelManager : CommonBase { return ret_hu_conv; } + /** + * Atomically applies partial updates to the [`ChannelConfig`] of the given channels. + * + * Once the updates are applied, each eligible channel (advertised with a known short channel + * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`], + * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated + * containing the new [`ChannelUpdate`] message which should be broadcast to the network. + * + * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect + * `counterparty_node_id` is provided. + * + * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value + * below [`MIN_CLTV_EXPIRY_DELTA`]. + * + * If an error is returned, none of the updates should be considered applied. + * + * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths + * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat + * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta + * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate + * [`ChannelUpdate`]: msgs::ChannelUpdate + * [`ChannelUnavailable`]: APIError::ChannelUnavailable + * [`APIMisuseError`]: APIError::APIMisuseError + */ + public Result_NoneAPIErrorZ update_partial_channel_config(byte[] counterparty_node_id, byte[][] channel_ids, org.ldk.structs.ChannelConfigUpdate config_update) { + long ret = bindings.ChannelManager_update_partial_channel_config(this.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), channel_ids != null ? InternalUtils.mapArray(channel_ids, channel_ids_conv_8 => InternalUtils.check_arr_len(channel_ids_conv_8, 32)) : null, config_update == null ? 0 : config_update.ptr); + GC.KeepAlive(this); + GC.KeepAlive(counterparty_node_id); + GC.KeepAlive(channel_ids); + GC.KeepAlive(config_update); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(config_update); }; + return ret_hu_conv; + } + /** * Atomically updates the [`ChannelConfig`] for the given channels. * @@ -550,20 +702,23 @@ public class ChannelManager : CommonBase { * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event. * * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop - * you from forwarding more than you received. + * you from forwarding more than you received. See + * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount + * than expected. * * Errors if the event was not handled in time, in which case the HTLC was automatically failed * backwards. * * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs * [`HTLCIntercepted`]: events::Event::HTLCIntercepted + * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat */ - public Result_NoneAPIErrorZ forward_intercepted_htlc(byte[] intercept_id, byte[] next_hop_channel_id, byte[] _next_node_id, long amt_to_forward_msat) { - long ret = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, InternalUtils.check_arr_len(intercept_id, 32), InternalUtils.check_arr_len(next_hop_channel_id, 32), InternalUtils.check_arr_len(_next_node_id, 33), amt_to_forward_msat); + public Result_NoneAPIErrorZ forward_intercepted_htlc(byte[] intercept_id, byte[] next_hop_channel_id, byte[] next_node_id, long amt_to_forward_msat) { + long ret = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, InternalUtils.check_arr_len(intercept_id, 32), InternalUtils.check_arr_len(next_hop_channel_id, 32), InternalUtils.check_arr_len(next_node_id, 33), amt_to_forward_msat); GC.KeepAlive(this); GC.KeepAlive(intercept_id); GC.KeepAlive(next_hop_channel_id); - GC.KeepAlive(_next_node_id); + GC.KeepAlive(next_node_id); GC.KeepAlive(amt_to_forward_msat); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); @@ -604,14 +759,19 @@ public class ChannelManager : CommonBase { * * This currently includes: * Increasing or decreasing the on-chain feerate estimates for our outbound channels, - * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more + * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more * than a minute, informing the network that they should no longer attempt to route over * the channel. - * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs - * with the current `ChannelConfig`. + * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs + * with the current [`ChannelConfig`]. + * Removing peers which have disconnected but and no longer have any channels. + * Force-closing and removing channels which have not completed establishment in a timely manner. * - * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate + * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate * estimate fetches. + * + * [`ChannelUpdate`]: msgs::ChannelUpdate + * [`ChannelConfig`]: crate::util::config::ChannelConfig */ public void timer_tick_occurred() { bindings.ChannelManager_timer_tick_occurred(this.ptr); @@ -639,21 +799,36 @@ public class ChannelManager : CommonBase { GC.KeepAlive(payment_hash); } + /** + * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the + * reason for the failure. + * + * See [`FailureCode`] for valid failure codes. + */ + public void fail_htlc_backwards_with_reason(byte[] payment_hash, FailureCode failure_code) { + bindings.ChannelManager_fail_htlc_backwards_with_reason(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), failure_code); + GC.KeepAlive(this); + GC.KeepAlive(payment_hash); + GC.KeepAlive(failure_code); + } + /** * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any * [`MessageSendEvent`]s needed to claim the payment. * - * Note that calling this method does *not* guarantee that the payment has been claimed. You - * must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be - * provided to your [`EventHandler`] when [`process_pending_events`] is next called. + * This method is guaranteed to ensure the payment has been claimed but only if the current + * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race + * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment + * successful. It will generally be available in the next [`process_pending_events`] call. * * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable` * event matches your expectation. If you fail to do so and call this method, you may provide * the sender \"proof-of-payment\" when they did not fulfill the full expected payment. * - * [`Event::PaymentClaimable`]: crate::util::events::Event::PaymentClaimable - * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed + * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable + * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline + * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed * [`process_pending_events`]: EventsProvider::process_pending_events * [`create_inbound_payment`]: Self::create_inbound_payment * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash @@ -741,7 +916,8 @@ public class ChannelManager : CommonBase { * [`PaymentHash`] and [`PaymentPreimage`] for you. * * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which - * will have the [`PaymentClaimable::payment_preimage`] field filled in. That should then be + * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with + * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be * passed directly to [`claim_funds`]. * * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements. @@ -756,39 +932,26 @@ public class ChannelManager : CommonBase { * * Errors if `min_value_msat` is greater than total bitcoin supply. * + * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable + * on versions of LDK prior to 0.0.114. + * * [`claim_funds`]: Self::claim_funds * [`PaymentClaimable`]: events::Event::PaymentClaimable - * [`PaymentClaimable::payment_preimage`]: events::Event::PaymentClaimable::payment_preimage + * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose + * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment + * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash */ - public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { - long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs); + public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(this); GC.KeepAlive(min_value_msat); GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share - * serialized state with LDK node(s) running 0.0.103 and earlier. - * - * May panic if `invoice_expiry_delta_secs` is greater than one year. - * - * # Note - * This method is deprecated and will be removed soon. - * - * [`create_inbound_payment`]: Self::create_inbound_payment - */ - public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ create_inbound_payment_legacy(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { - long ret = bindings.ChannelManager_create_inbound_payment_legacy(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs); - GC.KeepAlive(this); - GC.KeepAlive(min_value_msat); - GC.KeepAlive(invoice_expiry_delta_secs); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(min_value_msat); }; + if (this != null) { this.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -821,8 +984,8 @@ public class ChannelManager : CommonBase { * If you need exact expiry semantics, you should enforce them upon receipt of * [`PaymentClaimable`]. * - * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry` - * set to at least [`MIN_FINAL_CLTV_EXPIRY`]. + * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta` + * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. * * Note that a malicious eavesdropper can intuit whether an inbound payment was created by * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime. @@ -834,39 +997,23 @@ public class ChannelManager : CommonBase { * * Errors if `min_value_msat` is greater than total bitcoin supply. * + * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable + * on versions of LDK prior to 0.0.114. + * * [`create_inbound_payment`]: Self::create_inbound_payment * [`PaymentClaimable`]: events::Event::PaymentClaimable */ - public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(byte[] payment_hash, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { - long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs); + public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(byte[] payment_hash, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry) { + long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry.ptr); GC.KeepAlive(this); GC.KeepAlive(payment_hash); GC.KeepAlive(min_value_msat); GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share - * serialized state with LDK node(s) running 0.0.103 and earlier. - * - * May panic if `invoice_expiry_delta_secs` is greater than one year. - * - * # Note - * This method is deprecated and will be removed soon. - * - * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash - */ - public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash_legacy(byte[] payment_hash, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { - long ret = bindings.ChannelManager_create_inbound_payment_for_hash_legacy(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs); - GC.KeepAlive(this); - GC.KeepAlive(payment_hash); - GC.KeepAlive(min_value_msat); - GC.KeepAlive(invoice_expiry_delta_secs); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(min_value_msat); }; + if (this != null) { this.ptrs_to.AddLast(min_final_cltv_expiry); }; return ret_hu_conv; } @@ -890,7 +1037,7 @@ public class ChannelManager : CommonBase { * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids * are used when constructing the phantom invoice's route hints. * - * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + * [phantom node payments]: crate::sign::PhantomKeysManager */ public long get_phantom_scid() { long ret = bindings.ChannelManager_get_phantom_scid(this.ptr); @@ -901,7 +1048,7 @@ public class ChannelManager : CommonBase { /** * Gets route hints for use in receiving [phantom node payments]. * - * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + * [phantom node payments]: crate::sign::PhantomKeysManager */ public PhantomRouteHints get_phantom_route_hints() { long ret = bindings.ChannelManager_get_phantom_route_hints(this.ptr); @@ -992,60 +1139,81 @@ public class ChannelManager : CommonBase { } /** - * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool - * indicating whether persistence is necessary. Only one listener on - * [`await_persistable_update`], [`await_persistable_update_timeout`], or a future returned by - * [`get_persistable_update_future`] is guaranteed to be woken up. - * - * Note that this method is not available with the `no-std` feature. + * Gets a [`Future`] that completes when this [`ChannelManager`] needs to be persisted. * - * [`await_persistable_update`]: Self::await_persistable_update - * [`await_persistable_update_timeout`]: Self::await_persistable_update_timeout - * [`get_persistable_update_future`]: Self::get_persistable_update_future + * Note that callbacks registered on the [`Future`] MUST NOT call back into this + * [`ChannelManager`] and should instead register actions to be taken later. */ - public bool await_persistable_update_timeout(long max_wait) { - bool ret = bindings.ChannelManager_await_persistable_update_timeout(this.ptr, max_wait); + public Future get_persistable_update_future() { + long ret = bindings.ChannelManager_get_persistable_update_future(this.ptr); GC.KeepAlive(this); - GC.KeepAlive(max_wait); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Future ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Future(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * Blocks until ChannelManager needs to be persisted. Only one listener on - * [`await_persistable_update`], `await_persistable_update_timeout`, or a future returned by - * [`get_persistable_update_future`] is guaranteed to be woken up. - * - * [`await_persistable_update`]: Self::await_persistable_update - * [`get_persistable_update_future`]: Self::get_persistable_update_future + * Gets the latest best block which was connected either via the [`chain::Listen`] or + * [`chain::Confirm`] interfaces. */ - public void await_persistable_update() { - bindings.ChannelManager_await_persistable_update(this.ptr); + public BestBlock current_best_block() { + long ret = bindings.ChannelManager_current_best_block(this.ptr); GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * Gets a [`Future`] that completes when a persistable update is available. Note that - * callbacks registered on the [`Future`] MUST NOT call back into this [`ChannelManager`] and - * should instead register actions to be taken later. + * Fetches the set of [`NodeFeatures`] flags which are provided by or required by + * [`ChannelManager`]. */ - public Future get_persistable_update_future() { - long ret = bindings.ChannelManager_get_persistable_update_future(this.ptr); + public NodeFeatures node_features() { + long ret = bindings.ChannelManager_node_features(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Future ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Future(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** - * Gets the latest best block which was connected either via the [`chain::Listen`] or - * [`chain::Confirm`] interfaces. + * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by + * [`ChannelManager`]. */ - public BestBlock current_best_block() { - long ret = bindings.ChannelManager_current_best_block(this.ptr); + public ChannelFeatures channel_features() { + long ret = bindings.ChannelManager_channel_features(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } + org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Fetches the set of [`ChannelTypeFeatures`] flags which are provided by or required by + * [`ChannelManager`]. + */ + public ChannelTypeFeatures channel_type_features() { + long ret = bindings.ChannelManager_channel_type_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Fetches the set of [`InitFeatures`] flags which are provided by or required by + * [`ChannelManager`]. + */ + public InitFeatures init_features() { + long ret = bindings.ChannelManager_init_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -1072,18 +1240,5 @@ public class ChannelManager : CommonBase { return ret; } - /** - * Constructs a new Payer which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is - */ - public Payer as_Payer() { - long ret = bindings.ChannelManager_as_Payer(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Payer ret_hu_conv = new Payer(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs b/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs index 39b2893c..11fe0ddf 100644 --- a/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs +++ b/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs @@ -46,16 +46,60 @@ public class ChannelManagerReadArgs : CommonBase { if (ptr != 0) { bindings.ChannelManagerReadArgs_free(ptr); } } + /** + * A cryptographically secure source of entropy. + */ + public EntropySource get_entropy_source() { + long ret = bindings.ChannelManagerReadArgs_get_entropy_source(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + EntropySource ret_hu_conv = new EntropySource(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A cryptographically secure source of entropy. + */ + public void set_entropy_source(org.ldk.structs.EntropySource val) { + bindings.ChannelManagerReadArgs_set_entropy_source(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * A signer that is able to perform node-scoped cryptographic operations. + */ + public NodeSigner get_node_signer() { + long ret = bindings.ChannelManagerReadArgs_get_node_signer(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + NodeSigner ret_hu_conv = new NodeSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A signer that is able to perform node-scoped cryptographic operations. + */ + public void set_node_signer(org.ldk.structs.NodeSigner val) { + bindings.ChannelManagerReadArgs_set_node_signer(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + /** * The keys provider which will give us relevant keys. Some keys will be loaded during * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel * signing data. */ - public KeysInterface get_keys_manager() { - long ret = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr); + public SignerProvider get_signer_provider() { + long ret = bindings.ChannelManagerReadArgs_get_signer_provider(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - KeysInterface ret_hu_conv = new KeysInterface(null, ret); + SignerProvider ret_hu_conv = new SignerProvider(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -65,8 +109,8 @@ public class ChannelManagerReadArgs : CommonBase { * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel * signing data. */ - public void set_keys_manager(org.ldk.structs.KeysInterface val) { - bindings.ChannelManagerReadArgs_set_keys_manager(this.ptr, val == null ? 0 : val.ptr); + public void set_signer_provider(org.ldk.structs.SignerProvider val) { + bindings.ChannelManagerReadArgs_set_signer_provider(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -92,7 +136,7 @@ public class ChannelManagerReadArgs : CommonBase { * No calls to the FeeEstimator will be made during deserialization. */ public void set_fee_estimator(org.ldk.structs.FeeEstimator val) { - bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -122,7 +166,7 @@ public class ChannelManagerReadArgs : CommonBase { * chain::Watch after deserializing this ChannelManager. */ public void set_chain_monitor(org.ldk.structs.Watch val) { - bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -148,7 +192,35 @@ public class ChannelManagerReadArgs : CommonBase { * force-closed during deserialization. */ public void set_tx_broadcaster(org.ldk.structs.BroadcasterInterface val) { - bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The router which will be used in the ChannelManager in the future for finding routes + * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding. + * + * No calls to the router will be made during deserialization. + */ + public Router get_router() { + long ret = bindings.ChannelManagerReadArgs_get_router(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Router ret_hu_conv = new Router(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The router which will be used in the ChannelManager in the future for finding routes + * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding. + * + * No calls to the router will be made during deserialization. + */ + public void set_router(org.ldk.structs.Router val) { + bindings.ChannelManagerReadArgs_set_router(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -172,7 +244,7 @@ public class ChannelManagerReadArgs : CommonBase { * deserialization. */ public void set_logger(org.ldk.structs.Logger val) { - bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelManagerReadArgs_set_logger(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -207,22 +279,28 @@ public class ChannelManagerReadArgs : CommonBase { * HashMap for you. This is primarily useful for C bindings where it is not practical to * populate a HashMap directly from C. */ - public static ChannelManagerReadArgs of(org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) { - long ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr, channel_monitors != null ? InternalUtils.mapArray(channel_monitors, channel_monitors_conv_16 => channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr) : null); - GC.KeepAlive(keys_manager); + public static ChannelManagerReadArgs of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) { + long ret = bindings.ChannelManagerReadArgs_new(entropy_source.ptr, node_signer.ptr, signer_provider.ptr, fee_estimator.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, default_config == null ? 0 : default_config.ptr, channel_monitors != null ? InternalUtils.mapArray(channel_monitors, channel_monitors_conv_16 => channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr) : null); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); + GC.KeepAlive(signer_provider); GC.KeepAlive(fee_estimator); GC.KeepAlive(chain_monitor); GC.KeepAlive(tx_broadcaster); + GC.KeepAlive(router); GC.KeepAlive(logger); GC.KeepAlive(default_config); GC.KeepAlive(channel_monitors); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelManagerReadArgs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelManagerReadArgs(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(signer_provider); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_estimator); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(tx_broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(default_config); }; foreach (ChannelMonitor channel_monitors_conv_16 in channel_monitors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_monitors_conv_16); }; }; diff --git a/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs b/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs index 55766614..cd3fc2c7 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs @@ -8,8 +8,8 @@ namespace org { namespace ldk { namespace structs { /** * A trait to describe an object which can receive channel messages. * - * Messages MAY be called in parallel when they originate from different their_node_ids, however - * they MUST NOT be called in parallel when the two calls have the same their_node_id. + * Messages MAY be called in parallel when they originate from different `their_node_ids`, however + * they MUST NOT be called in parallel when the two calls have the same `their_node_id`. */ public class ChannelMessageHandler : CommonBase { internal readonly bindings.LDKChannelMessageHandler bindings_instance; @@ -25,93 +25,131 @@ public class ChannelMessageHandler : CommonBase { public interface ChannelMessageHandlerInterface { /** - * Handle an incoming open_channel message from the given peer. + * Handle an incoming `open_channel` message from the given peer. */ - void handle_open_channel(byte[] _their_node_id, InitFeatures _their_features, OpenChannel _msg); + void handle_open_channel(byte[] _their_node_id, OpenChannel _msg); /** - * Handle an incoming accept_channel message from the given peer. + * Handle an incoming `open_channel2` message from the given peer. */ - void handle_accept_channel(byte[] _their_node_id, InitFeatures _their_features, AcceptChannel _msg); + void handle_open_channel_v2(byte[] _their_node_id, OpenChannelV2 _msg); /** - * Handle an incoming funding_created message from the given peer. + * Handle an incoming `accept_channel` message from the given peer. + */ + void handle_accept_channel(byte[] _their_node_id, AcceptChannel _msg); + /** + * Handle an incoming `accept_channel2` message from the given peer. + */ + void handle_accept_channel_v2(byte[] _their_node_id, AcceptChannelV2 _msg); + /** + * Handle an incoming `funding_created` message from the given peer. */ void handle_funding_created(byte[] _their_node_id, FundingCreated _msg); /** - * Handle an incoming funding_signed message from the given peer. + * Handle an incoming `funding_signed` message from the given peer. */ void handle_funding_signed(byte[] _their_node_id, FundingSigned _msg); /** - * Handle an incoming channel_ready message from the given peer. + * Handle an incoming `channel_ready` message from the given peer. */ void handle_channel_ready(byte[] _their_node_id, ChannelReady _msg); /** - * Handle an incoming shutdown message from the given peer. + * Handle an incoming `shutdown` message from the given peer. */ - void handle_shutdown(byte[] _their_node_id, InitFeatures _their_features, Shutdown _msg); + void handle_shutdown(byte[] _their_node_id, Shutdown _msg); /** - * Handle an incoming closing_signed message from the given peer. + * Handle an incoming `closing_signed` message from the given peer. */ void handle_closing_signed(byte[] _their_node_id, ClosingSigned _msg); /** - * Handle an incoming update_add_htlc message from the given peer. + * Handle an incoming `tx_add_input message` from the given peer. + */ + void handle_tx_add_input(byte[] _their_node_id, TxAddInput _msg); + /** + * Handle an incoming `tx_add_output` message from the given peer. + */ + void handle_tx_add_output(byte[] _their_node_id, TxAddOutput _msg); + /** + * Handle an incoming `tx_remove_input` message from the given peer. + */ + void handle_tx_remove_input(byte[] _their_node_id, TxRemoveInput _msg); + /** + * Handle an incoming `tx_remove_output` message from the given peer. + */ + void handle_tx_remove_output(byte[] _their_node_id, TxRemoveOutput _msg); + /** + * Handle an incoming `tx_complete message` from the given peer. + */ + void handle_tx_complete(byte[] _their_node_id, TxComplete _msg); + /** + * Handle an incoming `tx_signatures` message from the given peer. + */ + void handle_tx_signatures(byte[] _their_node_id, TxSignatures _msg); + /** + * Handle an incoming `tx_init_rbf` message from the given peer. + */ + void handle_tx_init_rbf(byte[] _their_node_id, TxInitRbf _msg); + /** + * Handle an incoming `tx_ack_rbf` message from the given peer. + */ + void handle_tx_ack_rbf(byte[] _their_node_id, TxAckRbf _msg); + /** + * Handle an incoming `tx_abort message` from the given peer. + */ + void handle_tx_abort(byte[] _their_node_id, TxAbort _msg); + /** + * Handle an incoming `update_add_htlc` message from the given peer. */ void handle_update_add_htlc(byte[] _their_node_id, UpdateAddHTLC _msg); /** - * Handle an incoming update_fulfill_htlc message from the given peer. + * Handle an incoming `update_fulfill_htlc` message from the given peer. */ void handle_update_fulfill_htlc(byte[] _their_node_id, UpdateFulfillHTLC _msg); /** - * Handle an incoming update_fail_htlc message from the given peer. + * Handle an incoming `update_fail_htlc` message from the given peer. */ void handle_update_fail_htlc(byte[] _their_node_id, UpdateFailHTLC _msg); /** - * Handle an incoming update_fail_malformed_htlc message from the given peer. + * Handle an incoming `update_fail_malformed_htlc` message from the given peer. */ void handle_update_fail_malformed_htlc(byte[] _their_node_id, UpdateFailMalformedHTLC _msg); /** - * Handle an incoming commitment_signed message from the given peer. + * Handle an incoming `commitment_signed` message from the given peer. */ void handle_commitment_signed(byte[] _their_node_id, CommitmentSigned _msg); /** - * Handle an incoming revoke_and_ack message from the given peer. + * Handle an incoming `revoke_and_ack` message from the given peer. */ void handle_revoke_and_ack(byte[] _their_node_id, RevokeAndACK _msg); /** - * Handle an incoming update_fee message from the given peer. + * Handle an incoming `update_fee` message from the given peer. */ void handle_update_fee(byte[] _their_node_id, UpdateFee _msg); /** - * Handle an incoming announcement_signatures message from the given peer. + * Handle an incoming `announcement_signatures` message from the given peer. */ void handle_announcement_signatures(byte[] _their_node_id, AnnouncementSignatures _msg); /** - * Indicates a connection to the peer failed/an existing connection was lost. If no connection - * is believed to be possible in the future (eg they're sending us messages we don't - * understand or indicate they require unknown feature bits), no_connection_possible is set - * and any outstanding channels should be failed. - * - * Note that in some rare cases this may be called without a corresponding - * [`Self::peer_connected`]. + * Indicates a connection to the peer failed/an existing connection was lost. */ - void peer_disconnected(byte[] _their_node_id, bool _no_connection_possible); + void peer_disconnected(byte[] _their_node_id); /** - * Handle a peer reconnecting, possibly generating channel_reestablish message(s). + * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s). * * May return an `Err(())` if the features the peer supports are not sufficient to communicate * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - Result_NoneNoneZ peer_connected(byte[] _their_node_id, Init _msg); + Result_NoneNoneZ peer_connected(byte[] _their_node_id, Init _msg, bool _inbound); /** - * Handle an incoming channel_reestablish message from the given peer. + * Handle an incoming `channel_reestablish` message from the given peer. */ void handle_channel_reestablish(byte[] _their_node_id, ChannelReestablish _msg); /** - * Handle an incoming channel update from the given peer. + * Handle an incoming `channel_update` message from the given peer. */ void handle_channel_update(byte[] _their_node_id, ChannelUpdate _msg); /** - * Handle an incoming error message from the given peer. + * Handle an incoming `error` message from the given peer. */ void handle_error(byte[] _their_node_id, ErrorMessage _msg); /** @@ -128,24 +166,37 @@ public class ChannelMessageHandler : CommonBase { * Note that this method is called before [`Self::peer_connected`]. */ InitFeatures provided_init_features(byte[] _their_node_id); + /** + * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports. + * + * If it's `None`, then no particular network chain hash compatibility will be enforced when + * connecting to peers. + */ + Option_CVec_ChainHashZZ get_genesis_hashes(); } private class LDKChannelMessageHandlerHolder { internal ChannelMessageHandler held; } private class LDKChannelMessageHandlerImpl : bindings.LDKChannelMessageHandler { internal LDKChannelMessageHandlerImpl(ChannelMessageHandlerInterface arg, LDKChannelMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private ChannelMessageHandlerInterface arg; private LDKChannelMessageHandlerHolder impl_holder; - public void handle_open_channel(byte[] _their_node_id, long _their_features, long _msg) { - org.ldk.structs.InitFeatures _their_features_hu_conv = null; if (_their_features < 0 || _their_features > 4096) { _their_features_hu_conv = new org.ldk.structs.InitFeatures(null, _their_features); } - if (_their_features_hu_conv != null) { _their_features_hu_conv.ptrs_to.AddLast(this); }; + public void handle_open_channel(byte[] _their_node_id, long _msg) { org.ldk.structs.OpenChannel _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.OpenChannel(null, _msg); } - arg.handle_open_channel(_their_node_id, _their_features_hu_conv, _msg_hu_conv); + arg.handle_open_channel(_their_node_id, _msg_hu_conv); GC.KeepAlive(arg); } - public void handle_accept_channel(byte[] _their_node_id, long _their_features, long _msg) { - org.ldk.structs.InitFeatures _their_features_hu_conv = null; if (_their_features < 0 || _their_features > 4096) { _their_features_hu_conv = new org.ldk.structs.InitFeatures(null, _their_features); } - if (_their_features_hu_conv != null) { _their_features_hu_conv.ptrs_to.AddLast(this); }; + public void handle_open_channel_v2(byte[] _their_node_id, long _msg) { + org.ldk.structs.OpenChannelV2 _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, _msg); } + arg.handle_open_channel_v2(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_accept_channel(byte[] _their_node_id, long _msg) { org.ldk.structs.AcceptChannel _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.AcceptChannel(null, _msg); } - arg.handle_accept_channel(_their_node_id, _their_features_hu_conv, _msg_hu_conv); + arg.handle_accept_channel(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_accept_channel_v2(byte[] _their_node_id, long _msg) { + org.ldk.structs.AcceptChannelV2 _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, _msg); } + arg.handle_accept_channel_v2(_their_node_id, _msg_hu_conv); GC.KeepAlive(arg); } public void handle_funding_created(byte[] _their_node_id, long _msg) { @@ -163,10 +214,9 @@ public class ChannelMessageHandler : CommonBase { arg.handle_channel_ready(_their_node_id, _msg_hu_conv); GC.KeepAlive(arg); } - public void handle_shutdown(byte[] _their_node_id, long _their_features, long _msg) { - org.ldk.structs.InitFeatures _their_features_hu_conv = null; if (_their_features < 0 || _their_features > 4096) { _their_features_hu_conv = new org.ldk.structs.InitFeatures(null, _their_features); } + public void handle_shutdown(byte[] _their_node_id, long _msg) { org.ldk.structs.Shutdown _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.Shutdown(null, _msg); } - arg.handle_shutdown(_their_node_id, _their_features_hu_conv, _msg_hu_conv); + arg.handle_shutdown(_their_node_id, _msg_hu_conv); GC.KeepAlive(arg); } public void handle_closing_signed(byte[] _their_node_id, long _msg) { @@ -174,6 +224,51 @@ public class ChannelMessageHandler : CommonBase { arg.handle_closing_signed(_their_node_id, _msg_hu_conv); GC.KeepAlive(arg); } + public void handle_tx_add_input(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxAddInput _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxAddInput(null, _msg); } + arg.handle_tx_add_input(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_add_output(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxAddOutput _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxAddOutput(null, _msg); } + arg.handle_tx_add_output(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_remove_input(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxRemoveInput _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxRemoveInput(null, _msg); } + arg.handle_tx_remove_input(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_remove_output(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxRemoveOutput _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, _msg); } + arg.handle_tx_remove_output(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_complete(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxComplete _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxComplete(null, _msg); } + arg.handle_tx_complete(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_signatures(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxSignatures _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxSignatures(null, _msg); } + arg.handle_tx_signatures(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_init_rbf(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxInitRbf _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxInitRbf(null, _msg); } + arg.handle_tx_init_rbf(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_ack_rbf(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxAckRbf _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxAckRbf(null, _msg); } + arg.handle_tx_ack_rbf(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } + public void handle_tx_abort(byte[] _their_node_id, long _msg) { + org.ldk.structs.TxAbort _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxAbort(null, _msg); } + arg.handle_tx_abort(_their_node_id, _msg_hu_conv); + GC.KeepAlive(arg); + } public void handle_update_add_htlc(byte[] _their_node_id, long _msg) { org.ldk.structs.UpdateAddHTLC _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, _msg); } arg.handle_update_add_htlc(_their_node_id, _msg_hu_conv); @@ -214,13 +309,13 @@ public class ChannelMessageHandler : CommonBase { arg.handle_announcement_signatures(_their_node_id, _msg_hu_conv); GC.KeepAlive(arg); } - public void peer_disconnected(byte[] _their_node_id, bool _no_connection_possible) { - arg.peer_disconnected(_their_node_id, _no_connection_possible); + public void peer_disconnected(byte[] _their_node_id) { + arg.peer_disconnected(_their_node_id); GC.KeepAlive(arg); } - public long peer_connected(byte[] _their_node_id, long _msg) { + public long peer_connected(byte[] _their_node_id, long _msg, bool _inbound) { org.ldk.structs.Init _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.Init(null, _msg); } - Result_NoneNoneZ ret = arg.peer_connected(_their_node_id, _msg_hu_conv); + Result_NoneNoneZ ret = arg.peer_connected(_their_node_id, _msg_hu_conv, _inbound); GC.KeepAlive(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; @@ -252,6 +347,13 @@ public class ChannelMessageHandler : CommonBase { long result = ret == null ? 0 : ret.clone_ptr(); return result; } + public long get_genesis_hashes() { + Option_CVec_ChainHashZZ ret = arg.get_genesis_hashes(); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; + return result; + } } public static ChannelMessageHandler new_impl(ChannelMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) { LDKChannelMessageHandlerHolder impl_holder = new LDKChannelMessageHandlerHolder(); @@ -269,33 +371,51 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming open_channel message from the given peer. + * Handle an incoming `open_channel` message from the given peer. */ - public void handle_open_channel(byte[] their_node_id, org.ldk.structs.InitFeatures their_features, org.ldk.structs.OpenChannel msg) { - bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr, msg == null ? 0 : msg.ptr); + public void handle_open_channel(byte[] their_node_id, org.ldk.structs.OpenChannel msg) { + bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); - GC.KeepAlive(their_features); GC.KeepAlive(msg); - if (this != null) { this.ptrs_to.AddLast(their_features); }; if (this != null) { this.ptrs_to.AddLast(msg); }; } /** - * Handle an incoming accept_channel message from the given peer. + * Handle an incoming `open_channel2` message from the given peer. */ - public void handle_accept_channel(byte[] their_node_id, org.ldk.structs.InitFeatures their_features, org.ldk.structs.AcceptChannel msg) { - bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr, msg == null ? 0 : msg.ptr); + public void handle_open_channel_v2(byte[] their_node_id, org.ldk.structs.OpenChannelV2 msg) { + bindings.ChannelMessageHandler_handle_open_channel_v2(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); - GC.KeepAlive(their_features); GC.KeepAlive(msg); - if (this != null) { this.ptrs_to.AddLast(their_features); }; if (this != null) { this.ptrs_to.AddLast(msg); }; } /** - * Handle an incoming funding_created message from the given peer. + * Handle an incoming `accept_channel` message from the given peer. + */ + public void handle_accept_channel(byte[] their_node_id, org.ldk.structs.AcceptChannel msg) { + bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `accept_channel2` message from the given peer. + */ + public void handle_accept_channel_v2(byte[] their_node_id, org.ldk.structs.AcceptChannelV2 msg) { + bindings.ChannelMessageHandler_handle_accept_channel_v2(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `funding_created` message from the given peer. */ public void handle_funding_created(byte[] their_node_id, org.ldk.structs.FundingCreated msg) { bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -306,7 +426,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming funding_signed message from the given peer. + * Handle an incoming `funding_signed` message from the given peer. */ public void handle_funding_signed(byte[] their_node_id, org.ldk.structs.FundingSigned msg) { bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -317,7 +437,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming channel_ready message from the given peer. + * Handle an incoming `channel_ready` message from the given peer. */ public void handle_channel_ready(byte[] their_node_id, org.ldk.structs.ChannelReady msg) { bindings.ChannelMessageHandler_handle_channel_ready(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -328,20 +448,18 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming shutdown message from the given peer. + * Handle an incoming `shutdown` message from the given peer. */ - public void handle_shutdown(byte[] their_node_id, org.ldk.structs.InitFeatures their_features, org.ldk.structs.Shutdown msg) { - bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr, msg == null ? 0 : msg.ptr); + public void handle_shutdown(byte[] their_node_id, org.ldk.structs.Shutdown msg) { + bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); - GC.KeepAlive(their_features); GC.KeepAlive(msg); - if (this != null) { this.ptrs_to.AddLast(their_features); }; if (this != null) { this.ptrs_to.AddLast(msg); }; } /** - * Handle an incoming closing_signed message from the given peer. + * Handle an incoming `closing_signed` message from the given peer. */ public void handle_closing_signed(byte[] their_node_id, org.ldk.structs.ClosingSigned msg) { bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -352,7 +470,106 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming update_add_htlc message from the given peer. + * Handle an incoming `tx_add_input message` from the given peer. + */ + public void handle_tx_add_input(byte[] their_node_id, org.ldk.structs.TxAddInput msg) { + bindings.ChannelMessageHandler_handle_tx_add_input(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_add_output` message from the given peer. + */ + public void handle_tx_add_output(byte[] their_node_id, org.ldk.structs.TxAddOutput msg) { + bindings.ChannelMessageHandler_handle_tx_add_output(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_remove_input` message from the given peer. + */ + public void handle_tx_remove_input(byte[] their_node_id, org.ldk.structs.TxRemoveInput msg) { + bindings.ChannelMessageHandler_handle_tx_remove_input(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_remove_output` message from the given peer. + */ + public void handle_tx_remove_output(byte[] their_node_id, org.ldk.structs.TxRemoveOutput msg) { + bindings.ChannelMessageHandler_handle_tx_remove_output(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_complete message` from the given peer. + */ + public void handle_tx_complete(byte[] their_node_id, org.ldk.structs.TxComplete msg) { + bindings.ChannelMessageHandler_handle_tx_complete(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_signatures` message from the given peer. + */ + public void handle_tx_signatures(byte[] their_node_id, org.ldk.structs.TxSignatures msg) { + bindings.ChannelMessageHandler_handle_tx_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_init_rbf` message from the given peer. + */ + public void handle_tx_init_rbf(byte[] their_node_id, org.ldk.structs.TxInitRbf msg) { + bindings.ChannelMessageHandler_handle_tx_init_rbf(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_ack_rbf` message from the given peer. + */ + public void handle_tx_ack_rbf(byte[] their_node_id, org.ldk.structs.TxAckRbf msg) { + bindings.ChannelMessageHandler_handle_tx_ack_rbf(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `tx_abort message` from the given peer. + */ + public void handle_tx_abort(byte[] their_node_id, org.ldk.structs.TxAbort msg) { + bindings.ChannelMessageHandler_handle_tx_abort(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + GC.KeepAlive(msg); + if (this != null) { this.ptrs_to.AddLast(msg); }; + } + + /** + * Handle an incoming `update_add_htlc` message from the given peer. */ public void handle_update_add_htlc(byte[] their_node_id, org.ldk.structs.UpdateAddHTLC msg) { bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -363,7 +580,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming update_fulfill_htlc message from the given peer. + * Handle an incoming `update_fulfill_htlc` message from the given peer. */ public void handle_update_fulfill_htlc(byte[] their_node_id, org.ldk.structs.UpdateFulfillHTLC msg) { bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -374,7 +591,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming update_fail_htlc message from the given peer. + * Handle an incoming `update_fail_htlc` message from the given peer. */ public void handle_update_fail_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -385,7 +602,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming update_fail_malformed_htlc message from the given peer. + * Handle an incoming `update_fail_malformed_htlc` message from the given peer. */ public void handle_update_fail_malformed_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailMalformedHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -396,7 +613,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming commitment_signed message from the given peer. + * Handle an incoming `commitment_signed` message from the given peer. */ public void handle_commitment_signed(byte[] their_node_id, org.ldk.structs.CommitmentSigned msg) { bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -407,7 +624,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming revoke_and_ack message from the given peer. + * Handle an incoming `revoke_and_ack` message from the given peer. */ public void handle_revoke_and_ack(byte[] their_node_id, org.ldk.structs.RevokeAndACK msg) { bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -418,7 +635,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming update_fee message from the given peer. + * Handle an incoming `update_fee` message from the given peer. */ public void handle_update_fee(byte[] their_node_id, org.ldk.structs.UpdateFee msg) { bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -429,7 +646,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming announcement_signatures message from the given peer. + * Handle an incoming `announcement_signatures` message from the given peer. */ public void handle_announcement_signatures(byte[] their_node_id, org.ldk.structs.AnnouncementSignatures msg) { bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -440,33 +657,27 @@ public class ChannelMessageHandler : CommonBase { } /** - * Indicates a connection to the peer failed/an existing connection was lost. If no connection - * is believed to be possible in the future (eg they're sending us messages we don't - * understand or indicate they require unknown feature bits), no_connection_possible is set - * and any outstanding channels should be failed. - * - * Note that in some rare cases this may be called without a corresponding - * [`Self::peer_connected`]. + * Indicates a connection to the peer failed/an existing connection was lost. */ - public void peer_disconnected(byte[] their_node_id, bool no_connection_possible) { - bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible); + public void peer_disconnected(byte[] their_node_id) { + bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33)); GC.KeepAlive(this); GC.KeepAlive(their_node_id); - GC.KeepAlive(no_connection_possible); } /** - * Handle a peer reconnecting, possibly generating channel_reestablish message(s). + * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s). * * May return an `Err(())` if the features the peer supports are not sufficient to communicate * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init msg) { - long ret = bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); + public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init msg, bool inbound) { + long ret = bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr, inbound); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); + GC.KeepAlive(inbound); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(msg); }; @@ -474,7 +685,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming channel_reestablish message from the given peer. + * Handle an incoming `channel_reestablish` message from the given peer. */ public void handle_channel_reestablish(byte[] their_node_id, org.ldk.structs.ChannelReestablish msg) { bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -485,7 +696,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming channel update from the given peer. + * Handle an incoming `channel_update` message from the given peer. */ public void handle_channel_update(byte[] their_node_id, org.ldk.structs.ChannelUpdate msg) { bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -496,7 +707,7 @@ public class ChannelMessageHandler : CommonBase { } /** - * Handle an incoming error message from the given peer. + * Handle an incoming `error` message from the given peer. */ public void handle_error(byte[] their_node_id, org.ldk.structs.ErrorMessage msg) { bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -537,5 +748,20 @@ public class ChannelMessageHandler : CommonBase { return ret_hu_conv; } + /** + * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports. + * + * If it's `None`, then no particular network chain hash compatibility will be enforced when + * connecting to peers. + */ + public Option_CVec_ChainHashZZ get_genesis_hashes() { + long ret = bindings.ChannelMessageHandler_get_genesis_hashes(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_ChainHashZZ ret_hu_conv = org.ldk.structs.Option_CVec_ChainHashZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/ChannelMonitor.cs b/c_sharp/src/org/ldk/structs/ChannelMonitor.cs index 7ed5112e..19300a59 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMonitor.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMonitor.cs @@ -13,11 +13,6 @@ namespace org { namespace ldk { namespace structs { * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date * information and are actively monitoring the chain. * - * Pending Events or updated HTLCs which have not yet been read out by - * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and - * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events - * gotten are fully handled before re-serializing the new state. - * * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the @@ -64,7 +59,7 @@ public class ChannelMonitor : CommonBase { * panics if the given update is not the next update by update_id. */ public Result_NoneNoneZ update_monitor(org.ldk.structs.ChannelMonitorUpdate updates, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(updates); GC.KeepAlive(broadcaster); @@ -125,7 +120,7 @@ public class ChannelMonitor : CommonBase { * have been registered. */ public void load_outputs_to_watch(org.ldk.structs.Filter filter) { - bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr); + bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter.ptr); GC.KeepAlive(this); GC.KeepAlive(filter); if (this != null) { this.ptrs_to.AddLast(filter); }; @@ -150,27 +145,25 @@ public class ChannelMonitor : CommonBase { } /** - * Gets the list of pending events which were generated by previous actions, clearing the list - * in the process. + * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity. + * + * For channels featuring anchor outputs, this method will also process [`BumpTransaction`] + * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain + * within each channel. As the confirmation of a commitment transaction may be critical to the + * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an + * environment with spotty connections, like on mobile. * - * This is called by the [`EventsProvider::process_pending_events`] implementation for - * [`ChainMonitor`]. + * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in + * order to handle these events. * - * [`EventsProvider::process_pending_events`]: crate::util::events::EventsProvider::process_pending_events - * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor + * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs + * [`BumpTransaction`]: crate::events::Event::BumpTransaction */ - public Event[] get_and_clear_pending_events() { - long[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr); + public void process_pending_events(org.ldk.structs.EventHandler handler) { + bindings.ChannelMonitor_process_pending_events(this.ptr, handler.ptr); GC.KeepAlive(this); - int ret_conv_7_len = ret.Length; - Event[] ret_conv_7_arr = new Event[ret_conv_7_len]; - for (int h = 0; h < ret_conv_7_len; h++) { - long ret_conv_7 = ret[h]; - org.ldk.structs.Event ret_conv_7_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret_conv_7); - if (ret_conv_7_hu_conv != null) { ret_conv_7_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_7_arr[h] = ret_conv_7_hu_conv; - } - return ret_conv_7_arr; + GC.KeepAlive(handler); + if (this != null) { this.ptrs_to.AddLast(handler); }; } /** @@ -205,7 +198,7 @@ public class ChannelMonitor : CommonBase { * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure */ public byte[][] get_latest_holder_commitment_txn(org.ldk.structs.Logger logger) { - byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr); + byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(logger); if (this != null) { this.ptrs_to.AddLast(logger); }; @@ -226,7 +219,7 @@ public class ChannelMonitor : CommonBase { * [`get_outputs_to_watch`]: #method.get_outputs_to_watch */ public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0) : null, height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(txdata); @@ -253,7 +246,7 @@ public class ChannelMonitor : CommonBase { * appropriately. */ public void block_disconnected(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(height); @@ -275,7 +268,7 @@ public class ChannelMonitor : CommonBase { * [`block_connected`]: Self::block_connected */ public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0) : null, height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(txdata); @@ -306,7 +299,7 @@ public class ChannelMonitor : CommonBase { * [`block_disconnected`]: Self::block_disconnected */ public void transaction_unconfirmed(byte[] txid, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(txid); GC.KeepAlive(broadcaster); @@ -327,7 +320,7 @@ public class ChannelMonitor : CommonBase { * [`block_connected`]: Self::block_connected */ public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(height); @@ -351,18 +344,18 @@ public class ChannelMonitor : CommonBase { /** * Returns the set of txids that should be monitored for re-organization out of the chain. */ - public TwoTuple_TxidBlockHashZ[] get_relevant_txids() { + public TwoTuple_TxidCOption_BlockHashZZ[] get_relevant_txids() { long[] ret = bindings.ChannelMonitor_get_relevant_txids(this.ptr); GC.KeepAlive(this); - int ret_conv_25_len = ret.Length; - TwoTuple_TxidBlockHashZ[] ret_conv_25_arr = new TwoTuple_TxidBlockHashZ[ret_conv_25_len]; - for (int z = 0; z < ret_conv_25_len; z++) { - long ret_conv_25 = ret[z]; - TwoTuple_TxidBlockHashZ ret_conv_25_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret_conv_25); - if (ret_conv_25_hu_conv != null) { ret_conv_25_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_25_arr[z] = ret_conv_25_hu_conv; + int ret_conv_34_len = ret.Length; + TwoTuple_TxidCOption_BlockHashZZ[] ret_conv_34_arr = new TwoTuple_TxidCOption_BlockHashZZ[ret_conv_34_len]; + for (int i = 0; i < ret_conv_34_len; i++) { + long ret_conv_34 = ret[i]; + TwoTuple_TxidCOption_BlockHashZZ ret_conv_34_hu_conv = new TwoTuple_TxidCOption_BlockHashZZ(null, ret_conv_34); + if (ret_conv_34_hu_conv != null) { ret_conv_34_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_34_arr[i] = ret_conv_34_hu_conv; } - return ret_conv_25_arr; + return ret_conv_34_arr; } /** @@ -378,6 +371,24 @@ public class ChannelMonitor : CommonBase { return ret_hu_conv; } + /** + * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is + * crucial in preventing certain classes of pinning attacks, detecting substantial mempool + * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend + * invoking this every 30 seconds, or lower if running in an environment with spotty + * connections, like on mobile. + */ + public void rebroadcast_pending_claims(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { + bindings.ChannelMonitor_rebroadcast_pending_claims(this.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr); + GC.KeepAlive(this); + GC.KeepAlive(broadcaster); + GC.KeepAlive(fee_estimator); + GC.KeepAlive(logger); + if (this != null) { this.ptrs_to.AddLast(broadcaster); }; + if (this != null) { this.ptrs_to.AddLast(fee_estimator); }; + if (this != null) { this.ptrs_to.AddLast(logger); }; + } + /** * Gets the balances in this channel which are either claimable by us if we were to * force-close the channel now or which are claimable on-chain (possibly awaiting diff --git a/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs index 72792687..20b4eb37 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs @@ -24,15 +24,17 @@ public class ChannelMonitorUpdate : CommonBase { /** * The sequence number of this update. Updates *must* be replayed in-order according to this * sequence number (and updates may panic if they are not). The update_id values are strictly - * increasing and increase by one for each new update, with one exception specified below. + * increasing and increase by one for each new update, with two exceptions specified below. * * This sequence number is also used to track up to which points updates which returned * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given * ChannelMonitor when ChannelManager::channel_monitor_updated is called. * - * The only instance where update_id values are not strictly increasing is the case where we - * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See - * its docs for more details. + * The only instances we allow where update_id values are not strictly increasing have a + * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that + * will force close the channel by broadcasting the latest commitment transaction or + * special post-force-close updates, like providing preimages necessary to claim outputs on the + * broadcast commitment transaction. See its docs for more details. * * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress */ @@ -45,15 +47,17 @@ public class ChannelMonitorUpdate : CommonBase { /** * The sequence number of this update. Updates *must* be replayed in-order according to this * sequence number (and updates may panic if they are not). The update_id values are strictly - * increasing and increase by one for each new update, with one exception specified below. + * increasing and increase by one for each new update, with two exceptions specified below. * * This sequence number is also used to track up to which points updates which returned * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given * ChannelMonitor when ChannelManager::channel_monitor_updated is called. * - * The only instance where update_id values are not strictly increasing is the case where we - * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See - * its docs for more details. + * The only instances we allow where update_id values are not strictly increasing have a + * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that + * will force close the channel by broadcasting the latest commitment transaction or + * special post-force-close updates, like providing preimages necessary to claim outputs on the + * broadcast commitment transaction. See its docs for more details. * * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress */ @@ -81,6 +85,23 @@ public class ChannelMonitorUpdate : CommonBase { return ret_hu_conv; } + /** + * Checks if two ChannelMonitorUpdates contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.ChannelMonitorUpdate b) { + bool ret = bindings.ChannelMonitorUpdate_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is ChannelMonitorUpdate)) return false; + return this.eq((ChannelMonitorUpdate)o); + } /** * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read */ diff --git a/c_sharp/src/org/ldk/structs/ChannelReady.cs b/c_sharp/src/org/ldk/structs/ChannelReady.cs index 86dfd7e7..2fb90c2a 100644 --- a/c_sharp/src/org/ldk/structs/ChannelReady.cs +++ b/c_sharp/src/org/ldk/structs/ChannelReady.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A channel_ready message to be sent or received from a peer + * A [`channel_ready`] message to be sent to or received from a peer. + * + * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message */ public class ChannelReady : CommonBase { internal ChannelReady(object _dummy, long ptr) : base(ptr) { } @@ -52,8 +54,10 @@ public class ChannelReady : CommonBase { } /** - * If set, provides a short_channel_id alias for this channel. The sender will accept payments - * to be forwarded over this SCID and forward them to this messages' recipient. + * If set, provides a `short_channel_id` alias for this channel. + * + * The sender will accept payments to be forwarded over this SCID and forward them to this + * messages' recipient. */ public Option_u64Z get_short_channel_id_alias() { long ret = bindings.ChannelReady_get_short_channel_id_alias(this.ptr); @@ -65,13 +69,16 @@ public class ChannelReady : CommonBase { } /** - * If set, provides a short_channel_id alias for this channel. The sender will accept payments - * to be forwarded over this SCID and forward them to this messages' recipient. + * If set, provides a `short_channel_id` alias for this channel. + * + * The sender will accept payments to be forwarded over this SCID and forward them to this + * messages' recipient. */ public void set_short_channel_id_alias(org.ldk.structs.Option_u64Z val) { bindings.ChannelReady_set_short_channel_id_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -85,6 +92,7 @@ public class ChannelReady : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id_alias_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ChannelReestablish.cs b/c_sharp/src/org/ldk/structs/ChannelReestablish.cs index fa11efab..9218cd62 100644 --- a/c_sharp/src/org/ldk/structs/ChannelReestablish.cs +++ b/c_sharp/src/org/ldk/structs/ChannelReestablish.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A channel_reestablish message to be sent or received from a peer + * A [`channel_reestablish`] message to be sent to or received from a peer. + * + * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission */ public class ChannelReestablish : CommonBase { internal ChannelReestablish(object _dummy, long ptr) : base(ptr) { } @@ -69,6 +71,84 @@ public class ChannelReestablish : CommonBase { GC.KeepAlive(val); } + /** + * Proof that the sender knows the per-commitment secret of a specific commitment transaction + * belonging to the recipient + */ + public byte[] get_your_last_per_commitment_secret() { + byte[] ret = bindings.ChannelReestablish_get_your_last_per_commitment_secret(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Proof that the sender knows the per-commitment secret of a specific commitment transaction + * belonging to the recipient + */ + public void set_your_last_per_commitment_secret(byte[] val) { + bindings.ChannelReestablish_set_your_last_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The sender's per-commitment point for their current commitment transaction + */ + public byte[] get_my_current_per_commitment_point() { + byte[] ret = bindings.ChannelReestablish_get_my_current_per_commitment_point(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The sender's per-commitment point for their current commitment transaction + */ + public void set_my_current_per_commitment_point(byte[] val) { + bindings.ChannelReestablish_set_my_current_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The next funding transaction ID + */ + public Option_TxidZ get_next_funding_txid() { + long ret = bindings.ChannelReestablish_get_next_funding_txid(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxidZ ret_hu_conv = org.ldk.structs.Option_TxidZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The next funding transaction ID + */ + public void set_next_funding_txid(org.ldk.structs.Option_TxidZ val) { + bindings.ChannelReestablish_set_next_funding_txid(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new ChannelReestablish given each field + */ + public static ChannelReestablish of(byte[] channel_id_arg, long next_local_commitment_number_arg, long next_remote_commitment_number_arg, byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg, org.ldk.structs.Option_TxidZ next_funding_txid_arg) { + long ret = bindings.ChannelReestablish_new(InternalUtils.check_arr_len(channel_id_arg, 32), next_local_commitment_number_arg, next_remote_commitment_number_arg, InternalUtils.check_arr_len(your_last_per_commitment_secret_arg, 32), InternalUtils.check_arr_len(my_current_per_commitment_point_arg, 33), next_funding_txid_arg.ptr); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(next_local_commitment_number_arg); + GC.KeepAlive(next_remote_commitment_number_arg); + GC.KeepAlive(your_last_per_commitment_secret_arg); + GC.KeepAlive(my_current_per_commitment_point_arg); + GC.KeepAlive(next_funding_txid_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReestablish(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(next_funding_txid_arg); }; + return ret_hu_conv; + } + internal long clone_ptr() { long ret = bindings.ChannelReestablish_clone_ptr(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/ChannelSigner.cs b/c_sharp/src/org/ldk/structs/ChannelSigner.cs new file mode 100644 index 00000000..24f3b17b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ChannelSigner.cs @@ -0,0 +1,215 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A trait to handle Lightning channel key material without concretizing the channel type or + * the signature mechanism. + */ +public class ChannelSigner : CommonBase { + internal readonly bindings.LDKChannelSigner bindings_instance; + internal ChannelSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private ChannelSigner(bindings.LDKChannelSigner arg, ChannelPublicKeys pubkeys) : base(bindings.LDKChannelSigner_new(arg, pubkeys == null ? 0 : pubkeys.clone_ptr())) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~ChannelSigner() { + if (ptr != 0) { bindings.ChannelSigner_free(ptr); } + } + + public interface ChannelSignerInterface { + /** + * Gets the per-commitment point for a specific commitment number + * + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + */ + byte[] get_per_commitment_point(long _idx); + /** + * Gets the commitment secret for a specific commitment number as part of the revocation process + * + * An external signer implementation should error here if the commitment was already signed + * and should refuse to sign it in the future. + * + * May be called more than once for the same index. + * + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + */ + byte[] release_commitment_secret(long _idx); + /** + * Validate the counterparty's signatures on the holder commitment transaction and HTLCs. + * + * This is required in order for the signer to make sure that releasing a commitment + * secret won't leave us without a broadcastable holder transaction. + * Policy checks should be implemented in this function, including checking the amount + * sent to us and checking the HTLCs. + * + * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided. + * A validating signer should ensure that an HTLC output is removed only when the matching + * preimage is provided, or when the value to holder is restored. + * + * Note that all the relevant preimages will be provided, but there may also be additional + * irrelevant or duplicate preimages. + */ + Result_NoneNoneZ validate_holder_commitment(HolderCommitmentTransaction _holder_tx, byte[][] _preimages); + /** + * Returns an arbitrary identifier describing the set of keys which are provided back to you in + * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this + * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys. + */ + byte[] channel_keys_id(); + /** + * Set the counterparty static channel data, including basepoints, + * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. + * + * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`] + * instance, LDK will call this method exactly once - either immediately after construction + * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding + * information has been generated. + * + * channel_parameters.is_populated() MUST be true. + */ + void provide_channel_parameters(ChannelTransactionParameters _channel_parameters); + } + private class LDKChannelSignerHolder { internal ChannelSigner held; } + private class LDKChannelSignerImpl : bindings.LDKChannelSigner { + internal LDKChannelSignerImpl(ChannelSignerInterface arg, LDKChannelSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private ChannelSignerInterface arg; + private LDKChannelSignerHolder impl_holder; + public byte[] get_per_commitment_point(long _idx) { + byte[] ret = arg.get_per_commitment_point(_idx); + GC.KeepAlive(arg); + byte[] result = InternalUtils.check_arr_len(ret, 33); + return result; + } + public byte[] release_commitment_secret(long _idx) { + byte[] ret = arg.release_commitment_secret(_idx); + GC.KeepAlive(arg); + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; + } + public long validate_holder_commitment(long _holder_tx, byte[][] _preimages) { + org.ldk.structs.HolderCommitmentTransaction _holder_tx_hu_conv = null; if (_holder_tx < 0 || _holder_tx > 4096) { _holder_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, _holder_tx); } + Result_NoneNoneZ ret = arg.validate_holder_commitment(_holder_tx_hu_conv, _preimages); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public byte[] channel_keys_id() { + byte[] ret = arg.channel_keys_id(); + GC.KeepAlive(arg); + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; + } + public void provide_channel_parameters(long _channel_parameters) { + org.ldk.structs.ChannelTransactionParameters _channel_parameters_hu_conv = null; if (_channel_parameters < 0 || _channel_parameters > 4096) { _channel_parameters_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, _channel_parameters); } + arg.provide_channel_parameters(_channel_parameters_hu_conv); + GC.KeepAlive(arg); + } + } + public static ChannelSigner new_impl(ChannelSignerInterface arg, ChannelPublicKeys pubkeys) { + LDKChannelSignerHolder impl_holder = new LDKChannelSignerHolder(); + impl_holder.held = new ChannelSigner(new LDKChannelSignerImpl(arg, impl_holder), pubkeys); + return impl_holder.held; + } + /** + * Gets the per-commitment point for a specific commitment number + * + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + */ + public byte[] get_per_commitment_point(long idx) { + byte[] ret = bindings.ChannelSigner_get_per_commitment_point(this.ptr, idx); + GC.KeepAlive(this); + GC.KeepAlive(idx); + return ret; + } + + /** + * Gets the commitment secret for a specific commitment number as part of the revocation process + * + * An external signer implementation should error here if the commitment was already signed + * and should refuse to sign it in the future. + * + * May be called more than once for the same index. + * + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + */ + public byte[] release_commitment_secret(long idx) { + byte[] ret = bindings.ChannelSigner_release_commitment_secret(this.ptr, idx); + GC.KeepAlive(this); + GC.KeepAlive(idx); + return ret; + } + + /** + * Validate the counterparty's signatures on the holder commitment transaction and HTLCs. + * + * This is required in order for the signer to make sure that releasing a commitment + * secret won't leave us without a broadcastable holder transaction. + * Policy checks should be implemented in this function, including checking the amount + * sent to us and checking the HTLCs. + * + * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided. + * A validating signer should ensure that an HTLC output is removed only when the matching + * preimage is provided, or when the value to holder is restored. + * + * Note that all the relevant preimages will be provided, but there may also be additional + * irrelevant or duplicate preimages. + */ + public Result_NoneNoneZ validate_holder_commitment(org.ldk.structs.HolderCommitmentTransaction holder_tx, byte[][] preimages) { + long ret = bindings.ChannelSigner_validate_holder_commitment(this.ptr, holder_tx == null ? 0 : holder_tx.ptr, preimages != null ? InternalUtils.mapArray(preimages, preimages_conv_8 => InternalUtils.check_arr_len(preimages_conv_8, 32)) : null); + GC.KeepAlive(this); + GC.KeepAlive(holder_tx); + GC.KeepAlive(preimages); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(holder_tx); }; + return ret_hu_conv; + } + + /** + * Returns an arbitrary identifier describing the set of keys which are provided back to you in + * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this + * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys. + */ + public byte[] channel_keys_id() { + byte[] ret = bindings.ChannelSigner_channel_keys_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Set the counterparty static channel data, including basepoints, + * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. + * + * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`] + * instance, LDK will call this method exactly once - either immediately after construction + * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding + * information has been generated. + * + * channel_parameters.is_populated() MUST be true. + */ + public void provide_channel_parameters(org.ldk.structs.ChannelTransactionParameters channel_parameters) { + bindings.ChannelSigner_provide_channel_parameters(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr); + GC.KeepAlive(this); + GC.KeepAlive(channel_parameters); + if (this != null) { this.ptrs_to.AddLast(channel_parameters); }; + } + + /** + * Frees any resources associated with this object given its this_arg pointer. + * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + */ + public ChannelPublicKeys get_pubkeys() { + long ret = bindings.ChannelSigner_get_pubkeys(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs b/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs index 7bd5fe6a..62a413c2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs +++ b/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs @@ -134,65 +134,47 @@ public class ChannelTransactionParameters : CommonBase { } /** - * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is - * serialization backwards-compatible. + * This channel's type, as negotiated during channel open. For old objects where this field + * wasn't serialized, it will default to static_remote_key at deserialization. */ - public COption_NoneZ get_opt_anchors() { - COption_NoneZ ret = bindings.ChannelTransactionParameters_get_opt_anchors(this.ptr); + public ChannelTypeFeatures get_channel_type_features() { + long ret = bindings.ChannelTransactionParameters_get_channel_type_features(this.ptr); GC.KeepAlive(this); - return ret; - } - - /** - * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is - * serialization backwards-compatible. - */ - public void set_opt_anchors(COption_NoneZ val) { - bindings.ChannelTransactionParameters_set_opt_anchors(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors) - * It is intended merely for backwards compatibility with signers that need it. - * There is no support for this feature in LDK channel negotiation. - */ - public COption_NoneZ get_opt_non_zero_fee_anchors() { - COption_NoneZ ret = bindings.ChannelTransactionParameters_get_opt_non_zero_fee_anchors(this.ptr); - GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors) - * It is intended merely for backwards compatibility with signers that need it. - * There is no support for this feature in LDK channel negotiation. + * This channel's type, as negotiated during channel open. For old objects where this field + * wasn't serialized, it will default to static_remote_key at deserialization. */ - public void set_opt_non_zero_fee_anchors(COption_NoneZ val) { - bindings.ChannelTransactionParameters_set_opt_non_zero_fee_anchors(this.ptr, val); + public void set_channel_type_features(org.ldk.structs.ChannelTypeFeatures val) { + bindings.ChannelTransactionParameters_set_channel_type_features(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** * Constructs a new ChannelTransactionParameters given each field */ - public static ChannelTransactionParameters of(org.ldk.structs.ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, org.ldk.structs.CounterpartyChannelTransactionParameters counterparty_parameters_arg, org.ldk.structs.OutPoint funding_outpoint_arg, COption_NoneZ opt_anchors_arg, COption_NoneZ opt_non_zero_fee_anchors_arg) { - long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr, opt_anchors_arg, opt_non_zero_fee_anchors_arg); + public static ChannelTransactionParameters of(org.ldk.structs.ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, org.ldk.structs.CounterpartyChannelTransactionParameters counterparty_parameters_arg, org.ldk.structs.OutPoint funding_outpoint_arg, org.ldk.structs.ChannelTypeFeatures channel_type_features_arg) { + long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr, channel_type_features_arg == null ? 0 : channel_type_features_arg.ptr); GC.KeepAlive(holder_pubkeys_arg); GC.KeepAlive(holder_selected_contest_delay_arg); GC.KeepAlive(is_outbound_from_holder_arg); GC.KeepAlive(counterparty_parameters_arg); GC.KeepAlive(funding_outpoint_arg); - GC.KeepAlive(opt_anchors_arg); - GC.KeepAlive(opt_non_zero_fee_anchors_arg); + GC.KeepAlive(channel_type_features_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(holder_pubkeys_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(counterparty_parameters_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_outpoint_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_features_arg); }; return ret_hu_conv; } @@ -214,6 +196,23 @@ public class ChannelTransactionParameters : CommonBase { return ret_hu_conv; } + /** + * Checks if two ChannelTransactionParameterss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.ChannelTransactionParameters b) { + bool ret = bindings.ChannelTransactionParameters_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is ChannelTransactionParameters)) return false; + return this.eq((ChannelTransactionParameters)o); + } /** * Whether the late bound parameters are populated. */ diff --git a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs index 8eb0f1f8..949cb556 100644 --- a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs @@ -70,6 +70,17 @@ public class ChannelTypeFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.ChannelTypeFeatures other) { + bool ret = bindings.ChannelTypeFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -80,6 +91,42 @@ public class ChannelTypeFeatures : CommonBase { return ret; } + /** + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.ChannelTypeFeatures_set_required_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.ChannelTypeFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read */ @@ -134,6 +181,74 @@ public class ChannelTypeFeatures : CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_anchors_nonzero_fee_htlc_tx_optional() { + bindings.ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_anchors_nonzero_fee_htlc_tx_required() { + bindings.ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_anchors_nonzero_fee_htlc_tx() { + bool ret = bindings.ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_anchors_nonzero_fee_htlc_tx() { + bool ret = bindings.ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_anchors_zero_fee_htlc_tx_optional() { + bindings.ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_anchors_zero_fee_htlc_tx_required() { + bindings.ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_anchors_zero_fee_htlc_tx() { + bool ret = bindings.ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_anchors_zero_fee_htlc_tx() { + bool ret = bindings.ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Set this feature as optional. */ diff --git a/c_sharp/src/org/ldk/structs/ChannelUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelUpdate.cs index 031932b1..af39a9aa 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUpdate.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A channel_update message to be sent or received from a peer + * A [`channel_update`] message to be sent to or received from a peer. + * + * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message */ public class ChannelUpdate : CommonBase { internal ChannelUpdate(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/ChannelUsage.cs b/c_sharp/src/org/ldk/structs/ChannelUsage.cs index 53dfaa0d..0da6b1e4 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUsage.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUsage.cs @@ -72,6 +72,7 @@ public class ChannelUsage : CommonBase { bindings.ChannelUsage_set_effective_capacity(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -85,6 +86,7 @@ public class ChannelUsage : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(effective_capacity_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ClosingSigned.cs b/c_sharp/src/org/ldk/structs/ClosingSigned.cs index 23bedd79..cf10db07 100644 --- a/c_sharp/src/org/ldk/structs/ClosingSigned.cs +++ b/c_sharp/src/org/ldk/structs/ClosingSigned.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A closing_signed message to be sent or received from a peer + * A [`closing_signed`] message to be sent to or received from a peer. + * + * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed */ public class ClosingSigned : CommonBase { internal ClosingSigned(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs b/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs index dcc099e7..571e8150 100644 --- a/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs +++ b/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs @@ -8,6 +8,7 @@ namespace org { namespace ldk { namespace structs { /** * The minimum and maximum fees which the sender is willing to place on the closing transaction. + * * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing * to use. */ diff --git a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs index 0b93e713..37edba0c 100644 --- a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs +++ b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs @@ -38,7 +38,7 @@ public class ClosingTransaction : CommonBase { } /** - * Checks if two ClosingTransactions contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the ClosingTransaction. */ public long hash() { long ret = bindings.ClosingTransaction_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/ClosureReason.cs b/c_sharp/src/org/ldk/structs/ClosureReason.cs index 46160fd1..ed67928d 100644 --- a/c_sharp/src/org/ldk/structs/ClosureReason.cs +++ b/c_sharp/src/org/ldk/structs/ClosureReason.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * The reason the channel was closed. See individual variants more details. + * The reason the channel was closed. See individual variants for more details. */ public class ClosureReason : CommonBase { protected ClosureReason(object _dummy, long ptr) : base(ptr) { } @@ -25,6 +25,7 @@ public class ClosureReason : CommonBase { case 5: return new ClosureReason_ProcessingError(ptr); case 6: return new ClosureReason_DisconnectedPeer(ptr); case 7: return new ClosureReason_OutdatedChannelManager(ptr); + case 8: return new ClosureReason_CounterpartyCoopClosedUnfundedChannel(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -35,13 +36,18 @@ public class ClosureReason : CommonBase { /** * The error which the peer sent us. * - * The string should be sanitized before it is used (e.g emitted to logs - * or printed to stdout). Otherwise, a well crafted error message may exploit + * Be careful about printing the peer_msg, a well-crafted message could exploit * a security vulnerability in the terminal emulator or the logging subsystem. + * To be safe, use `Display` on `UntrustedString` + * + * [`UntrustedString`]: crate::util::string::UntrustedString */ - public string peer_msg; + public UntrustedString peer_msg; internal ClosureReason_CounterpartyForceClosed(long ptr) : base(null, ptr) { - this.peer_msg = bindings.LDKClosureReason_CounterpartyForceClosed_get_peer_msg(ptr); + long peer_msg = bindings.LDKClosureReason_CounterpartyForceClosed_get_peer_msg(ptr); + org.ldk.structs.UntrustedString peer_msg_hu_conv = null; if (peer_msg < 0 || peer_msg > 4096) { peer_msg_hu_conv = new org.ldk.structs.UntrustedString(null, peer_msg); } + if (peer_msg_hu_conv != null) { peer_msg_hu_conv.ptrs_to.AddLast(this); }; + this.peer_msg = peer_msg_hu_conv; } } /** A ClosureReason of type HolderForceClosed */ @@ -84,6 +90,11 @@ public class ClosureReason : CommonBase { internal ClosureReason_OutdatedChannelManager(long ptr) : base(null, ptr) { } } + /** A ClosureReason of type CounterpartyCoopClosedUnfundedChannel */ + public class ClosureReason_CounterpartyCoopClosedUnfundedChannel : ClosureReason { + internal ClosureReason_CounterpartyCoopClosedUnfundedChannel(long ptr) : base(null, ptr) { + } + } internal long clone_ptr() { long ret = bindings.ClosureReason_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -105,12 +116,13 @@ public class ClosureReason : CommonBase { /** * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason */ - public static ClosureReason counterparty_force_closed(string peer_msg) { - long ret = bindings.ClosureReason_counterparty_force_closed(peer_msg); + public static ClosureReason counterparty_force_closed(org.ldk.structs.UntrustedString peer_msg) { + long ret = bindings.ClosureReason_counterparty_force_closed(peer_msg == null ? 0 : peer_msg.ptr); GC.KeepAlive(peer_msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(peer_msg); }; return ret_hu_conv; } @@ -192,6 +204,17 @@ public class ClosureReason : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason + */ + public static ClosureReason counterparty_coop_closed_unfunded_channel() { + long ret = bindings.ClosureReason_counterparty_coop_closed_unfunded_channel(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Checks if two ClosureReasons contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. diff --git a/c_sharp/src/org/ldk/structs/CoinSelection.cs b/c_sharp/src/org/ldk/structs/CoinSelection.cs new file mode 100644 index 00000000..fc1ca1cc --- /dev/null +++ b/c_sharp/src/org/ldk/structs/CoinSelection.cs @@ -0,0 +1,110 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The result of a successful coin selection attempt for a transaction requiring additional UTXOs + * to cover its fees. + */ +public class CoinSelection : CommonBase { + internal CoinSelection(object _dummy, long ptr) : base(ptr) { } + ~CoinSelection() { + if (ptr != 0) { bindings.CoinSelection_free(ptr); } + } + + /** + * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction + * requiring additional fees. + */ + public Utxo[] get_confirmed_utxos() { + long[] ret = bindings.CoinSelection_get_confirmed_utxos(this.ptr); + GC.KeepAlive(this); + int ret_conv_6_len = ret.Length; + Utxo[] ret_conv_6_arr = new Utxo[ret_conv_6_len]; + for (int g = 0; g < ret_conv_6_len; g++) { + long ret_conv_6 = ret[g]; + org.ldk.structs.Utxo ret_conv_6_hu_conv = null; if (ret_conv_6 < 0 || ret_conv_6 > 4096) { ret_conv_6_hu_conv = new org.ldk.structs.Utxo(null, ret_conv_6); } + if (ret_conv_6_hu_conv != null) { ret_conv_6_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_6_arr[g] = ret_conv_6_hu_conv; + } + return ret_conv_6_arr; + } + + /** + * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction + * requiring additional fees. + */ + public void set_confirmed_utxos(Utxo[] val) { + bindings.CoinSelection_set_confirmed_utxos(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_6 => val_conv_6 == null ? 0 : val_conv_6.ptr) : null); + GC.KeepAlive(this); + GC.KeepAlive(val); + foreach (Utxo val_conv_6 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_6); }; }; + } + + /** + * An additional output tracking whether any change remained after coin selection. This output + * should always have a value above dust for its given `script_pubkey`. It should not be + * spent until the transaction it belongs to confirms to ensure mempool descendant limits are + * not met. This implies no other party should be able to spend it except us. + */ + public Option_TxOutZ get_change_output() { + long ret = bindings.CoinSelection_get_change_output(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxOutZ ret_hu_conv = org.ldk.structs.Option_TxOutZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * An additional output tracking whether any change remained after coin selection. This output + * should always have a value above dust for its given `script_pubkey`. It should not be + * spent until the transaction it belongs to confirms to ensure mempool descendant limits are + * not met. This implies no other party should be able to spend it except us. + */ + public void set_change_output(org.ldk.structs.Option_TxOutZ val) { + bindings.CoinSelection_set_change_output(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new CoinSelection given each field + */ + public static CoinSelection of(Utxo[] confirmed_utxos_arg, org.ldk.structs.Option_TxOutZ change_output_arg) { + long ret = bindings.CoinSelection_new(confirmed_utxos_arg != null ? InternalUtils.mapArray(confirmed_utxos_arg, confirmed_utxos_arg_conv_6 => confirmed_utxos_arg_conv_6 == null ? 0 : confirmed_utxos_arg_conv_6.ptr) : null, change_output_arg.ptr); + GC.KeepAlive(confirmed_utxos_arg); + GC.KeepAlive(change_output_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CoinSelection ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CoinSelection(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (Utxo confirmed_utxos_arg_conv_6 in confirmed_utxos_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmed_utxos_arg_conv_6); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(change_output_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.CoinSelection_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the CoinSelection + */ + public CoinSelection clone() { + long ret = bindings.CoinSelection_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CoinSelection ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CoinSelection(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs b/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs new file mode 100644 index 00000000..8c2c5514 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs @@ -0,0 +1,154 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can + * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC, + * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`], + * which can provide a default implementation of this trait when used with [`Wallet`]. + */ +public class CoinSelectionSource : CommonBase { + internal readonly bindings.LDKCoinSelectionSource bindings_instance; + internal CoinSelectionSource(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private CoinSelectionSource(bindings.LDKCoinSelectionSource arg) : base(bindings.LDKCoinSelectionSource_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~CoinSelectionSource() { + if (ptr != 0) { bindings.CoinSelectionSource_free(ptr); } + } + + public interface CoinSelectionSourceInterface { + /** + * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are + * available to spend. Implementations are free to pick their coin selection algorithm of + * choice, as long as the following requirements are met: + * + * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction + * throughout coin selection, but must not be returned as part of the result. + * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction + * throughout coin selection. In some cases, like when funding an anchor transaction, this + * set is empty. Implementations should ensure they handle this correctly on their end, + * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be + * provided, in which case a zero-value empty OP_RETURN output can be used instead. + * 3. Enough inputs must be selected/contributed for the resulting transaction (including the + * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`. + * + * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of + * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require + * providing the full input weight. Failing to do so may lead to underestimating fee bumps and + * delaying block inclusion. + * + * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they + * can be re-used within new fee-bumped iterations of the original claiming transaction, + * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a + * transaction associated with it, and all of the available UTXOs have already been assigned to + * other claims, implementations must be willing to double spend their UTXOs. The choice of + * which UTXOs to double spend is left to the implementation, but it must strive to keep the + * set of other claims being double spent to a minimum. + */ + Result_CoinSelectionNoneZ select_confirmed_utxos(byte[] _claim_id, Input[] _must_spend, TxOut[] _must_pay_to, int _target_feerate_sat_per_1000_weight); + /** + * Signs and provides the full witness for all inputs within the transaction known to the + * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]). + */ + Result_TransactionNoneZ sign_tx(byte[] _tx); + } + private class LDKCoinSelectionSourceHolder { internal CoinSelectionSource held; } + private class LDKCoinSelectionSourceImpl : bindings.LDKCoinSelectionSource { + internal LDKCoinSelectionSourceImpl(CoinSelectionSourceInterface arg, LDKCoinSelectionSourceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private CoinSelectionSourceInterface arg; + private LDKCoinSelectionSourceHolder impl_holder; + public long select_confirmed_utxos(byte[] _claim_id, long[] _must_spend, long[] _must_pay_to, int _target_feerate_sat_per_1000_weight) { + int _must_spend_conv_7_len = _must_spend.Length; + Input[] _must_spend_conv_7_arr = new Input[_must_spend_conv_7_len]; + for (int h = 0; h < _must_spend_conv_7_len; h++) { + long _must_spend_conv_7 = _must_spend[h]; + org.ldk.structs.Input _must_spend_conv_7_hu_conv = null; if (_must_spend_conv_7 < 0 || _must_spend_conv_7 > 4096) { _must_spend_conv_7_hu_conv = new org.ldk.structs.Input(null, _must_spend_conv_7); } + if (_must_spend_conv_7_hu_conv != null) { _must_spend_conv_7_hu_conv.ptrs_to.AddLast(this); }; + _must_spend_conv_7_arr[h] = _must_spend_conv_7_hu_conv; + } + int _must_pay_to_conv_7_len = _must_pay_to.Length; + TxOut[] _must_pay_to_conv_7_arr = new TxOut[_must_pay_to_conv_7_len]; + for (int h = 0; h < _must_pay_to_conv_7_len; h++) { + long _must_pay_to_conv_7 = _must_pay_to[h]; + TxOut _must_pay_to_conv_7_conv = new TxOut(null, _must_pay_to_conv_7); + _must_pay_to_conv_7_arr[h] = _must_pay_to_conv_7_conv; + } + Result_CoinSelectionNoneZ ret = arg.select_confirmed_utxos(_claim_id, _must_spend_conv_7_arr, _must_pay_to_conv_7_arr, _target_feerate_sat_per_1000_weight); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_tx(byte[] _tx) { + Result_TransactionNoneZ ret = arg.sign_tx(_tx); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + } + public static CoinSelectionSource new_impl(CoinSelectionSourceInterface arg) { + LDKCoinSelectionSourceHolder impl_holder = new LDKCoinSelectionSourceHolder(); + impl_holder.held = new CoinSelectionSource(new LDKCoinSelectionSourceImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are + * available to spend. Implementations are free to pick their coin selection algorithm of + * choice, as long as the following requirements are met: + * + * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction + * throughout coin selection, but must not be returned as part of the result. + * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction + * throughout coin selection. In some cases, like when funding an anchor transaction, this + * set is empty. Implementations should ensure they handle this correctly on their end, + * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be + * provided, in which case a zero-value empty OP_RETURN output can be used instead. + * 3. Enough inputs must be selected/contributed for the resulting transaction (including the + * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`. + * + * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of + * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require + * providing the full input weight. Failing to do so may lead to underestimating fee bumps and + * delaying block inclusion. + * + * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they + * can be re-used within new fee-bumped iterations of the original claiming transaction, + * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a + * transaction associated with it, and all of the available UTXOs have already been assigned to + * other claims, implementations must be willing to double spend their UTXOs. The choice of + * which UTXOs to double spend is left to the implementation, but it must strive to keep the + * set of other claims being double spent to a minimum. + */ + public Result_CoinSelectionNoneZ select_confirmed_utxos(byte[] claim_id, Input[] must_spend, TxOut[] must_pay_to, int target_feerate_sat_per_1000_weight) { + long ret = bindings.CoinSelectionSource_select_confirmed_utxos(this.ptr, InternalUtils.check_arr_len(claim_id, 32), must_spend != null ? InternalUtils.mapArray(must_spend, must_spend_conv_7 => must_spend_conv_7 == null ? 0 : must_spend_conv_7.ptr) : null, must_pay_to != null ? InternalUtils.mapArray(must_pay_to, must_pay_to_conv_7 => must_pay_to_conv_7.ptr) : null, target_feerate_sat_per_1000_weight); + GC.KeepAlive(this); + GC.KeepAlive(claim_id); + GC.KeepAlive(must_spend); + GC.KeepAlive(must_pay_to); + GC.KeepAlive(target_feerate_sat_per_1000_weight); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); + foreach (Input must_spend_conv_7 in must_spend) { if (this != null) { this.ptrs_to.AddLast(must_spend_conv_7); }; }; + return ret_hu_conv; + } + + /** + * Signs and provides the full witness for all inputs within the transaction known to the + * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]). + */ + public Result_TransactionNoneZ sign_tx(byte[] tx) { + long ret = bindings.CoinSelectionSource_sign_tx(this.ptr, tx); + GC.KeepAlive(this); + GC.KeepAlive(tx); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/CommitmentSigned.cs b/c_sharp/src/org/ldk/structs/CommitmentSigned.cs index f76840ef..bb3d72fe 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentSigned.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentSigned.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A commitment_signed message to be sent or received from a peer + * A [`commitment_signed`] message to be sent to or received from a peer. + * + * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed */ public class CommitmentSigned : CommonBase { internal CommitmentSigned(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs b/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs index f96c63f2..58f44e2f 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment + * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment * transaction updates if they were pending. */ public class CommitmentUpdate : CommonBase { @@ -17,7 +17,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_add_htlc messages which should be sent + * `update_add_htlc` messages which should be sent */ public UpdateAddHTLC[] get_update_add_htlcs() { long[] ret = bindings.CommitmentUpdate_get_update_add_htlcs(this.ptr); @@ -34,7 +34,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_add_htlc messages which should be sent + * `update_add_htlc` messages which should be sent */ public void set_update_add_htlcs(UpdateAddHTLC[] val) { bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_15 => val_conv_15 == null ? 0 : val_conv_15.ptr) : null); @@ -44,7 +44,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_fulfill_htlc messages which should be sent + * `update_fulfill_htlc` messages which should be sent */ public UpdateFulfillHTLC[] get_update_fulfill_htlcs() { long[] ret = bindings.CommitmentUpdate_get_update_fulfill_htlcs(this.ptr); @@ -61,7 +61,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_fulfill_htlc messages which should be sent + * `update_fulfill_htlc` messages which should be sent */ public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) { bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_19 => val_conv_19 == null ? 0 : val_conv_19.ptr) : null); @@ -71,7 +71,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_fail_htlc messages which should be sent + * `update_fail_htlc` messages which should be sent */ public UpdateFailHTLC[] get_update_fail_htlcs() { long[] ret = bindings.CommitmentUpdate_get_update_fail_htlcs(this.ptr); @@ -88,7 +88,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_fail_htlc messages which should be sent + * `update_fail_htlc` messages which should be sent */ public void set_update_fail_htlcs(UpdateFailHTLC[] val) { bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_16 => val_conv_16 == null ? 0 : val_conv_16.ptr) : null); @@ -98,7 +98,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_fail_malformed_htlc messages which should be sent + * `update_fail_malformed_htlc` messages which should be sent */ public UpdateFailMalformedHTLC[] get_update_fail_malformed_htlcs() { long[] ret = bindings.CommitmentUpdate_get_update_fail_malformed_htlcs(this.ptr); @@ -115,7 +115,7 @@ public class CommitmentUpdate : CommonBase { } /** - * update_fail_malformed_htlc messages which should be sent + * `update_fail_malformed_htlc` messages which should be sent */ public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) { bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_25 => val_conv_25 == null ? 0 : val_conv_25.ptr) : null); @@ -125,7 +125,7 @@ public class CommitmentUpdate : CommonBase { } /** - * An update_fee message which should be sent + * An `update_fee` message which should be sent * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -139,7 +139,7 @@ public class CommitmentUpdate : CommonBase { } /** - * An update_fee message which should be sent + * An `update_fee` message which should be sent * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -151,7 +151,7 @@ public class CommitmentUpdate : CommonBase { } /** - * Finally, the commitment_signed message which should be sent + * A `commitment_signed` message which should be sent */ public CommitmentSigned get_commitment_signed() { long ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr); @@ -163,7 +163,7 @@ public class CommitmentUpdate : CommonBase { } /** - * Finally, the commitment_signed message which should be sent + * A `commitment_signed` message which should be sent */ public void set_commitment_signed(org.ldk.structs.CommitmentSigned val) { bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : val.ptr); diff --git a/c_sharp/src/org/ldk/structs/Confirm.cs b/c_sharp/src/org/ldk/structs/Confirm.cs index 6a5419e1..767eea91 100644 --- a/c_sharp/src/org/ldk/structs/Confirm.cs +++ b/c_sharp/src/org/ldk/structs/Confirm.cs @@ -94,6 +94,9 @@ public class Confirm : CommonBase { * Returns transactions that must be monitored for reorganization out of the chain along * with the hash of the block as part of which it had been previously confirmed. * + * Note that the returned `Option` might be `None` for channels created with LDK + * 0.0.112 and prior, in which case you need to manually track previous confirmations. + * * Will include any transactions passed to [`transactions_confirmed`] that have insufficient * confirmations to be safe from a chain reorganization. Will not include any transactions * passed to [`transaction_unconfirmed`], unless later reconfirmed. @@ -110,7 +113,7 @@ public class Confirm : CommonBase { * [`transactions_confirmed`]: Self::transactions_confirmed * [`transaction_unconfirmed`]: Self::transaction_unconfirmed */ - TwoTuple_TxidBlockHashZ[] get_relevant_txids(); + TwoTuple_TxidCOption_BlockHashZZ[] get_relevant_txids(); } private class LDKConfirmHolder { internal Confirm held; } private class LDKConfirmImpl : bindings.LDKConfirm { @@ -138,9 +141,9 @@ public class Confirm : CommonBase { GC.KeepAlive(arg); } public long[] get_relevant_txids() { - TwoTuple_TxidBlockHashZ[] ret = arg.get_relevant_txids(); + TwoTuple_TxidCOption_BlockHashZZ[] ret = arg.get_relevant_txids(); GC.KeepAlive(arg); - long[] result = ret != null ? InternalUtils.mapArray(ret, ret_conv_25 => ret_conv_25 == null ? 0 : ret_conv_25.clone_ptr()) : null; + long[] result = ret != null ? InternalUtils.mapArray(ret, ret_conv_34 => ret_conv_34 == null ? 0 : ret_conv_34.clone_ptr()) : null; return result; } } @@ -206,6 +209,9 @@ public class Confirm : CommonBase { * Returns transactions that must be monitored for reorganization out of the chain along * with the hash of the block as part of which it had been previously confirmed. * + * Note that the returned `Option` might be `None` for channels created with LDK + * 0.0.112 and prior, in which case you need to manually track previous confirmations. + * * Will include any transactions passed to [`transactions_confirmed`] that have insufficient * confirmations to be safe from a chain reorganization. Will not include any transactions * passed to [`transaction_unconfirmed`], unless later reconfirmed. @@ -222,18 +228,18 @@ public class Confirm : CommonBase { * [`transactions_confirmed`]: Self::transactions_confirmed * [`transaction_unconfirmed`]: Self::transaction_unconfirmed */ - public TwoTuple_TxidBlockHashZ[] get_relevant_txids() { + public TwoTuple_TxidCOption_BlockHashZZ[] get_relevant_txids() { long[] ret = bindings.Confirm_get_relevant_txids(this.ptr); GC.KeepAlive(this); - int ret_conv_25_len = ret.Length; - TwoTuple_TxidBlockHashZ[] ret_conv_25_arr = new TwoTuple_TxidBlockHashZ[ret_conv_25_len]; - for (int z = 0; z < ret_conv_25_len; z++) { - long ret_conv_25 = ret[z]; - TwoTuple_TxidBlockHashZ ret_conv_25_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret_conv_25); - if (ret_conv_25_hu_conv != null) { ret_conv_25_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_25_arr[z] = ret_conv_25_hu_conv; + int ret_conv_34_len = ret.Length; + TwoTuple_TxidCOption_BlockHashZZ[] ret_conv_34_arr = new TwoTuple_TxidCOption_BlockHashZZ[ret_conv_34_len]; + for (int i = 0; i < ret_conv_34_len; i++) { + long ret_conv_34 = ret[i]; + TwoTuple_TxidCOption_BlockHashZZ ret_conv_34_hu_conv = new TwoTuple_TxidCOption_BlockHashZZ(null, ret_conv_34); + if (ret_conv_34_hu_conv != null) { ret_conv_34_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_34_arr[i] = ret_conv_34_hu_conv; } - return ret_conv_25_arr; + return ret_conv_34_arr; } } diff --git a/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs b/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs index 213d7913..4b00e214 100644 --- a/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs +++ b/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs @@ -87,6 +87,23 @@ public class CounterpartyChannelTransactionParameters : CommonBase { return ret_hu_conv; } + /** + * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.CounterpartyChannelTransactionParameters b) { + bool ret = bindings.CounterpartyChannelTransactionParameters_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is CounterpartyChannelTransactionParameters)) return false; + return this.eq((CounterpartyChannelTransactionParameters)o); + } /** * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read */ diff --git a/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs b/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs index 7a774c68..32d39c27 100644 --- a/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs @@ -6,7 +6,14 @@ using System; namespace org { namespace ldk { namespace structs { /** - * Handler for BOLT1-compliant messages. + * A handler provided to [`PeerManager`] for reading and handling custom messages. + * + * [BOLT 1] specifies a custom message type range for use with experimental or application-specific + * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the + * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler. + * + * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md + * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message */ public class CustomMessageHandler : CommonBase { internal readonly bindings.LDKCustomMessageHandler bindings_instance; @@ -22,17 +29,33 @@ public class CustomMessageHandler : CommonBase { public interface CustomMessageHandlerInterface { /** - * Called with the message type that was received and the buffer to be read. - * Can return a `MessageHandlingError` if the message could not be handled. + * Handles the given message sent from `sender_node_id`, possibly producing messages for + * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`] + * to send. */ Result_NoneLightningErrorZ handle_custom_message(Type _msg, byte[] _sender_node_id); /** - * Gets the list of pending messages which were generated by the custom message - * handler, clearing the list in the process. The first tuple element must - * correspond to the intended recipients node ids. If no connection to one of the - * specified node does not exist, the message is simply not sent to it. + * Returns the list of pending messages that were generated by the handler, clearing the list + * in the process. Each message is paired with the node id of the intended recipient. If no + * connection to the node exists, then the message is simply not sent. */ TwoTuple_PublicKeyTypeZ[] get_and_clear_pending_msg(); + /** + * Gets the node feature flags which this handler itself supports. All available handlers are + * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] + * which are broadcasted in our [`NodeAnnouncement`] message. + * + * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement + */ + NodeFeatures provided_node_features(); + /** + * Gets the init feature flags which should be sent to the given peer. All available handlers + * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`] + * which are sent in our [`Init`] message. + * + * [`Init`]: crate::ln::msgs::Init + */ + InitFeatures provided_init_features(byte[] _their_node_id); } private class LDKCustomMessageHandlerHolder { internal CustomMessageHandler held; } private class LDKCustomMessageHandlerImpl : bindings.LDKCustomMessageHandler { @@ -53,6 +76,18 @@ public class CustomMessageHandler : CommonBase { long[] result = ret != null ? InternalUtils.mapArray(ret, ret_conv_25 => ret_conv_25 == null ? 0 : ret_conv_25.clone_ptr()) : null; return result; } + public long provided_node_features() { + NodeFeatures ret = arg.provided_node_features(); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long provided_init_features(byte[] _their_node_id) { + InitFeatures ret = arg.provided_init_features(_their_node_id); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } } public static CustomMessageHandler new_impl(CustomMessageHandlerInterface arg, CustomMessageReader.CustomMessageReaderInterface CustomMessageReader_impl) { LDKCustomMessageHandlerHolder impl_holder = new LDKCustomMessageHandlerHolder(); @@ -70,11 +105,12 @@ public class CustomMessageHandler : CommonBase { } /** - * Called with the message type that was received and the buffer to be read. - * Can return a `MessageHandlingError` if the message could not be handled. + * Handles the given message sent from `sender_node_id`, possibly producing messages for + * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`] + * to send. */ public Result_NoneLightningErrorZ handle_custom_message(org.ldk.structs.Type msg, byte[] sender_node_id) { - long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33)); + long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33)); GC.KeepAlive(this); GC.KeepAlive(msg); GC.KeepAlive(sender_node_id); @@ -85,10 +121,9 @@ public class CustomMessageHandler : CommonBase { } /** - * Gets the list of pending messages which were generated by the custom message - * handler, clearing the list in the process. The first tuple element must - * correspond to the intended recipients node ids. If no connection to one of the - * specified node does not exist, the message is simply not sent to it. + * Returns the list of pending messages that were generated by the handler, clearing the list + * in the process. Each message is paired with the node id of the intended recipient. If no + * connection to the node exists, then the message is simply not sent. */ public TwoTuple_PublicKeyTypeZ[] get_and_clear_pending_msg() { long[] ret = bindings.CustomMessageHandler_get_and_clear_pending_msg(this.ptr); @@ -104,5 +139,38 @@ public class CustomMessageHandler : CommonBase { return ret_conv_25_arr; } + /** + * Gets the node feature flags which this handler itself supports. All available handlers are + * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] + * which are broadcasted in our [`NodeAnnouncement`] message. + * + * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement + */ + public NodeFeatures provided_node_features() { + long ret = bindings.CustomMessageHandler_provided_node_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Gets the init feature flags which should be sent to the given peer. All available handlers + * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`] + * which are sent in our [`Init`] message. + * + * [`Init`]: crate::ln::msgs::Init + */ + public InitFeatures provided_init_features(byte[] their_node_id) { + long ret = bindings.CustomMessageHandler_provided_init_features(this.ptr, InternalUtils.check_arr_len(their_node_id, 33)); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs b/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs index d3b989ff..86e23eec 100644 --- a/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs @@ -30,9 +30,9 @@ public class CustomOnionMessageHandler : CommonBase { public interface CustomOnionMessageHandlerInterface { /** - * Called with the custom message that was received. + * Called with the custom message that was received, returning a response to send, if any. */ - void handle_custom_message(CustomOnionMessageContents _msg); + Option_CustomOnionMessageContentsZ handle_custom_message(CustomOnionMessageContents _msg); /** * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the * message type is unknown. @@ -44,11 +44,14 @@ public class CustomOnionMessageHandler : CommonBase { internal LDKCustomOnionMessageHandlerImpl(CustomOnionMessageHandlerInterface arg, LDKCustomOnionMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private CustomOnionMessageHandlerInterface arg; private LDKCustomOnionMessageHandlerHolder impl_holder; - public void handle_custom_message(long _msg) { + public long handle_custom_message(long _msg) { CustomOnionMessageContents ret_hu_conv = new CustomOnionMessageContents(null, _msg); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - arg.handle_custom_message(ret_hu_conv); + Option_CustomOnionMessageContentsZ ret = arg.handle_custom_message(ret_hu_conv); GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; + return result; } public long read_custom_message(long _message_type, byte[] _buffer) { Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret = arg.read_custom_message(_message_type, _buffer); @@ -63,13 +66,17 @@ public class CustomOnionMessageHandler : CommonBase { return impl_holder.held; } /** - * Called with the custom message that was received. + * Called with the custom message that was received, returning a response to send, if any. */ - public void handle_custom_message(org.ldk.structs.CustomOnionMessageContents msg) { - bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr); + public Option_CustomOnionMessageContentsZ handle_custom_message(org.ldk.structs.CustomOnionMessageContents msg) { + long ret = bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CustomOnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; if (this != null) { this.ptrs_to.AddLast(msg); }; + return ret_hu_conv; } /** diff --git a/c_sharp/src/org/ldk/structs/DataLossProtect.cs b/c_sharp/src/org/ldk/structs/DataLossProtect.cs deleted file mode 100644 index c8a2ac1c..00000000 --- a/c_sharp/src/org/ldk/structs/DataLossProtect.cs +++ /dev/null @@ -1,108 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Proof that the sender knows the per-commitment secret of the previous commitment transaction. - * This is used to convince the recipient that the channel is at a certain commitment - * number even if they lost that data due to a local failure. Of course, the peer may lie - * and even later commitments may have been revoked. - */ -public class DataLossProtect : CommonBase { - internal DataLossProtect(object _dummy, long ptr) : base(ptr) { } - ~DataLossProtect() { - if (ptr != 0) { bindings.DataLossProtect_free(ptr); } - } - - /** - * Proof that the sender knows the per-commitment secret of a specific commitment transaction - * belonging to the recipient - */ - public byte[] get_your_last_per_commitment_secret() { - byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Proof that the sender knows the per-commitment secret of a specific commitment transaction - * belonging to the recipient - */ - public void set_your_last_per_commitment_secret(byte[] val) { - bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The sender's per-commitment point for their current commitment transaction - */ - public byte[] get_my_current_per_commitment_point() { - byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The sender's per-commitment point for their current commitment transaction - */ - public void set_my_current_per_commitment_point(byte[] val) { - bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Constructs a new DataLossProtect given each field - */ - public static DataLossProtect of(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) { - long ret = bindings.DataLossProtect_new(InternalUtils.check_arr_len(your_last_per_commitment_secret_arg, 32), InternalUtils.check_arr_len(my_current_per_commitment_point_arg, 33)); - GC.KeepAlive(your_last_per_commitment_secret_arg); - GC.KeepAlive(my_current_per_commitment_point_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DataLossProtect(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.DataLossProtect_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the DataLossProtect - */ - public DataLossProtect clone() { - long ret = bindings.DataLossProtect_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DataLossProtect(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Checks if two DataLossProtects contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public bool eq(org.ldk.structs.DataLossProtect b) { - bool ret = bindings.DataLossProtect_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - if (this != null) { this.ptrs_to.AddLast(b); }; - return ret; - } - - public override bool Equals(object o) { - if (!(o is DataLossProtect)) return false; - return this.eq((DataLossProtect)o); - } -} -} } } diff --git a/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs b/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs new file mode 100644 index 00000000..6489199d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs @@ -0,0 +1,43 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A [`MessageRouter`] that always fails. + */ +public class DefaultMessageRouter : CommonBase { + internal DefaultMessageRouter(object _dummy, long ptr) : base(ptr) { } + ~DefaultMessageRouter() { + if (ptr != 0) { bindings.DefaultMessageRouter_free(ptr); } + } + + /** + * Constructs a new DefaultMessageRouter given each field + */ + public static DefaultMessageRouter of() { + long ret = bindings.DefaultMessageRouter_new(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DefaultMessageRouter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DefaultMessageRouter(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new MessageRouter which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is + */ + public MessageRouter as_MessageRouter() { + long ret = bindings.DefaultMessageRouter_as_MessageRouter(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + MessageRouter ret_hu_conv = new MessageRouter(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/DefaultRouter.cs b/c_sharp/src/org/ldk/structs/DefaultRouter.cs index a47b498b..8235e7b3 100644 --- a/c_sharp/src/org/ldk/structs/DefaultRouter.cs +++ b/c_sharp/src/org/ldk/structs/DefaultRouter.cs @@ -18,18 +18,20 @@ public class DefaultRouter : CommonBase { /** * Creates a new router. */ - public static DefaultRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes, org.ldk.structs.LockableScore scorer) { - long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32), scorer == null ? 0 : scorer.ptr); + public static DefaultRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes, org.ldk.structs.LockableScore scorer, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) { + long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32), scorer.ptr, score_params == null ? 0 : score_params.ptr); GC.KeepAlive(network_graph); GC.KeepAlive(logger); GC.KeepAlive(random_seed_bytes); GC.KeepAlive(scorer); + GC.KeepAlive(score_params); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.DefaultRouter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DefaultRouter(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score_params); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs index be39ee38..2fa6015e 100644 --- a/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs @@ -79,8 +79,6 @@ public class DelayedPaymentOutputDescriptor : CommonBase { /** * The output which is referenced by the given outpoint. - * - * Returns a copy of the field. */ public TxOut get_output() { long ret = bindings.DelayedPaymentOutputDescriptor_get_output(this.ptr); @@ -120,7 +118,7 @@ public class DelayedPaymentOutputDescriptor : CommonBase { } /** - * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`]. * This may be useful in re-deriving keys used in the channel to spend the output. */ public byte[] get_channel_keys_id() { @@ -130,7 +128,7 @@ public class DelayedPaymentOutputDescriptor : CommonBase { } /** - * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`]. * This may be useful in re-deriving keys used in the channel to spend the output. */ public void set_channel_keys_id(byte[] val) { diff --git a/c_sharp/src/org/ldk/structs/Description.cs b/c_sharp/src/org/ldk/structs/Description.cs index 0a7a450d..46b03515 100644 --- a/c_sharp/src/org/ldk/structs/Description.cs +++ b/c_sharp/src/org/ldk/structs/Description.cs @@ -37,7 +37,7 @@ public class Description : CommonBase { } /** - * Checks if two Descriptions contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the Description. */ public long hash() { long ret = bindings.Description_hash(this.ptr); @@ -67,7 +67,7 @@ public class Description : CommonBase { } /** * Creates a new `Description` if `description` is at most 1023 __bytes__ long, - * returns `CreationError::DescriptionTooLong` otherwise + * returns [`CreationError::DescriptionTooLong`] otherwise * * Please note that single characters may use more than one byte due to UTF8 encoding. */ @@ -80,7 +80,7 @@ public class Description : CommonBase { } /** - * Returns the underlying description `String` + * Returns the underlying description [`String`] */ public string into_inner() { string ret = bindings.Description_into_inner(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/DirectedChannelTransactionParameters.cs b/c_sharp/src/org/ldk/structs/DirectedChannelTransactionParameters.cs index aaf9c17a..7caa6c36 100644 --- a/c_sharp/src/org/ldk/structs/DirectedChannelTransactionParameters.cs +++ b/c_sharp/src/org/ldk/structs/DirectedChannelTransactionParameters.cs @@ -80,10 +80,13 @@ public class DirectedChannelTransactionParameters : CommonBase { /** * Whether to use anchors for this channel */ - public bool opt_anchors() { - bool ret = bindings.DirectedChannelTransactionParameters_opt_anchors(this.ptr); + public ChannelTypeFeatures channel_type_features() { + long ret = bindings.DirectedChannelTransactionParameters_channel_type_features(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } } diff --git a/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs b/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs new file mode 100644 index 00000000..e5c55b51 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs @@ -0,0 +1,489 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A trait to sign Lightning channel transactions as described in + * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md). + * + * Signing services could be implemented on a hardware wallet and should implement signing + * policies in order to be secure. Please refer to the [VLS Policy + * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md) + * for an example of such policies. + */ +public class EcdsaChannelSigner : CommonBase { + internal readonly bindings.LDKEcdsaChannelSigner bindings_instance; + internal EcdsaChannelSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private EcdsaChannelSigner(bindings.LDKEcdsaChannelSigner arg, bindings.LDKChannelSigner ChannelSigner, ChannelPublicKeys pubkeys) : base(bindings.LDKEcdsaChannelSigner_new(arg, ChannelSigner, pubkeys == null ? 0 : pubkeys.clone_ptr())) { + this.ptrs_to.AddLast(arg); + this.ptrs_to.AddLast(ChannelSigner); + this.bindings_instance = arg; + } + ~EcdsaChannelSigner() { + if (ptr != 0) { bindings.EcdsaChannelSigner_free(ptr); } + } + + public interface EcdsaChannelSignerInterface { + /** + * 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 outgoing HTLCs that were fulfilled since the last commitment are provided. + * A validating signer should ensure that an HTLC output is removed only when the matching + * preimage is provided, or when the value to holder is restored. + * + * Note that all the relevant preimages will be provided, but there may also be additional + * irrelevant or duplicate preimages. + */ + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction _commitment_tx, byte[][] _preimages); + /** + * Validate the counterparty's revocation. + * + * This is required in order for the signer to make sure that the state has moved + * forward and it is safe to sign the next counterparty commitment. + */ + Result_NoneNoneZ validate_counterparty_revocation(long _idx, byte[] _secret); + /** + * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions. + * + * This will be called + * - with a non-revoked `commitment_tx`. + * - with the latest `commitment_tx` when we initiate a force-close. + * - with the previous `commitment_tx`, just to get claiming HTLC + * signatures, if we are reacting to a [`ChannelMonitor`] + * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) + * that decided to broadcast before it had been updated to the latest `commitment_tx`. + * + * This may be called multiple times for the same transaction. + * + * An external signer implementation should check that the commitment has not been revoked. + * + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + */ + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction _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). + */ + Result_SignatureNoneZ sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key); + /** + * 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). + */ + Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, HTLCOutputInCommitment _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 should only be used to + * sign HTLC transactions from channels supporting anchor outputs after all additional + * inputs/outputs have been added to the transaction. + * + * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All + */ + Result_SignatureNoneZ sign_holder_htlc_transaction(byte[] _htlc_tx, long _input, HTLCDescriptor _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. + */ + Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, HTLCOutputInCommitment _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. + */ + Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction _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`. + */ + Result_SignatureNoneZ sign_holder_anchor_input(byte[] _anchor_tx, long _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. + */ + Result_SignatureNoneZ sign_channel_announcement_with_funding_key(UnsignedChannelAnnouncement _msg); + } + private class LDKEcdsaChannelSignerHolder { internal EcdsaChannelSigner held; } + private class LDKEcdsaChannelSignerImpl : bindings.LDKEcdsaChannelSigner { + internal LDKEcdsaChannelSignerImpl(EcdsaChannelSignerInterface arg, LDKEcdsaChannelSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private EcdsaChannelSignerInterface arg; + private LDKEcdsaChannelSignerHolder impl_holder; + public long sign_counterparty_commitment(long _commitment_tx, byte[][] _preimages) { + org.ldk.structs.CommitmentTransaction _commitment_tx_hu_conv = null; if (_commitment_tx < 0 || _commitment_tx > 4096) { _commitment_tx_hu_conv = new org.ldk.structs.CommitmentTransaction(null, _commitment_tx); } + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(_commitment_tx_hu_conv, _preimages); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long validate_counterparty_revocation(long _idx, byte[] _secret) { + Result_NoneNoneZ ret = arg.validate_counterparty_revocation(_idx, _secret); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_holder_commitment_and_htlcs(long _commitment_tx) { + org.ldk.structs.HolderCommitmentTransaction _commitment_tx_hu_conv = null; if (_commitment_tx < 0 || _commitment_tx > 4096) { _commitment_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, _commitment_tx); } + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(_commitment_tx_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key) { + Result_SignatureNoneZ ret = arg.sign_justice_revoked_output(_justice_tx, _input, _amount, _per_commitment_key); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, long _htlc) { + org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); } + Result_SignatureNoneZ ret = arg.sign_justice_revoked_htlc(_justice_tx, _input, _amount, _per_commitment_key, _htlc_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_holder_htlc_transaction(byte[] _htlc_tx, long _input, long _htlc_descriptor) { + org.ldk.structs.HTLCDescriptor _htlc_descriptor_hu_conv = null; if (_htlc_descriptor < 0 || _htlc_descriptor > 4096) { _htlc_descriptor_hu_conv = new org.ldk.structs.HTLCDescriptor(null, _htlc_descriptor); } + Result_SignatureNoneZ ret = arg.sign_holder_htlc_transaction(_htlc_tx, _input, _htlc_descriptor_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, long _htlc) { + org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); } + Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(_htlc_tx, _input, _amount, _per_commitment_point, _htlc_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_closing_transaction(long _closing_tx) { + org.ldk.structs.ClosingTransaction _closing_tx_hu_conv = null; if (_closing_tx < 0 || _closing_tx > 4096) { _closing_tx_hu_conv = new org.ldk.structs.ClosingTransaction(null, _closing_tx); } + Result_SignatureNoneZ ret = arg.sign_closing_transaction(_closing_tx_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_holder_anchor_input(byte[] _anchor_tx, long _input) { + Result_SignatureNoneZ ret = arg.sign_holder_anchor_input(_anchor_tx, _input); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_channel_announcement_with_funding_key(long _msg) { + org.ldk.structs.UnsignedChannelAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, _msg); } + Result_SignatureNoneZ ret = arg.sign_channel_announcement_with_funding_key(_msg_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + } + public static EcdsaChannelSigner new_impl(EcdsaChannelSignerInterface arg, ChannelSigner.ChannelSignerInterface ChannelSigner_impl, ChannelPublicKeys pubkeys) { + LDKEcdsaChannelSignerHolder impl_holder = new LDKEcdsaChannelSignerHolder(); + impl_holder.held = new EcdsaChannelSigner(new LDKEcdsaChannelSignerImpl(arg, impl_holder), ChannelSigner.new_impl(ChannelSigner_impl, pubkeys).bindings_instance, pubkeys); + return impl_holder.held; + } + + /** + * Gets the underlying ChannelSigner. + */ + public ChannelSigner get_channel_signer() { + ChannelSigner res = new ChannelSigner(null, bindings.LDKEcdsaChannelSigner_get_ChannelSigner(this.ptr)); + this.ptrs_to.AddLast(res); + return res; + } + + /** + * 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 outgoing HTLCs that were fulfilled since the last commitment are provided. + * A validating signer should ensure that an HTLC output is removed only when the matching + * preimage is provided, or when the value to holder is restored. + * + * Note that all the relevant preimages will be provided, but there may also be additional + * irrelevant or duplicate preimages. + */ + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] preimages) { + long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr, preimages != null ? InternalUtils.mapArray(preimages, preimages_conv_8 => InternalUtils.check_arr_len(preimages_conv_8, 32)) : null); + GC.KeepAlive(this); + GC.KeepAlive(commitment_tx); + GC.KeepAlive(preimages); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(commitment_tx); }; + return ret_hu_conv; + } + + /** + * Validate the counterparty's revocation. + * + * This is required in order for the signer to make sure that the state has moved + * forward and it is safe to sign the next counterparty commitment. + */ + public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) { + long ret = bindings.EcdsaChannelSigner_validate_counterparty_revocation(this.ptr, idx, InternalUtils.check_arr_len(secret, 32)); + GC.KeepAlive(this); + GC.KeepAlive(idx); + GC.KeepAlive(secret); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions. + * + * This will be called + * - with a non-revoked `commitment_tx`. + * - with the latest `commitment_tx` when we initiate a force-close. + * - with the previous `commitment_tx`, just to get claiming HTLC + * signatures, if we are reacting to a [`ChannelMonitor`] + * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) + * that decided to broadcast before it had been updated to the latest `commitment_tx`. + * + * This may be called multiple times for the same transaction. + * + * An external signer implementation should check that the commitment has not been revoked. + * + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + */ + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(org.ldk.structs.HolderCommitmentTransaction commitment_tx) { + long ret = bindings.EcdsaChannelSigner_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr); + GC.KeepAlive(this); + GC.KeepAlive(commitment_tx); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(commitment_tx); }; + return ret_hu_conv; + } + + /** + * 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). + */ + public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) { + long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32)); + GC.KeepAlive(this); + GC.KeepAlive(justice_tx); + GC.KeepAlive(input); + GC.KeepAlive(amount); + GC.KeepAlive(per_commitment_key); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * 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). + */ + public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, org.ldk.structs.HTLCOutputInCommitment htlc) { + long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc == null ? 0 : htlc.ptr); + GC.KeepAlive(this); + GC.KeepAlive(justice_tx); + GC.KeepAlive(input); + GC.KeepAlive(amount); + GC.KeepAlive(per_commitment_key); + GC.KeepAlive(htlc); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(htlc); }; + return ret_hu_conv; + } + + /** + * 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 should only be used to + * sign HTLC transactions from channels supporting anchor outputs after all additional + * inputs/outputs have been added to the transaction. + * + * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All + */ + public Result_SignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, org.ldk.structs.HTLCDescriptor htlc_descriptor) { + long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, htlc_tx, input, htlc_descriptor == null ? 0 : htlc_descriptor.ptr); + GC.KeepAlive(this); + GC.KeepAlive(htlc_tx); + GC.KeepAlive(input); + GC.KeepAlive(htlc_descriptor); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(htlc_descriptor); }; + return ret_hu_conv; + } + + /** + * 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. + */ + public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) { + long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr); + GC.KeepAlive(this); + GC.KeepAlive(htlc_tx); + GC.KeepAlive(input); + GC.KeepAlive(amount); + GC.KeepAlive(per_commitment_point); + GC.KeepAlive(htlc); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(htlc); }; + return ret_hu_conv; + } + + /** + * 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. + */ + public Result_SignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) { + long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr); + GC.KeepAlive(this); + GC.KeepAlive(closing_tx); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(closing_tx); }; + return ret_hu_conv; + } + + /** + * 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`. + */ + public Result_SignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) { + long ret = bindings.EcdsaChannelSigner_sign_holder_anchor_input(this.ptr, anchor_tx, input); + GC.KeepAlive(this); + GC.KeepAlive(anchor_tx); + GC.KeepAlive(input); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * 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. + */ + public Result_SignatureNoneZ sign_channel_announcement_with_funding_key(org.ldk.structs.UnsignedChannelAnnouncement msg) { + long ret = bindings.EcdsaChannelSigner_sign_channel_announcement_with_funding_key(this.ptr, msg == null ? 0 : msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/EffectiveCapacity.cs b/c_sharp/src/org/ldk/structs/EffectiveCapacity.cs index c7aa0e4f..ebf27555 100644 --- a/c_sharp/src/org/ldk/structs/EffectiveCapacity.cs +++ b/c_sharp/src/org/ldk/structs/EffectiveCapacity.cs @@ -21,10 +21,11 @@ public class EffectiveCapacity : CommonBase { long raw_ty = bindings.LDKEffectiveCapacity_ty_from_ptr(ptr); switch (raw_ty) { case 0: return new EffectiveCapacity_ExactLiquidity(ptr); - case 1: return new EffectiveCapacity_MaximumHTLC(ptr); + case 1: return new EffectiveCapacity_AdvertisedMaxHTLC(ptr); case 2: return new EffectiveCapacity_Total(ptr); case 3: return new EffectiveCapacity_Infinite(ptr); - case 4: return new EffectiveCapacity_Unknown(ptr); + case 4: return new EffectiveCapacity_HintMaxHTLC(ptr); + case 5: return new EffectiveCapacity_Unknown(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -41,14 +42,14 @@ public class EffectiveCapacity : CommonBase { this.liquidity_msat = bindings.LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(ptr); } } - /** A EffectiveCapacity of type MaximumHTLC */ - public class EffectiveCapacity_MaximumHTLC : EffectiveCapacity { + /** A EffectiveCapacity of type AdvertisedMaxHTLC */ + public class EffectiveCapacity_AdvertisedMaxHTLC : EffectiveCapacity { /** * The maximum HTLC amount denominated in millisatoshi. */ public long amount_msat; - internal EffectiveCapacity_MaximumHTLC(long ptr) : base(null, ptr) { - this.amount_msat = bindings.LDKEffectiveCapacity_MaximumHTLC_get_amount_msat(ptr); + internal EffectiveCapacity_AdvertisedMaxHTLC(long ptr) : base(null, ptr) { + this.amount_msat = bindings.LDKEffectiveCapacity_AdvertisedMaxHTLC_get_amount_msat(ptr); } } /** A EffectiveCapacity of type Total */ @@ -71,6 +72,16 @@ public class EffectiveCapacity : CommonBase { internal EffectiveCapacity_Infinite(long ptr) : base(null, ptr) { } } + /** A EffectiveCapacity of type HintMaxHTLC */ + public class EffectiveCapacity_HintMaxHTLC : EffectiveCapacity { + /** + * The maximum HTLC amount denominated in millisatoshi. + */ + public long amount_msat; + internal EffectiveCapacity_HintMaxHTLC(long ptr) : base(null, ptr) { + this.amount_msat = bindings.LDKEffectiveCapacity_HintMaxHTLC_get_amount_msat(ptr); + } + } /** A EffectiveCapacity of type Unknown */ public class EffectiveCapacity_Unknown : EffectiveCapacity { internal EffectiveCapacity_Unknown(long ptr) : base(null, ptr) { @@ -107,10 +118,10 @@ public class EffectiveCapacity : CommonBase { } /** - * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity + * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity */ - public static EffectiveCapacity maximum_htlc(long amount_msat) { - long ret = bindings.EffectiveCapacity_maximum_htlc(amount_msat); + public static EffectiveCapacity advertised_max_htlc(long amount_msat) { + long ret = bindings.EffectiveCapacity_advertised_max_htlc(amount_msat); GC.KeepAlive(amount_msat); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret); @@ -142,6 +153,18 @@ public class EffectiveCapacity : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity + */ + public static EffectiveCapacity hint_max_htlc(long amount_msat) { + long ret = bindings.EffectiveCapacity_hint_max_htlc(amount_msat); + GC.KeepAlive(amount_msat); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new Unknown-variant EffectiveCapacity */ diff --git a/c_sharp/src/org/ldk/structs/EntropySource.cs b/c_sharp/src/org/ldk/structs/EntropySource.cs new file mode 100644 index 00000000..5a9cecf5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/EntropySource.cs @@ -0,0 +1,57 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A trait that describes a source of entropy. + */ +public class EntropySource : CommonBase { + internal readonly bindings.LDKEntropySource bindings_instance; + internal EntropySource(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private EntropySource(bindings.LDKEntropySource arg) : base(bindings.LDKEntropySource_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~EntropySource() { + if (ptr != 0) { bindings.EntropySource_free(ptr); } + } + + public interface EntropySourceInterface { + /** + * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a + * different value each time it is called. + */ + byte[] get_secure_random_bytes(); + } + private class LDKEntropySourceHolder { internal EntropySource held; } + private class LDKEntropySourceImpl : bindings.LDKEntropySource { + internal LDKEntropySourceImpl(EntropySourceInterface arg, LDKEntropySourceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private EntropySourceInterface arg; + private LDKEntropySourceHolder impl_holder; + public byte[] get_secure_random_bytes() { + byte[] ret = arg.get_secure_random_bytes(); + GC.KeepAlive(arg); + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; + } + } + public static EntropySource new_impl(EntropySourceInterface arg) { + LDKEntropySourceHolder impl_holder = new LDKEntropySourceHolder(); + impl_holder.held = new EntropySource(new LDKEntropySourceImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a + * different value each time it is called. + */ + public byte[] get_secure_random_bytes() { + byte[] ret = bindings.EntropySource_get_secure_random_bytes(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ErroneousField.cs b/c_sharp/src/org/ldk/structs/ErroneousField.cs new file mode 100644 index 00000000..1d70fe1f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ErroneousField.cs @@ -0,0 +1,96 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ +public class ErroneousField : CommonBase { + internal ErroneousField(object _dummy, long ptr) : base(ptr) { } + ~ErroneousField() { + if (ptr != 0) { bindings.ErroneousField_free(ptr); } + } + + /** + * The type number of the TLV field containing the error. + */ + public long get_tlv_fieldnum() { + long ret = bindings.ErroneousField_get_tlv_fieldnum(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The type number of the TLV field containing the error. + */ + public void set_tlv_fieldnum(long val) { + bindings.ErroneousField_set_tlv_fieldnum(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A value to use for the TLV field to avoid the error. + * + * Returns a copy of the field. + */ + public Option_CVec_u8ZZ get_suggested_value() { + long ret = bindings.ErroneousField_get_suggested_value(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A value to use for the TLV field to avoid the error. + */ + public void set_suggested_value(org.ldk.structs.Option_CVec_u8ZZ val) { + bindings.ErroneousField_set_suggested_value(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new ErroneousField given each field + */ + public static ErroneousField of(long tlv_fieldnum_arg, org.ldk.structs.Option_CVec_u8ZZ suggested_value_arg) { + long ret = bindings.ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg.ptr); + GC.KeepAlive(tlv_fieldnum_arg); + GC.KeepAlive(suggested_value_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(suggested_value_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.ErroneousField_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ErroneousField + */ + public ErroneousField clone() { + long ret = bindings.ErroneousField_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ErrorAction.cs b/c_sharp/src/org/ldk/structs/ErrorAction.cs index 21072950..993d3e34 100644 --- a/c_sharp/src/org/ldk/structs/ErrorAction.cs +++ b/c_sharp/src/org/ldk/structs/ErrorAction.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * Used to put an error message in a LightningError + * Used to put an error message in a [`LightningError`]. */ public class ErrorAction : CommonBase { protected ErrorAction(object _dummy, long ptr) : base(ptr) { } @@ -18,11 +18,12 @@ public class ErrorAction : CommonBase { long raw_ty = bindings.LDKErrorAction_ty_from_ptr(ptr); switch (raw_ty) { case 0: return new ErrorAction_DisconnectPeer(ptr); - case 1: return new ErrorAction_IgnoreError(ptr); - case 2: return new ErrorAction_IgnoreAndLog(ptr); - case 3: return new ErrorAction_IgnoreDuplicateGossip(ptr); - case 4: return new ErrorAction_SendErrorMessage(ptr); - case 5: return new ErrorAction_SendWarningMessage(ptr); + case 1: return new ErrorAction_DisconnectPeerWithWarning(ptr); + case 2: return new ErrorAction_IgnoreError(ptr); + case 3: return new ErrorAction_IgnoreAndLog(ptr); + case 4: return new ErrorAction_IgnoreDuplicateGossip(ptr); + case 5: return new ErrorAction_SendErrorMessage(ptr); + case 6: return new ErrorAction_SendWarningMessage(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -43,6 +44,19 @@ public class ErrorAction : CommonBase { this.msg = msg_hu_conv; } } + /** A ErrorAction of type DisconnectPeerWithWarning */ + public class ErrorAction_DisconnectPeerWithWarning : ErrorAction { + /** + * A warning message which we should make an effort to send before we disconnect. + */ + public WarningMessage msg; + internal ErrorAction_DisconnectPeerWithWarning(long ptr) : base(null, ptr) { + long msg = bindings.LDKErrorAction_DisconnectPeerWithWarning_get_msg(ptr); + org.ldk.structs.WarningMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.WarningMessage(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } /** A ErrorAction of type IgnoreError */ public class ErrorAction_IgnoreError : ErrorAction { internal ErrorAction_IgnoreError(long ptr) : base(null, ptr) { @@ -124,6 +138,19 @@ public class ErrorAction : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction + */ + public static ErrorAction disconnect_peer_with_warning(org.ldk.structs.WarningMessage msg) { + long ret = bindings.ErrorAction_disconnect_peer_with_warning(msg == null ? 0 : msg.ptr); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new IgnoreError-variant ErrorAction */ diff --git a/c_sharp/src/org/ldk/structs/ErrorMessage.cs b/c_sharp/src/org/ldk/structs/ErrorMessage.cs index dc9b2d9c..8ddb6965 100644 --- a/c_sharp/src/org/ldk/structs/ErrorMessage.cs +++ b/c_sharp/src/org/ldk/structs/ErrorMessage.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An error message to be sent or received from a peer + * An [`error`] message to be sent to or received from a peer. + * + * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages */ public class ErrorMessage : CommonBase { internal ErrorMessage(object _dummy, long ptr) : base(ptr) { } @@ -41,8 +43,9 @@ public class ErrorMessage : CommonBase { /** * A possibly human-readable error description. - * The string should be sanitized before it is used (e.g. emitted to logs or printed to - * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in + * + * The string should be sanitized before it is used (e.g., emitted to logs or printed to + * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in * the terminal emulator or the logging subsystem. */ public string get_data() { @@ -53,8 +56,9 @@ public class ErrorMessage : CommonBase { /** * A possibly human-readable error description. - * The string should be sanitized before it is used (e.g. emitted to logs or printed to - * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in + * + * The string should be sanitized before it is used (e.g., emitted to logs or printed to + * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in * the terminal emulator or the logging subsystem. */ public void set_data(string val) { diff --git a/c_sharp/src/org/ldk/structs/Event.cs b/c_sharp/src/org/ldk/structs/Event.cs index 3c3d9c13..bf9bb520 100644 --- a/c_sharp/src/org/ldk/structs/Event.cs +++ b/c_sharp/src/org/ldk/structs/Event.cs @@ -34,11 +34,13 @@ public class Event : CommonBase { case 10: return new Event_HTLCIntercepted(ptr); case 11: return new Event_SpendableOutputs(ptr); case 12: return new Event_PaymentForwarded(ptr); - case 13: return new Event_ChannelReady(ptr); - case 14: return new Event_ChannelClosed(ptr); - case 15: return new Event_DiscardFunding(ptr); - case 16: return new Event_OpenChannelRequest(ptr); - case 17: return new Event_HTLCHandlingFailed(ptr); + case 13: return new Event_ChannelPending(ptr); + case 14: return new Event_ChannelReady(ptr); + case 15: return new Event_ChannelClosed(ptr); + case 16: return new Event_DiscardFunding(ptr); + case 17: return new Event_OpenChannelRequest(ptr); + case 18: return new Event_HTLCHandlingFailed(ptr); + case 19: return new Event_BumpTransaction(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -94,7 +96,7 @@ public class Event : CommonBase { * This field will always be filled in when the event was generated by LDK versions * 0.0.113 and above. * - * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager + * [phantom nodes]: crate::sign::PhantomKeysManager * * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -105,9 +107,37 @@ public class Event : CommonBase { */ public byte[] payment_hash; /** - * The value, in thousandths of a satoshi, that this payment is for. + * The fields in the onion which were received with each HTLC. Only fields which were + * identical in each HTLC involved in the payment will be included here. + * + * Payments received on LDK versions prior to 0.0.115 will have this field unset. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public RecipientOnionFields onion_fields; + /** + * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater + * than the invoice amount. + * + * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set + * and the previous hop took an extra fee. + * + * # Note + * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this + * field, you may lose money! + * + * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs */ public long amount_msat; + /** + * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee + * taken by our channel counterparty. + * + * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set. + * + * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs + */ + public long counterparty_skimmed_fee_msat; /** * Information for claiming this received payment, based on whether the purpose of the * payment is to pay an invoice or to send a spontaneous payment. @@ -123,10 +153,25 @@ public class Event : CommonBase { * The `user_channel_id` indicating over which channel we received the payment. */ public Option_u128Z via_user_channel_id; + /** + * The block height at which this payment will be failed back and will no longer be + * eligible for claiming. + * + * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to + * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure. + * + * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds + */ + public Option_u32Z claim_deadline; internal Event_PaymentClaimable(long ptr) : base(null, ptr) { this.receiver_node_id = bindings.LDKEvent_PaymentClaimable_get_receiver_node_id(ptr); this.payment_hash = bindings.LDKEvent_PaymentClaimable_get_payment_hash(ptr); + long onion_fields = bindings.LDKEvent_PaymentClaimable_get_onion_fields(ptr); + org.ldk.structs.RecipientOnionFields onion_fields_hu_conv = null; if (onion_fields < 0 || onion_fields > 4096) { onion_fields_hu_conv = new org.ldk.structs.RecipientOnionFields(null, onion_fields); } + if (onion_fields_hu_conv != null) { onion_fields_hu_conv.ptrs_to.AddLast(this); }; + this.onion_fields = onion_fields_hu_conv; this.amount_msat = bindings.LDKEvent_PaymentClaimable_get_amount_msat(ptr); + this.counterparty_skimmed_fee_msat = bindings.LDKEvent_PaymentClaimable_get_counterparty_skimmed_fee_msat(ptr); long purpose = bindings.LDKEvent_PaymentClaimable_get_purpose(ptr); org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose); if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.AddLast(this); }; @@ -136,6 +181,10 @@ public class Event : CommonBase { org.ldk.structs.Option_u128Z via_user_channel_id_hu_conv = org.ldk.structs.Option_u128Z.constr_from_ptr(via_user_channel_id); if (via_user_channel_id_hu_conv != null) { via_user_channel_id_hu_conv.ptrs_to.AddLast(this); }; this.via_user_channel_id = via_user_channel_id_hu_conv; + long claim_deadline = bindings.LDKEvent_PaymentClaimable_get_claim_deadline(ptr); + org.ldk.structs.Option_u32Z claim_deadline_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(claim_deadline); + if (claim_deadline_hu_conv != null) { claim_deadline_hu_conv.ptrs_to.AddLast(this); }; + this.claim_deadline = claim_deadline_hu_conv; } } /** A Event of type PaymentClaimed */ @@ -146,7 +195,7 @@ public class Event : CommonBase { * This field will always be filled in when the event was generated by LDK versions * 0.0.113 and above. * - * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager + * [phantom nodes]: crate::sign::PhantomKeysManager * * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -157,7 +206,8 @@ public class Event : CommonBase { */ public byte[] payment_hash; /** - * The value, in thousandths of a satoshi, that this payment is for. + * The value, in thousandths of a satoshi, that this payment is for. May be greater than the + * invoice amount. */ public long amount_msat; /** @@ -178,15 +228,11 @@ public class Event : CommonBase { /** A Event of type PaymentSent */ public class Event_PaymentSent : Event { /** - * The id returned by [`ChannelManager::send_payment`] and used with - * [`ChannelManager::retry_payment`]. + * The `payment_id` passed to [`ChannelManager::send_payment`]. * * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment - * - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public byte[] payment_id; + public Option_PaymentIdZ payment_id; /** * The preimage to the hash given to ChannelManager::send_payment. * Note that this serves as a payment receipt, if you wish to have such a thing, you must @@ -212,7 +258,10 @@ public class Event : CommonBase { */ public Option_u64Z fee_paid_msat; internal Event_PaymentSent(long ptr) : base(null, ptr) { - this.payment_id = bindings.LDKEvent_PaymentSent_get_payment_id(ptr); + long payment_id = bindings.LDKEvent_PaymentSent_get_payment_id(ptr); + org.ldk.structs.Option_PaymentIdZ payment_id_hu_conv = org.ldk.structs.Option_PaymentIdZ.constr_from_ptr(payment_id); + if (payment_id_hu_conv != null) { payment_id_hu_conv.ptrs_to.AddLast(this); }; + this.payment_id = payment_id_hu_conv; this.payment_preimage = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr); this.payment_hash = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr); long fee_paid_msat = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr); @@ -224,12 +273,9 @@ public class Event : CommonBase { /** A Event of type PaymentFailed */ public class Event_PaymentFailed : Event { /** - * The id returned by [`ChannelManager::send_payment`] and used with - * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`]. + * The `payment_id` passed to [`ChannelManager::send_payment`]. * * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment - * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment */ public byte[] payment_id; /** @@ -238,63 +284,65 @@ public class Event : CommonBase { * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment */ public byte[] payment_hash; + /** + * The reason the payment failed. This is only `None` for events generated or serialized + * by versions prior to 0.0.115. + */ + public Option_PaymentFailureReasonZ reason; internal Event_PaymentFailed(long ptr) : base(null, ptr) { this.payment_id = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr); this.payment_hash = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr); + long reason = bindings.LDKEvent_PaymentFailed_get_reason(ptr); + org.ldk.structs.Option_PaymentFailureReasonZ reason_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(reason); + if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.AddLast(this); }; + this.reason = reason_hu_conv; } } /** A Event of type PaymentPathSuccessful */ public class Event_PaymentPathSuccessful : Event { /** - * The id returned by [`ChannelManager::send_payment`] and used with - * [`ChannelManager::retry_payment`]. + * The `payment_id` passed to [`ChannelManager::send_payment`]. * * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment */ public byte[] payment_id; /** * The hash that was given to [`ChannelManager::send_payment`]. * - * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * This will be `Some` for all payments which completed on LDK 0.0.104 or later. * - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment */ - public byte[] payment_hash; + public Option_PaymentHashZ payment_hash; /** * The payment path that was successful. * * May contain a closed channel if the HTLC sent along the path was fulfilled on chain. */ - public RouteHop[] path; + public Path path; internal Event_PaymentPathSuccessful(long ptr) : base(null, ptr) { this.payment_id = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr); - this.payment_hash = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr); - long[] path = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr); - int path_conv_10_len = path.Length; - RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; - for (int k = 0; k < path_conv_10_len; k++) { - long path_conv_10 = path[k]; - org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } - if (path_conv_10_hu_conv != null) { path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - path_conv_10_arr[k] = path_conv_10_hu_conv; - } - this.path = path_conv_10_arr; + long payment_hash = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr); + org.ldk.structs.Option_PaymentHashZ payment_hash_hu_conv = org.ldk.structs.Option_PaymentHashZ.constr_from_ptr(payment_hash); + if (payment_hash_hu_conv != null) { payment_hash_hu_conv.ptrs_to.AddLast(this); }; + this.payment_hash = payment_hash_hu_conv; + long path = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr); + org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); } + if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); }; + this.path = path_hu_conv; } } /** A Event of type PaymentPathFailed */ public class Event_PaymentPathFailed : Event { /** - * The id returned by [`ChannelManager::send_payment`] and used with - * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`]. + * The `payment_id` passed to [`ChannelManager::send_payment`]. + * + * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later. * * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment - * - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public byte[] payment_id; + public Option_PaymentIdZ payment_id; /** * The hash that was given to [`ChannelManager::send_payment`]. * @@ -303,44 +351,21 @@ public class Event : CommonBase { public byte[] payment_hash; /** * Indicates the payment was rejected for some reason by the recipient. This implies that - * the payment has failed, not just the route in question. If this is not set, you may - * retry the payment via a different route. + * the payment has failed, not just the route in question. If this is not set, the payment may + * be retried via a different route. */ public bool payment_failed_permanently; /** - * Any failure information conveyed via the Onion return packet by a node along the failed - * payment route. - * - * Should be applied to the [`NetworkGraph`] so that routing decisions can take into - * account the update. + * Extra error details based on the failure type. May contain an update that needs to be + * applied to the [`NetworkGraph`]. * * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph */ - public Option_NetworkUpdateZ network_update; - /** - * For both single-path and multi-path payments, this is set if all paths of the payment have - * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the - * larger MPP payment were still in flight when this event was generated. - * - * Note that if you are retrying individual MPP parts, using this value to determine if a - * payment has fully failed is race-y. Because multiple failures can happen prior to events - * being processed, you may retry in response to a first failure, with a second failure - * (with `all_paths_failed` set) still pending. Then, when the second failure is processed - * you will see `all_paths_failed` set even though the retry of the first failure still - * has an associated in-flight HTLC. See (1) for an example of such a failure. - * - * If you wish to retry individual MPP parts and learn when a payment has failed, you must - * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event. - * - * (1) - * - * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment - */ - public bool all_paths_failed; + public PathFailure failure; /** * The payment path that failed. */ - public RouteHop[] path; + public Path path; /** * The channel responsible for the failed payment path. * @@ -352,44 +377,25 @@ public class Event : CommonBase { * retried. May be `None` for older [`Event`] serializations. */ public Option_u64Z short_channel_id; - /** - * Parameters needed to compute a new [`Route`] when retrying the failed payment path. - * - * See [`find_route`] for details. - * - * [`Route`]: crate::routing::router::Route - * [`find_route`]: crate::routing::router::find_route - * - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public RouteParameters retry; internal Event_PaymentPathFailed(long ptr) : base(null, ptr) { - this.payment_id = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr); + long payment_id = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr); + org.ldk.structs.Option_PaymentIdZ payment_id_hu_conv = org.ldk.structs.Option_PaymentIdZ.constr_from_ptr(payment_id); + if (payment_id_hu_conv != null) { payment_id_hu_conv.ptrs_to.AddLast(this); }; + this.payment_id = payment_id_hu_conv; this.payment_hash = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr); this.payment_failed_permanently = bindings.LDKEvent_PaymentPathFailed_get_payment_failed_permanently(ptr); - long network_update = bindings.LDKEvent_PaymentPathFailed_get_network_update(ptr); - org.ldk.structs.Option_NetworkUpdateZ network_update_hu_conv = org.ldk.structs.Option_NetworkUpdateZ.constr_from_ptr(network_update); - if (network_update_hu_conv != null) { network_update_hu_conv.ptrs_to.AddLast(this); }; - this.network_update = network_update_hu_conv; - this.all_paths_failed = bindings.LDKEvent_PaymentPathFailed_get_all_paths_failed(ptr); - long[] path = bindings.LDKEvent_PaymentPathFailed_get_path(ptr); - int path_conv_10_len = path.Length; - RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; - for (int k = 0; k < path_conv_10_len; k++) { - long path_conv_10 = path[k]; - org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } - if (path_conv_10_hu_conv != null) { path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - path_conv_10_arr[k] = path_conv_10_hu_conv; - } - this.path = path_conv_10_arr; + long failure = bindings.LDKEvent_PaymentPathFailed_get_failure(ptr); + org.ldk.structs.PathFailure failure_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(failure); + if (failure_hu_conv != null) { failure_hu_conv.ptrs_to.AddLast(this); }; + this.failure = failure_hu_conv; + long path = bindings.LDKEvent_PaymentPathFailed_get_path(ptr); + org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); } + if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); }; + this.path = path_hu_conv; long short_channel_id = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr); org.ldk.structs.Option_u64Z short_channel_id_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(short_channel_id); if (short_channel_id_hu_conv != null) { short_channel_id_hu_conv.ptrs_to.AddLast(this); }; this.short_channel_id = short_channel_id_hu_conv; - long retry = bindings.LDKEvent_PaymentPathFailed_get_retry(ptr); - org.ldk.structs.RouteParameters retry_hu_conv = null; if (retry < 0 || retry > 4096) { retry_hu_conv = new org.ldk.structs.RouteParameters(null, retry); } - if (retry_hu_conv != null) { retry_hu_conv.ptrs_to.AddLast(this); }; - this.retry = retry_hu_conv; } } /** A Event of type ProbeSuccessful */ @@ -409,20 +415,14 @@ public class Event : CommonBase { /** * The payment path that was successful. */ - public RouteHop[] path; + public Path path; internal Event_ProbeSuccessful(long ptr) : base(null, ptr) { this.payment_id = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr); this.payment_hash = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr); - long[] path = bindings.LDKEvent_ProbeSuccessful_get_path(ptr); - int path_conv_10_len = path.Length; - RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; - for (int k = 0; k < path_conv_10_len; k++) { - long path_conv_10 = path[k]; - org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } - if (path_conv_10_hu_conv != null) { path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - path_conv_10_arr[k] = path_conv_10_hu_conv; - } - this.path = path_conv_10_arr; + long path = bindings.LDKEvent_ProbeSuccessful_get_path(ptr); + org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); } + if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); }; + this.path = path_hu_conv; } } /** A Event of type ProbeFailed */ @@ -442,7 +442,7 @@ public class Event : CommonBase { /** * The payment path that failed. */ - public RouteHop[] path; + public Path path; /** * The channel responsible for the failed probe. * @@ -454,16 +454,10 @@ public class Event : CommonBase { internal Event_ProbeFailed(long ptr) : base(null, ptr) { this.payment_id = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr); this.payment_hash = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr); - long[] path = bindings.LDKEvent_ProbeFailed_get_path(ptr); - int path_conv_10_len = path.Length; - RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; - for (int k = 0; k < path_conv_10_len; k++) { - long path_conv_10 = path[k]; - org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } - if (path_conv_10_hu_conv != null) { path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - path_conv_10_arr[k] = path_conv_10_hu_conv; - } - this.path = path_conv_10_arr; + long path = bindings.LDKEvent_ProbeFailed_get_path(ptr); + org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); } + if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); }; + this.path = path_hu_conv; long short_channel_id = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr); org.ldk.structs.Option_u64Z short_channel_id_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(short_channel_id); if (short_channel_id_hu_conv != null) { short_channel_id_hu_conv.ptrs_to.AddLast(this); }; @@ -507,6 +501,7 @@ public class Event : CommonBase { /** * How many msats the payer intended to route to the next node. Depending on the reason you are * intercepting this payment, you might take a fee by forwarding less than this amount. + * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116. * * Note that LDK will NOT check that expected fees were factored into this value. You MUST * check that whatever fee you want has been included here or subtract it as required. Further, @@ -577,6 +572,12 @@ public class Event : CommonBase { * transaction. */ public bool claim_from_onchain_tx; + /** + * The final amount forwarded, in milli-satoshis, after the fee is deducted. + * + * The caveat described above the `fee_earned_msat` field applies here as well. + */ + public Option_u64Z outbound_amount_forwarded_msat; internal Event_PaymentForwarded(long ptr) : base(null, ptr) { this.prev_channel_id = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr); this.next_channel_id = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr); @@ -585,12 +586,62 @@ public class Event : CommonBase { if (fee_earned_msat_hu_conv != null) { fee_earned_msat_hu_conv.ptrs_to.AddLast(this); }; this.fee_earned_msat = fee_earned_msat_hu_conv; this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr); + long outbound_amount_forwarded_msat = bindings.LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(ptr); + org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(outbound_amount_forwarded_msat); + if (outbound_amount_forwarded_msat_hu_conv != null) { outbound_amount_forwarded_msat_hu_conv.ptrs_to.AddLast(this); }; + this.outbound_amount_forwarded_msat = outbound_amount_forwarded_msat_hu_conv; + } + } + /** A Event of type ChannelPending */ + public class Event_ChannelPending : Event { + /** + * The `channel_id` of the channel that is pending confirmation. + */ + public byte[] channel_id; + /** + * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound + * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if + * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise + * `user_channel_id` will be randomized for an inbound channel. + * + * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel + * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels + */ + public UInt128 user_channel_id; + /** + * The `temporary_channel_id` this channel used to be known by during channel establishment. + * + * Will be `None` for channels created prior to LDK version 0.0.115. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public byte[] former_temporary_channel_id; + /** + * The `node_id` of the channel counterparty. + */ + public byte[] counterparty_node_id; + /** + * The outpoint of the channel's funding transaction. + */ + public OutPoint funding_txo; + internal Event_ChannelPending(long ptr) : base(null, ptr) { + this.channel_id = bindings.LDKEvent_ChannelPending_get_channel_id(ptr); + byte[] user_channel_id = bindings.LDKEvent_ChannelPending_get_user_channel_id(ptr); + org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); + this.user_channel_id = user_channel_id_conv; + this.former_temporary_channel_id = bindings.LDKEvent_ChannelPending_get_former_temporary_channel_id(ptr); + this.counterparty_node_id = bindings.LDKEvent_ChannelPending_get_counterparty_node_id(ptr); + long funding_txo = bindings.LDKEvent_ChannelPending_get_funding_txo(ptr); + org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); } + if (funding_txo_hu_conv != null) { funding_txo_hu_conv.ptrs_to.AddLast(this); }; + this.funding_txo = funding_txo_hu_conv; } } /** A Event of type ChannelReady */ public class Event_ChannelReady : Event { /** - * The channel_id of the channel that is ready. + * The `channel_id` of the channel that is ready. */ public byte[] channel_id; /** @@ -605,7 +656,7 @@ public class Event : CommonBase { */ public UInt128 user_channel_id; /** - * The node_id of the channel counterparty. + * The `node_id` of the channel counterparty. */ public byte[] counterparty_node_id; /** @@ -627,7 +678,7 @@ public class Event : CommonBase { /** A Event of type ChannelClosed */ public class Event_ChannelClosed : Event { /** - * The channel_id of the channel which has been closed. Note that on-chain transactions + * The `channel_id` of the channel which has been closed. Note that on-chain transactions * resolving the channel are likely still awaiting confirmation. */ public byte[] channel_id; @@ -754,6 +805,16 @@ public class Event : CommonBase { this.failed_next_destination = failed_next_destination_hu_conv; } } + /** A Event of type BumpTransaction */ + public class Event_BumpTransaction : Event { + public BumpTransactionEvent bump_transaction; + internal Event_BumpTransaction(long ptr) : base(null, ptr) { + long bump_transaction = bindings.LDKEvent_BumpTransaction_get_bump_transaction(ptr); + org.ldk.structs.BumpTransactionEvent bump_transaction_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(bump_transaction); + if (bump_transaction_hu_conv != null) { bump_transaction_hu_conv.ptrs_to.AddLast(this); }; + this.bump_transaction = bump_transaction_hu_conv; + } + } internal long clone_ptr() { long ret = bindings.Event_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -791,17 +852,24 @@ public class Event : CommonBase { /** * Utility method to constructs a new PaymentClaimable-variant Event */ - public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, org.ldk.structs.PaymentPurpose purpose, byte[] via_channel_id, org.ldk.structs.Option_u128Z via_user_channel_id) { - long ret = bindings.Event_payment_claimable(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), amount_msat, purpose.ptr, InternalUtils.check_arr_len(via_channel_id, 32), via_user_channel_id.ptr); + public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, org.ldk.structs.RecipientOnionFields onion_fields, long amount_msat, long counterparty_skimmed_fee_msat, org.ldk.structs.PaymentPurpose purpose, byte[] via_channel_id, org.ldk.structs.Option_u128Z via_user_channel_id, org.ldk.structs.Option_u32Z claim_deadline) { + long ret = bindings.Event_payment_claimable(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), onion_fields == null ? 0 : onion_fields.ptr, amount_msat, counterparty_skimmed_fee_msat, purpose.ptr, InternalUtils.check_arr_len(via_channel_id, 32), via_user_channel_id.ptr, claim_deadline.ptr); GC.KeepAlive(receiver_node_id); GC.KeepAlive(payment_hash); + GC.KeepAlive(onion_fields); GC.KeepAlive(amount_msat); + GC.KeepAlive(counterparty_skimmed_fee_msat); GC.KeepAlive(purpose); GC.KeepAlive(via_channel_id); GC.KeepAlive(via_user_channel_id); + GC.KeepAlive(claim_deadline); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(onion_fields); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(purpose); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(via_user_channel_id); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(claim_deadline); }; return ret_hu_conv; } @@ -817,14 +885,15 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(purpose); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentSent-variant Event */ - public static Event payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, org.ldk.structs.Option_u64Z fee_paid_msat) { - long ret = bindings.Event_payment_sent(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_hash, 32), fee_paid_msat.ptr); + public static Event payment_sent(org.ldk.structs.Option_PaymentIdZ payment_id, byte[] payment_preimage, byte[] payment_hash, org.ldk.structs.Option_u64Z fee_paid_msat) { + long ret = bindings.Event_payment_sent(payment_id.ptr, InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_hash, 32), fee_paid_msat.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_preimage); GC.KeepAlive(payment_hash); @@ -832,78 +901,83 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_id); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_paid_msat); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentFailed-variant Event */ - public static Event payment_failed(byte[] payment_id, byte[] payment_hash) { - long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32)); + public static Event payment_failed(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Option_PaymentFailureReasonZ reason) { + long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), reason.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); + GC.KeepAlive(reason); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reason); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentPathSuccessful-variant Event */ - public static Event payment_path_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) { - long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null); + public static Event payment_path_successful(byte[] payment_id, org.ldk.structs.Option_PaymentHashZ payment_hash, org.ldk.structs.Path path) { + long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), payment_hash.ptr, path == null ? 0 : path.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(path); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHop path_conv_10 in path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path_conv_10); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_hash); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentPathFailed-variant Event */ - public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, bool payment_failed_permanently, org.ldk.structs.Option_NetworkUpdateZ network_update, bool all_paths_failed, RouteHop[] path, org.ldk.structs.Option_u64Z short_channel_id, org.ldk.structs.RouteParameters retry) { - long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), payment_failed_permanently, network_update.ptr, all_paths_failed, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr); + public static Event payment_path_failed(org.ldk.structs.Option_PaymentIdZ payment_id, byte[] payment_hash, bool payment_failed_permanently, org.ldk.structs.PathFailure failure, org.ldk.structs.Path path, org.ldk.structs.Option_u64Z short_channel_id) { + long ret = bindings.Event_payment_path_failed(payment_id.ptr, InternalUtils.check_arr_len(payment_hash, 32), payment_failed_permanently, failure.ptr, path == null ? 0 : path.ptr, short_channel_id.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(payment_failed_permanently); - GC.KeepAlive(network_update); - GC.KeepAlive(all_paths_failed); + GC.KeepAlive(failure); GC.KeepAlive(path); GC.KeepAlive(short_channel_id); - GC.KeepAlive(retry); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHop path_conv_10 in path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path_conv_10); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(retry); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_id); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(failure); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id); }; return ret_hu_conv; } /** * Utility method to constructs a new ProbeSuccessful-variant Event */ - public static Event probe_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) { - long ret = bindings.Event_probe_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null); + public static Event probe_successful(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Path path) { + long ret = bindings.Event_probe_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path == null ? 0 : path.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(path); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHop path_conv_10 in path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path_conv_10); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; return ret_hu_conv; } /** * Utility method to constructs a new ProbeFailed-variant Event */ - public static Event probe_failed(byte[] payment_id, byte[] payment_hash, RouteHop[] path, org.ldk.structs.Option_u64Z short_channel_id) { - long ret = bindings.Event_probe_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null, short_channel_id.ptr); + public static Event probe_failed(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Path path, org.ldk.structs.Option_u64Z short_channel_id) { + long ret = bindings.Event_probe_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path == null ? 0 : path.ptr, short_channel_id.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(path); @@ -911,7 +985,8 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHop path_conv_10 in path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path_conv_10); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id); }; return ret_hu_conv; } @@ -952,21 +1027,42 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (SpendableOutputDescriptor outputs_conv_27 in outputs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outputs_conv_27); }; }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentForwarded-variant Event */ - public static Event payment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, org.ldk.structs.Option_u64Z fee_earned_msat, bool claim_from_onchain_tx) { - long ret = bindings.Event_payment_forwarded(InternalUtils.check_arr_len(prev_channel_id, 32), InternalUtils.check_arr_len(next_channel_id, 32), fee_earned_msat.ptr, claim_from_onchain_tx); + public static Event payment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, org.ldk.structs.Option_u64Z fee_earned_msat, bool claim_from_onchain_tx, org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat) { + long ret = bindings.Event_payment_forwarded(InternalUtils.check_arr_len(prev_channel_id, 32), InternalUtils.check_arr_len(next_channel_id, 32), fee_earned_msat.ptr, claim_from_onchain_tx, outbound_amount_forwarded_msat.ptr); GC.KeepAlive(prev_channel_id); GC.KeepAlive(next_channel_id); GC.KeepAlive(fee_earned_msat); GC.KeepAlive(claim_from_onchain_tx); + GC.KeepAlive(outbound_amount_forwarded_msat); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_earned_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_amount_forwarded_msat); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ChannelPending-variant Event + */ + public static Event channel_pending(byte[] channel_id, org.ldk.util.UInt128 user_channel_id, byte[] former_temporary_channel_id, byte[] counterparty_node_id, org.ldk.structs.OutPoint funding_txo) { + long ret = bindings.Event_channel_pending(InternalUtils.check_arr_len(channel_id, 32), user_channel_id.getLEBytes(), InternalUtils.check_arr_len(former_temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), funding_txo == null ? 0 : funding_txo.ptr); + GC.KeepAlive(channel_id); + GC.KeepAlive(user_channel_id); + GC.KeepAlive(former_temporary_channel_id); + GC.KeepAlive(counterparty_node_id); + GC.KeepAlive(funding_txo); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo); }; return ret_hu_conv; } @@ -997,6 +1093,7 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reason); }; return ret_hu_conv; } @@ -1040,9 +1137,38 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(failed_next_destination); }; return ret_hu_conv; } + /** + * Utility method to constructs a new BumpTransaction-variant Event + */ + public static Event bump_transaction(org.ldk.structs.BumpTransactionEvent a) { + long ret = bindings.Event_bump_transaction(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Checks if two Events contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.Event b) { + bool ret = bindings.Event_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is Event)) return false; + return this.eq((Event)o); + } /** * Serialize the Event object into a byte array which can be read by Event_read */ diff --git a/c_sharp/src/org/ldk/structs/EventHandler.cs b/c_sharp/src/org/ldk/structs/EventHandler.cs index 5768757e..7a637f04 100644 --- a/c_sharp/src/org/ldk/structs/EventHandler.cs +++ b/c_sharp/src/org/ldk/structs/EventHandler.cs @@ -57,6 +57,7 @@ public class EventHandler : CommonBase { bindings.EventHandler_handle_event(this.ptr, _event.ptr); GC.KeepAlive(this); GC.KeepAlive(_event); + if (this != null) { this.ptrs_to.AddLast(_event); }; } } diff --git a/c_sharp/src/org/ldk/structs/EventsProvider.cs b/c_sharp/src/org/ldk/structs/EventsProvider.cs index ff15c350..5523dc80 100644 --- a/c_sharp/src/org/ldk/structs/EventsProvider.cs +++ b/c_sharp/src/org/ldk/structs/EventsProvider.cs @@ -85,7 +85,7 @@ public class EventsProvider : CommonBase { * See the trait-level documentation for requirements. */ public void process_pending_events(org.ldk.structs.EventHandler handler) { - bindings.EventsProvider_process_pending_events(this.ptr, handler == null ? 0 : handler.ptr); + bindings.EventsProvider_process_pending_events(this.ptr, handler.ptr); GC.KeepAlive(this); GC.KeepAlive(handler); if (this != null) { this.ptrs_to.AddLast(handler); }; diff --git a/c_sharp/src/org/ldk/structs/ExpandedKey.cs b/c_sharp/src/org/ldk/structs/ExpandedKey.cs index f7f7cd55..510077b1 100644 --- a/c_sharp/src/org/ldk/structs/ExpandedKey.cs +++ b/c_sharp/src/org/ldk/structs/ExpandedKey.cs @@ -8,9 +8,9 @@ namespace org { namespace ldk { namespace structs { /** * A set of keys that were HKDF-expanded from an initial call to - * [`KeysInterface::get_inbound_payment_key_material`]. + * [`NodeSigner::get_inbound_payment_key_material`]. * - * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material + * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material */ public class ExpandedKey : CommonBase { internal ExpandedKey(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/ExpiryTime.cs b/c_sharp/src/org/ldk/structs/ExpiryTime.cs index 9f4a5285..66aaf8dc 100644 --- a/c_sharp/src/org/ldk/structs/ExpiryTime.cs +++ b/c_sharp/src/org/ldk/structs/ExpiryTime.cs @@ -35,7 +35,7 @@ public class ExpiryTime : CommonBase { } /** - * Checks if two ExpiryTimes contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the ExpiryTime. */ public long hash() { long ret = bindings.ExpiryTime_hash(this.ptr); @@ -76,7 +76,7 @@ public class ExpiryTime : CommonBase { } /** - * Construct an `ExpiryTime` from a `Duration`, dropping the sub-second part. + * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part. */ public static ExpiryTime from_duration(long duration) { long ret = bindings.ExpiryTime_from_duration(duration); @@ -97,7 +97,7 @@ public class ExpiryTime : CommonBase { } /** - * Returns a reference to the underlying `Duration` (=expiry time) + * Returns a reference to the underlying [`Duration`] (=expiry time) */ public long as_duration() { long ret = bindings.ExpiryTime_as_duration(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/Fallback.cs b/c_sharp/src/org/ldk/structs/Fallback.cs index 8000c9d5..13eee128 100644 --- a/c_sharp/src/org/ldk/structs/Fallback.cs +++ b/c_sharp/src/org/ldk/structs/Fallback.cs @@ -27,11 +27,11 @@ public class Fallback : CommonBase { /** A Fallback of type SegWitProgram */ public class Fallback_SegWitProgram : Fallback { - public UInt5 version; + public WitnessVersion version; public byte[] program; internal Fallback_SegWitProgram(long ptr) : base(null, ptr) { byte version = bindings.LDKFallback_SegWitProgram_get_version(ptr); - UInt5 version_conv = new UInt5(version); + WitnessVersion version_conv = new WitnessVersion(version); this.version = version_conv; this.program = bindings.LDKFallback_SegWitProgram_get_program(ptr); } @@ -71,7 +71,7 @@ public class Fallback : CommonBase { /** * Utility method to constructs a new SegWitProgram-variant Fallback */ - public static Fallback seg_wit_program(org.ldk.util.UInt5 version, byte[] program) { + public static Fallback seg_wit_program(org.ldk.util.WitnessVersion version, byte[] program) { long ret = bindings.Fallback_seg_wit_program(version.getVal(), program); GC.KeepAlive(version); GC.KeepAlive(program); @@ -106,7 +106,7 @@ public class Fallback : CommonBase { } /** - * Checks if two Fallbacks contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the Fallback. */ public long hash() { long ret = bindings.Fallback_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/FeeEstimator.cs b/c_sharp/src/org/ldk/structs/FeeEstimator.cs index 45694cde..fedc8cb2 100644 --- a/c_sharp/src/org/ldk/structs/FeeEstimator.cs +++ b/c_sharp/src/org/ldk/structs/FeeEstimator.cs @@ -9,6 +9,11 @@ namespace org { namespace ldk { namespace structs { * A trait which should be implemented to provide feerate information on a number of time * horizons. * + * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of + * third-parties hosting them. Note that this enables them to affect the propagation of your + * pre-signed transactions at any time and therefore endangers the safety of channels funds. It + * should be considered carefully as a deployment. + * * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're * called from inside the library in response to chain events, P2P events, or timer events). */ diff --git a/c_sharp/src/org/ldk/structs/FilesystemPersister.cs b/c_sharp/src/org/ldk/structs/FilesystemPersister.cs index 7c9816a9..336faf56 100644 --- a/c_sharp/src/org/ldk/structs/FilesystemPersister.cs +++ b/c_sharp/src/org/ldk/structs/FilesystemPersister.cs @@ -51,13 +51,15 @@ public class FilesystemPersister : CommonBase { /** * Read `ChannelMonitor`s from disk. */ - public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(org.ldk.structs.KeysInterface keys_manager) { - long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, keys_manager == null ? 0 : keys_manager.ptr); + public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.SignerProvider signer_provider) { + long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, entropy_source.ptr, signer_provider.ptr); GC.KeepAlive(this); - GC.KeepAlive(keys_manager); + GC.KeepAlive(entropy_source); + GC.KeepAlive(signer_provider); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(keys_manager); }; + if (this != null) { this.ptrs_to.AddLast(entropy_source); }; + if (this != null) { this.ptrs_to.AddLast(signer_provider); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/FundingCreated.cs b/c_sharp/src/org/ldk/structs/FundingCreated.cs index 7c93cd5b..37be957b 100644 --- a/c_sharp/src/org/ldk/structs/FundingCreated.cs +++ b/c_sharp/src/org/ldk/structs/FundingCreated.cs @@ -7,7 +7,11 @@ namespace org { namespace ldk { namespace structs { /** - * A funding_created message to be sent or received from a peer + * A [`funding_created`] message to be sent to or received from a peer. + * + * Used in V1 channel establishment + * + * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message */ public class FundingCreated : CommonBase { internal FundingCreated(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/FundingSigned.cs b/c_sharp/src/org/ldk/structs/FundingSigned.cs index a0badf59..df6fb25e 100644 --- a/c_sharp/src/org/ldk/structs/FundingSigned.cs +++ b/c_sharp/src/org/ldk/structs/FundingSigned.cs @@ -7,7 +7,11 @@ namespace org { namespace ldk { namespace structs { /** - * A funding_signed message to be sent or received from a peer + * A [`funding_signed`] message to be sent to or received from a peer. + * + * Used in V1 channel establishment + * + * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message */ public class FundingSigned : CommonBase { internal FundingSigned(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/Future.cs b/c_sharp/src/org/ldk/structs/Future.cs index 5fa004ad..b48dbf6f 100644 --- a/c_sharp/src/org/ldk/structs/Future.cs +++ b/c_sharp/src/org/ldk/structs/Future.cs @@ -8,6 +8,8 @@ namespace org { namespace ldk { namespace structs { /** * A simple future which can complete once, and calls some callback(s) when it does so. + * + * Clones can be made and all futures cloned from the same source will complete at the same time. */ public class Future : CommonBase { internal Future(object _dummy, long ptr) : base(ptr) { } @@ -15,16 +17,56 @@ public class Future : CommonBase { if (ptr != 0) { bindings.Future_free(ptr); } } + internal long clone_ptr() { + long ret = bindings.Future_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Future + */ + public Future clone() { + long ret = bindings.Future_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Future ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Future(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Registers a callback to be called upon completion of this future. If the future has already * completed, the callback will be called immediately. */ public void register_callback_fn(org.ldk.structs.FutureCallback callback) { - bindings.Future_register_callback_fn(this.ptr, callback == null ? 0 : callback.ptr); + bindings.Future_register_callback_fn(this.ptr, callback.ptr); GC.KeepAlive(this); GC.KeepAlive(callback); if (this != null) { this.ptrs_to.AddLast(callback); }; } + /** + * Waits until this [`Future`] completes. + */ + public void wait() { + bindings.Future_wait(this.ptr); + GC.KeepAlive(this); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Waits until this [`Future`] completes or the given amount of time has elapsed. + * + * Returns true if the [`Future`] completed, false if the time elapsed. + */ + public bool wait_timeout(long max_wait) { + bool ret = bindings.Future_wait_timeout(this.ptr, max_wait); + GC.KeepAlive(this); + GC.KeepAlive(max_wait); + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs b/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs index 950c7422..233642d6 100644 --- a/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs +++ b/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs @@ -7,9 +7,11 @@ namespace org { namespace ldk { namespace structs { /** - * A gossip_timestamp_filter message is used by a node to request + * A [`gossip_timestamp_filter`] message is used by a node to request * gossip relay for messages in the requested time range when the - * gossip_queries feature has been negotiated. + * `gossip_queries` feature has been negotiated. + * + * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message */ public class GossipTimestampFilter : CommonBase { internal GossipTimestampFilter(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/GraphSyncError.cs b/c_sharp/src/org/ldk/structs/GraphSyncError.cs index 764305da..1078fe24 100644 --- a/c_sharp/src/org/ldk/structs/GraphSyncError.cs +++ b/c_sharp/src/org/ldk/structs/GraphSyncError.cs @@ -71,6 +71,7 @@ public class GraphSyncError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs b/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs new file mode 100644 index 00000000..92c2d629 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs @@ -0,0 +1,268 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A descriptor used to sign for a commitment transaction's HTLC output. + */ +public class HTLCDescriptor : CommonBase { + internal HTLCDescriptor(object _dummy, long ptr) : base(ptr) { } + ~HTLCDescriptor() { + if (ptr != 0) { bindings.HTLCDescriptor_free(ptr); } + } + + /** + * The parameters required to derive the signer for the HTLC input. + */ + public ChannelDerivationParameters get_channel_derivation_parameters() { + long ret = bindings.HTLCDescriptor_get_channel_derivation_parameters(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelDerivationParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDerivationParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The parameters required to derive the signer for the HTLC input. + */ + public void set_channel_derivation_parameters(org.ldk.structs.ChannelDerivationParameters val) { + bindings.HTLCDescriptor_set_channel_derivation_parameters(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The number of the commitment transaction in which the HTLC output lives. + */ + public long get_per_commitment_number() { + long ret = bindings.HTLCDescriptor_get_per_commitment_number(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The number of the commitment transaction in which the HTLC output lives. + */ + public void set_per_commitment_number(long val) { + bindings.HTLCDescriptor_set_per_commitment_number(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The key tweak corresponding to the number of the commitment transaction in which the HTLC + * output lives. This tweak is applied to all the basepoints for both parties in the channel to + * arrive at unique keys per commitment. + * + * See for more info. + */ + public byte[] get_per_commitment_point() { + byte[] ret = bindings.HTLCDescriptor_get_per_commitment_point(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The key tweak corresponding to the number of the commitment transaction in which the HTLC + * output lives. This tweak is applied to all the basepoints for both parties in the channel to + * arrive at unique keys per commitment. + * + * See for more info. + */ + public void set_per_commitment_point(byte[] val) { + bindings.HTLCDescriptor_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The details of the HTLC as it appears in the commitment transaction. + */ + public HTLCOutputInCommitment get_htlc() { + long ret = bindings.HTLCDescriptor_get_htlc(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The details of the HTLC as it appears in the commitment transaction. + */ + public void set_htlc(org.ldk.structs.HTLCOutputInCommitment val) { + bindings.HTLCDescriptor_set_htlc(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be + * taken. + */ + public Option_PaymentPreimageZ get_preimage() { + long ret = bindings.HTLCDescriptor_get_preimage(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentPreimageZ ret_hu_conv = org.ldk.structs.Option_PaymentPreimageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be + * taken. + */ + public void set_preimage(org.ldk.structs.Option_PaymentPreimageZ val) { + bindings.HTLCDescriptor_set_preimage(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The counterparty's signature required to spend the HTLC output. + */ + public byte[] get_counterparty_sig() { + byte[] ret = bindings.HTLCDescriptor_get_counterparty_sig(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The counterparty's signature required to spend the HTLC output. + */ + public void set_counterparty_sig(byte[] val) { + bindings.HTLCDescriptor_set_counterparty_sig(this.ptr, InternalUtils.check_arr_len(val, 64)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + internal long clone_ptr() { + long ret = bindings.HTLCDescriptor_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the HTLCDescriptor + */ + public HTLCDescriptor clone() { + long ret = bindings.HTLCDescriptor_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HTLCDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCDescriptor(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two HTLCDescriptors contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.HTLCDescriptor b) { + bool ret = bindings.HTLCDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is HTLCDescriptor)) return false; + return this.eq((HTLCDescriptor)o); + } + /** + * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint + * being spent by the HTLC input in the HTLC transaction. + */ + public OutPoint outpoint() { + long ret = bindings.HTLCDescriptor_outpoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Returns the UTXO to be spent by the HTLC input, which can be obtained via + * [`Self::unsigned_tx_input`]. + */ + public TxOut previous_utxo() { + long ret = bindings.HTLCDescriptor_previous_utxo(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TxOut ret_conv = new TxOut(null, ret); + return ret_conv; + } + + /** + * Returns the unsigned transaction input spending the HTLC output in the commitment + * transaction. + */ + public TxIn unsigned_tx_input() { + long ret = bindings.HTLCDescriptor_unsigned_tx_input(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TxIn ret_conv = new TxIn(null, ret); + return ret_conv; + } + + /** + * Returns the delayed output created as a result of spending the HTLC output in the commitment + * transaction. + */ + public TxOut tx_output() { + long ret = bindings.HTLCDescriptor_tx_output(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TxOut ret_conv = new TxOut(null, ret); + return ret_conv; + } + + /** + * Returns the witness script of the HTLC output in the commitment transaction. + */ + public byte[] witness_script() { + byte[] ret = bindings.HTLCDescriptor_witness_script(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns the fully signed witness required to spend the HTLC output in the commitment + * transaction. + */ + public byte[] tx_input_witness(byte[] signature, byte[] witness_script) { + byte[] ret = bindings.HTLCDescriptor_tx_input_witness(this.ptr, InternalUtils.check_arr_len(signature, 64), witness_script); + GC.KeepAlive(this); + GC.KeepAlive(signature); + GC.KeepAlive(witness_script); + return ret; + } + + /** + * Derives the channel signer required to sign the HTLC input. + */ + public WriteableEcdsaChannelSigner derive_channel_signer(org.ldk.structs.SignerProvider signer_provider) { + long ret = bindings.HTLCDescriptor_derive_channel_signer(this.ptr, signer_provider.ptr); + GC.KeepAlive(this); + GC.KeepAlive(signer_provider); + if (ret >= 0 && ret <= 4096) { return null; } + WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(signer_provider); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs b/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs index 61daf9b7..6a97cf9f 100644 --- a/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs +++ b/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs @@ -118,6 +118,7 @@ public class HTLCOutputInCommitment : CommonBase { bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -133,6 +134,7 @@ public class HTLCOutputInCommitment : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(transaction_output_index_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Hostname.cs b/c_sharp/src/org/ldk/structs/Hostname.cs index 4a7bc42d..098c217f 100644 --- a/c_sharp/src/org/ldk/structs/Hostname.cs +++ b/c_sharp/src/org/ldk/structs/Hostname.cs @@ -11,7 +11,9 @@ namespace org { namespace ldk { namespace structs { * Only the character set and length will be validated. * The character set consists of ASCII alphanumeric characters, hyphens, and periods. * Its length is guaranteed to be representable by a single byte. - * This serialization is used by BOLT 7 hostnames. + * This serialization is used by [`BOLT 7`] hostnames. + * + * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md */ public class Hostname : CommonBase { internal Hostname(object _dummy, long ptr) : base(ptr) { } @@ -63,5 +65,25 @@ public class Hostname : CommonBase { return ret; } + /** + * Serialize the Hostname object into a byte array which can be read by Hostname_read + */ + public byte[] write() { + byte[] ret = bindings.Hostname_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a Hostname from a byte array, created by Hostname_write + */ + public static Result_HostnameDecodeErrorZ read(byte[] ser) { + long ret = bindings.Hostname_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs b/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs index be9e213c..070d25ac 100644 --- a/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/IgnoringMessageHandler.cs @@ -79,6 +79,19 @@ public class IgnoringMessageHandler : CommonBase { return ret_hu_conv; } + /** + * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is + */ + public OffersMessageHandler as_OffersMessageHandler() { + long ret = bindings.IgnoringMessageHandler_as_OffersMessageHandler(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + OffersMessageHandler ret_hu_conv = new OffersMessageHandler(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is diff --git a/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs b/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs index 0e956560..ef9bb6f6 100644 --- a/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs +++ b/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs @@ -45,6 +45,32 @@ public class InFlightHtlcs : CommonBase { return ret_hu_conv; } + /** + * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`. + */ + public void process_path(org.ldk.structs.Path path, byte[] payer_node_id) { + bindings.InFlightHtlcs_process_path(this.ptr, path == null ? 0 : path.ptr, InternalUtils.check_arr_len(payer_node_id, 33)); + GC.KeepAlive(this); + GC.KeepAlive(path); + GC.KeepAlive(payer_node_id); + if (this != null) { this.ptrs_to.AddLast(path); }; + } + + /** + * Adds a known HTLC given the public key of the HTLC source, target, and short channel + * id. + */ + public void add_inflight_htlc(org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, long channel_scid, long used_msat) { + bindings.InFlightHtlcs_add_inflight_htlc(this.ptr, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, channel_scid, used_msat); + GC.KeepAlive(this); + GC.KeepAlive(source); + GC.KeepAlive(target); + GC.KeepAlive(channel_scid); + GC.KeepAlive(used_msat); + if (this != null) { this.ptrs_to.AddLast(source); }; + if (this != null) { this.ptrs_to.AddLast(target); }; + } + /** * Returns liquidity in msat given the public key of the HTLC source, target, and short channel * id. diff --git a/c_sharp/src/org/ldk/structs/InMemorySigner.cs b/c_sharp/src/org/ldk/structs/InMemorySigner.cs index 830fa1f6..bf18391a 100644 --- a/c_sharp/src/org/ldk/structs/InMemorySigner.cs +++ b/c_sharp/src/org/ldk/structs/InMemorySigner.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * A simple implementation of [`Sign`] that just keeps the private keys in memory. + * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory. * * This implementation performs no policy checks and is insufficient by itself as * a secure external signer. @@ -149,9 +149,8 @@ public class InMemorySigner : CommonBase { /** * Creates a new [`InMemorySigner`]. */ - public static InMemorySigner of(byte[] node_secret, byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id) { - long ret = bindings.InMemorySigner_new(InternalUtils.check_arr_len(node_secret, 32), InternalUtils.check_arr_len(funding_key, 32), InternalUtils.check_arr_len(revocation_base_key, 32), InternalUtils.check_arr_len(payment_key, 32), InternalUtils.check_arr_len(delayed_payment_base_key, 32), InternalUtils.check_arr_len(htlc_base_key, 32), InternalUtils.check_arr_len(commitment_seed, 32), channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); - GC.KeepAlive(node_secret); + public static InMemorySigner of(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id, byte[] rand_bytes_unique_start) { + long ret = bindings.InMemorySigner_new(InternalUtils.check_arr_len(funding_key, 32), InternalUtils.check_arr_len(revocation_base_key, 32), InternalUtils.check_arr_len(payment_key, 32), InternalUtils.check_arr_len(delayed_payment_base_key, 32), InternalUtils.check_arr_len(htlc_base_key, 32), InternalUtils.check_arr_len(commitment_seed, 32), channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32), InternalUtils.check_arr_len(rand_bytes_unique_start, 32)); GC.KeepAlive(funding_key); GC.KeepAlive(revocation_base_key); GC.KeepAlive(payment_key); @@ -160,6 +159,7 @@ public class InMemorySigner : CommonBase { GC.KeepAlive(commitment_seed); GC.KeepAlive(channel_value_satoshis); GC.KeepAlive(channel_keys_id); + GC.KeepAlive(rand_bytes_unique_start); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InMemorySigner(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -169,7 +169,7 @@ public class InMemorySigner : CommonBase { /** * Returns the counterparty's pubkeys. * - * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. + * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before. */ public ChannelPublicKeys counterparty_pubkeys() { long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr); @@ -185,7 +185,7 @@ public class InMemorySigner : CommonBase { * transactions, i.e., the amount of time that we have to wait to recover our funds if we * broadcast a transaction. * - * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. + * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before. */ public short counterparty_selected_contest_delay() { short ret = bindings.InMemorySigner_counterparty_selected_contest_delay(this.ptr); @@ -198,7 +198,7 @@ public class InMemorySigner : CommonBase { * by our counterparty, i.e., the amount of time that they have to wait to recover their funds * if they broadcast a transaction. * - * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. + * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before. */ public short holder_selected_contest_delay() { short ret = bindings.InMemorySigner_holder_selected_contest_delay(this.ptr); @@ -209,7 +209,7 @@ public class InMemorySigner : CommonBase { /** * Returns whether the holder is the initiator. * - * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. + * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before. */ public bool is_outbound() { bool ret = bindings.InMemorySigner_is_outbound(this.ptr); @@ -220,7 +220,7 @@ public class InMemorySigner : CommonBase { /** * Funding outpoint * - * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. + * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before. */ public OutPoint funding_outpoint() { long ret = bindings.InMemorySigner_funding_outpoint(this.ptr); @@ -235,7 +235,7 @@ public class InMemorySigner : CommonBase { * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or * building transactions. * - * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. + * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before. */ public ChannelTransactionParameters get_channel_parameters() { long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr); @@ -247,14 +247,18 @@ public class InMemorySigner : CommonBase { } /** - * Returns whether anchors should be used. + * Returns the channel type features of the channel parameters. Should be helpful for + * determining a channel's category, i. e. legacy/anchors/taproot/etc. * - * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. + * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before. */ - public bool opt_anchors() { - bool ret = bindings.InMemorySigner_opt_anchors(this.ptr); + public ChannelTypeFeatures channel_type_features() { + long ret = bindings.InMemorySigner_channel_type_features(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** @@ -304,27 +308,53 @@ public class InMemorySigner : CommonBase { } /** - * Constructs a new BaseSign which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is + * Constructs a new EntropySource which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is + */ + public EntropySource as_EntropySource() { + long ret = bindings.InMemorySigner_as_EntropySource(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + EntropySource ret_hu_conv = new EntropySource(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new ChannelSigner which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is + */ + public ChannelSigner as_ChannelSigner() { + long ret = bindings.InMemorySigner_as_ChannelSigner(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelSigner ret_hu_conv = new ChannelSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is */ - public BaseSign as_BaseSign() { - long ret = bindings.InMemorySigner_as_BaseSign(this.ptr); + public EcdsaChannelSigner as_EcdsaChannelSigner() { + long ret = bindings.InMemorySigner_as_EcdsaChannelSigner(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - BaseSign ret_hu_conv = new BaseSign(null, ret); + EcdsaChannelSigner ret_hu_conv = new EcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** - * Constructs a new Sign which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is + * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is */ - public Sign as_Sign() { - long ret = bindings.InMemorySigner_as_Sign(this.ptr); + public WriteableEcdsaChannelSigner as_WriteableEcdsaChannelSigner() { + long ret = bindings.InMemorySigner_as_WriteableEcdsaChannelSigner(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - Sign ret_hu_conv = new Sign(null, ret); + WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -341,12 +371,13 @@ public class InMemorySigner : CommonBase { /** * Read a InMemorySigner from a byte array, created by InMemorySigner_write */ - public static Result_InMemorySignerDecodeErrorZ read(byte[] ser, byte[] arg) { - long ret = bindings.InMemorySigner_read(ser, InternalUtils.check_arr_len(arg, 32)); + public static Result_InMemorySignerDecodeErrorZ read(byte[] ser, org.ldk.structs.EntropySource arg) { + long ret = bindings.InMemorySigner_read(ser, arg.ptr); GC.KeepAlive(ser); GC.KeepAlive(arg); if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Init.cs b/c_sharp/src/org/ldk/structs/Init.cs index d4d1fe38..eece3cbe 100644 --- a/c_sharp/src/org/ldk/structs/Init.cs +++ b/c_sharp/src/org/ldk/structs/Init.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An init message to be sent or received from a peer + * An [`init`] message to be sent to or received from a peer. + * + * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message */ public class Init : CommonBase { internal Init(object _dummy, long ptr) : base(ptr) { } @@ -16,7 +18,7 @@ public class Init : CommonBase { } /** - * The relevant features which the sender supports + * The relevant features which the sender supports. */ public InitFeatures get_features() { long ret = bindings.Init_get_features(this.ptr); @@ -28,7 +30,7 @@ public class Init : CommonBase { } /** - * The relevant features which the sender supports + * The relevant features which the sender supports. */ public void set_features(org.ldk.structs.InitFeatures val) { bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr); @@ -38,10 +40,40 @@ public class Init : CommonBase { } /** - * The receipient's network address. This adds the option to report a remote IP address - * back to a connecting peer using the init message. A node can decide to use that information - * to discover a potential update to its public IPv4 address (NAT) and use - * that for a node_announcement update message containing the new address. + * Indicates chains the sender is interested in. + * + * If there are no common chains, the connection will be closed. + * + * Returns a copy of the field. + */ + public Option_CVec_ChainHashZZ get_networks() { + long ret = bindings.Init_get_networks(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_ChainHashZZ ret_hu_conv = org.ldk.structs.Option_CVec_ChainHashZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Indicates chains the sender is interested in. + * + * If there are no common chains, the connection will be closed. + */ + public void set_networks(org.ldk.structs.Option_CVec_ChainHashZZ val) { + bindings.Init_set_networks(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The receipient's network address. + * + * This adds the option to report a remote IP address back to a connecting peer using the init + * message. A node can decide to use that information to discover a potential update to its + * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing + * the new address. */ public Option_NetAddressZ get_remote_network_address() { long ret = bindings.Init_get_remote_network_address(this.ptr); @@ -53,28 +85,34 @@ public class Init : CommonBase { } /** - * The receipient's network address. This adds the option to report a remote IP address - * back to a connecting peer using the init message. A node can decide to use that information - * to discover a potential update to its public IPv4 address (NAT) and use - * that for a node_announcement update message containing the new address. + * The receipient's network address. + * + * This adds the option to report a remote IP address back to a connecting peer using the init + * message. A node can decide to use that information to discover a potential update to its + * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing + * the new address. */ public void set_remote_network_address(org.ldk.structs.Option_NetAddressZ val) { bindings.Init_set_remote_network_address(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** * Constructs a new Init given each field */ - public static Init of(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.Option_NetAddressZ remote_network_address_arg) { - long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr, remote_network_address_arg.ptr); + public static Init of(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.Option_CVec_ChainHashZZ networks_arg, org.ldk.structs.Option_NetAddressZ remote_network_address_arg) { + long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr, networks_arg.ptr, remote_network_address_arg.ptr); GC.KeepAlive(features_arg); + GC.KeepAlive(networks_arg); GC.KeepAlive(remote_network_address_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Init(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(networks_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(remote_network_address_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/InitFeatures.cs b/c_sharp/src/org/ldk/structs/InitFeatures.cs index ae6660a3..9c2d9e13 100644 --- a/c_sharp/src/org/ldk/structs/InitFeatures.cs +++ b/c_sharp/src/org/ldk/structs/InitFeatures.cs @@ -61,6 +61,17 @@ public class InitFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.InitFeatures other) { + bool ret = bindings.InitFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -71,6 +82,42 @@ public class InitFeatures : CommonBase { return ret; } + /** + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.InitFeatures_set_required_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.InitFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read */ @@ -388,6 +435,74 @@ public class InitFeatures : CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_anchors_nonzero_fee_htlc_tx_optional() { + bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_anchors_nonzero_fee_htlc_tx_required() { + bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_anchors_nonzero_fee_htlc_tx() { + bool ret = bindings.InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_anchors_nonzero_fee_htlc_tx() { + bool ret = bindings.InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_anchors_zero_fee_htlc_tx_optional() { + bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_anchors_zero_fee_htlc_tx_required() { + bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_anchors_zero_fee_htlc_tx() { + bool ret = bindings.InitFeatures_supports_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_anchors_zero_fee_htlc_tx() { + bool ret = bindings.InitFeatures_requires_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Set this feature as optional. */ diff --git a/c_sharp/src/org/ldk/structs/Input.cs b/c_sharp/src/org/ldk/structs/Input.cs new file mode 100644 index 00000000..b5d1084a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Input.cs @@ -0,0 +1,147 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An input that must be included in a transaction when performing coin selection through + * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it + * must have an empty [`TxIn::script_sig`] when spent. + */ +public class Input : CommonBase { + internal Input(object _dummy, long ptr) : base(ptr) { } + ~Input() { + if (ptr != 0) { bindings.Input_free(ptr); } + } + + /** + * The unique identifier of the input. + */ + public OutPoint get_outpoint() { + long ret = bindings.Input_get_outpoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The unique identifier of the input. + */ + public void set_outpoint(org.ldk.structs.OutPoint val) { + bindings.Input_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The UTXO being spent by the input. + */ + public TxOut get_previous_utxo() { + long ret = bindings.Input_get_previous_utxo(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TxOut ret_conv = new TxOut(null, ret); + return ret_conv; + } + + /** + * The UTXO being spent by the input. + */ + public void set_previous_utxo(org.ldk.structs.TxOut val) { + bindings.Input_set_previous_utxo(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and + * [`TxIn::witness`], each with their lengths included, required to satisfy the output's + * script. + */ + public long get_satisfaction_weight() { + long ret = bindings.Input_get_satisfaction_weight(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and + * [`TxIn::witness`], each with their lengths included, required to satisfy the output's + * script. + */ + public void set_satisfaction_weight(long val) { + bindings.Input_set_satisfaction_weight(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new Input given each field + */ + public static Input of(org.ldk.structs.OutPoint outpoint_arg, org.ldk.structs.TxOut previous_utxo_arg, long satisfaction_weight_arg) { + long ret = bindings.Input_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, previous_utxo_arg.ptr, satisfaction_weight_arg); + GC.KeepAlive(outpoint_arg); + GC.KeepAlive(previous_utxo_arg); + GC.KeepAlive(satisfaction_weight_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Input ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Input(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.Input_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Input + */ + public Input clone() { + long ret = bindings.Input_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Input ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Input(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the Input. + */ + public long hash() { + long ret = bindings.Input_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two Inputs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Input b) { + bool ret = bindings.Input_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Input)) return false; + return this.eq((Input)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Invoice.cs b/c_sharp/src/org/ldk/structs/Invoice.cs deleted file mode 100644 index e07e31b9..00000000 --- a/c_sharp/src/org/ldk/structs/Invoice.cs +++ /dev/null @@ -1,310 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Represents a syntactically and semantically correct lightning BOLT11 invoice. - * - * There are three ways to construct an `Invoice`: - * 1. using `InvoiceBuilder` - * 2. using `Invoice::from_signed(SignedRawInvoice)` - * 3. using `str::parse::(&str)` - */ -public class Invoice : CommonBase { - internal Invoice(object _dummy, long ptr) : base(ptr) { } - ~Invoice() { - if (ptr != 0) { bindings.Invoice_free(ptr); } - } - - /** - * Checks if two Invoices contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public bool eq(org.ldk.structs.Invoice b) { - bool ret = bindings.Invoice_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - if (this != null) { this.ptrs_to.AddLast(b); }; - return ret; - } - - public override bool Equals(object o) { - if (!(o is Invoice)) return false; - return this.eq((Invoice)o); - } - internal long clone_ptr() { - long ret = bindings.Invoice_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the Invoice - */ - public Invoice clone() { - long ret = bindings.Invoice_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Invoice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Checks if two Invoices contain equal inner contents. - */ - public long hash() { - long ret = bindings.Invoice_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public override int GetHashCode() { - return (int)this.hash(); - } - /** - * Transform the `Invoice` into it's unchecked version - */ - public SignedRawInvoice into_signed_raw() { - long ret = bindings.Invoice_into_signed_raw(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawInvoice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Check that the invoice is signed correctly and that key recovery works - */ - public Result_NoneSemanticErrorZ check_signature() { - long ret = bindings.Invoice_check_signature(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants. - * ``` - * use lightning_invoice::*; - * - * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\ - * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\ - * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\ - * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\ - * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\ - * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\ - * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\ - * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\ - * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\ - * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\ - * j5r6drg6k6zcqj0fcwg\"; - * - * let signed = invoice.parse::().unwrap(); - * - * assert!(Invoice::from_signed(signed).is_ok()); - * ``` - */ - public static Result_InvoiceSemanticErrorZ from_signed(org.ldk.structs.SignedRawInvoice signed_invoice) { - long ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr); - GC.KeepAlive(signed_invoice); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(signed_invoice); }; - return ret_hu_conv; - } - - /** - * Returns the `Invoice`'s timestamp (should equal its creation time) - */ - public long timestamp() { - long ret = bindings.Invoice_timestamp(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns the `Invoice`'s timestamp as a duration since the Unix epoch - */ - public long duration_since_epoch() { - long ret = bindings.Invoice_duration_since_epoch(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns the hash to which we will receive the preimage on completion of the payment - */ - public byte[] payment_hash() { - byte[] ret = bindings.Invoice_payment_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Get the payee's public key if one was included in the invoice - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public byte[] payee_pub_key() { - byte[] ret = bindings.Invoice_payee_pub_key(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Get the payment secret if one was included in the invoice - */ - public byte[] payment_secret() { - byte[] ret = bindings.Invoice_payment_secret(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Get the invoice features if they were included in the invoice - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public InvoiceFeatures features() { - long ret = bindings.Invoice_features(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Recover the payee's public key (only to be used if none was included in the invoice) - */ - public byte[] recover_payee_pub_key() { - byte[] ret = bindings.Invoice_recover_payee_pub_key(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`]. - */ - public long expiry_time() { - long ret = bindings.Invoice_expiry_time(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns whether the invoice has expired. - */ - public bool is_expired() { - bool ret = bindings.Invoice_is_expired(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns whether the expiry time would pass at the given point in time. - * `at_time` is the timestamp as a duration since the Unix epoch. - */ - public bool would_expire(long at_time) { - bool ret = bindings.Invoice_would_expire(this.ptr, at_time); - GC.KeepAlive(this); - GC.KeepAlive(at_time); - return ret; - } - - /** - * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise - * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`]. - */ - public long min_final_cltv_expiry() { - long ret = bindings.Invoice_min_final_cltv_expiry(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns a list of all routes included in the invoice - */ - public PrivateRoute[] private_routes() { - long[] ret = bindings.Invoice_private_routes(this.ptr); - GC.KeepAlive(this); - int ret_conv_14_len = ret.Length; - PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret_conv_14_len]; - for (int o = 0; o < ret_conv_14_len; o++) { - long ret_conv_14 = ret[o]; - org.ldk.structs.PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.PrivateRoute(null, ret_conv_14); } - if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_14_arr[o] = ret_conv_14_hu_conv; - } - return ret_conv_14_arr; - } - - /** - * Returns a list of all routes included in the invoice as the underlying hints - */ - public RouteHint[] route_hints() { - long[] ret = bindings.Invoice_route_hints(this.ptr); - GC.KeepAlive(this); - int ret_conv_11_len = ret.Length; - RouteHint[] ret_conv_11_arr = new RouteHint[ret_conv_11_len]; - for (int l = 0; l < ret_conv_11_len; l++) { - long ret_conv_11 = ret[l]; - org.ldk.structs.RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new org.ldk.structs.RouteHint(null, ret_conv_11); } - if (ret_conv_11_hu_conv != null) { ret_conv_11_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_11_arr[l] = ret_conv_11_hu_conv; - } - return ret_conv_11_arr; - } - - /** - * Returns the currency for which the invoice was issued - */ - public Currency currency() { - Currency ret = bindings.Invoice_currency(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns the amount if specified in the invoice as millisatoshis. - */ - public Option_u64Z amount_milli_satoshis() { - long ret = bindings.Invoice_amount_milli_satoshis(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Read a Invoice object from a string - */ - public static Result_InvoiceParseOrSemanticErrorZ from_str(string s) { - long ret = bindings.Invoice_from_str(s); - GC.KeepAlive(s); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Get the string representation of a Invoice object - */ - public string to_str() { - string ret = bindings.Invoice_to_str(this.ptr); - GC.KeepAlive(this); - return ret; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceError.cs b/c_sharp/src/org/ldk/structs/InvoiceError.cs new file mode 100644 index 00000000..36e7b87d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InvoiceError.cs @@ -0,0 +1,129 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`]. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ +public class InvoiceError : CommonBase { + internal InvoiceError(object _dummy, long ptr) : base(ptr) { } + ~InvoiceError() { + if (ptr != 0) { bindings.InvoiceError_free(ptr); } + } + + /** + * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ErroneousField get_erroneous_field() { + long ret = bindings.InvoiceError_get_erroneous_field(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_erroneous_field(org.ldk.structs.ErroneousField val) { + bindings.InvoiceError_set_erroneous_field(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * An explanation of the error. + */ + public UntrustedString get_message() { + long ret = bindings.InvoiceError_get_message(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UntrustedString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UntrustedString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * An explanation of the error. + */ + public void set_message(org.ldk.structs.UntrustedString val) { + bindings.InvoiceError_set_message(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new InvoiceError given each field + */ + public static InvoiceError of(org.ldk.structs.ErroneousField erroneous_field_arg, org.ldk.structs.UntrustedString message_arg) { + long ret = bindings.InvoiceError_new(erroneous_field_arg == null ? 0 : erroneous_field_arg.ptr, message_arg == null ? 0 : message_arg.ptr); + GC.KeepAlive(erroneous_field_arg); + GC.KeepAlive(message_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceError(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(erroneous_field_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.InvoiceError_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the InvoiceError + */ + public InvoiceError clone() { + long ret = bindings.InvoiceError_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceError(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read + */ + public byte[] write() { + byte[] ret = bindings.InvoiceError_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a InvoiceError from a byte array, created by InvoiceError_write + */ + public static Result_InvoiceErrorDecodeErrorZ read(byte[] ser) { + long ret = bindings.InvoiceError_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceFeatures.cs b/c_sharp/src/org/ldk/structs/InvoiceFeatures.cs deleted file mode 100644 index 516e5271..00000000 --- a/c_sharp/src/org/ldk/structs/InvoiceFeatures.cs +++ /dev/null @@ -1,197 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Features used within an invoice. - */ -public class InvoiceFeatures : CommonBase { - internal InvoiceFeatures(object _dummy, long ptr) : base(ptr) { } - ~InvoiceFeatures() { - if (ptr != 0) { bindings.InvoiceFeatures_free(ptr); } - } - - /** - * Checks if two InvoiceFeaturess contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public bool eq(org.ldk.structs.InvoiceFeatures b) { - bool ret = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - if (this != null) { this.ptrs_to.AddLast(b); }; - return ret; - } - - public override bool Equals(object o) { - if (!(o is InvoiceFeatures)) return false; - return this.eq((InvoiceFeatures)o); - } - internal long clone_ptr() { - long ret = bindings.InvoiceFeatures_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the InvoiceFeatures - */ - public InvoiceFeatures clone() { - long ret = bindings.InvoiceFeatures_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Create a blank Features with no features set - */ - public static InvoiceFeatures empty() { - long ret = bindings.InvoiceFeatures_empty(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Returns true if this `Features` object contains unknown feature flags which are set as - * \"required\". - */ - public bool requires_unknown_bits() { - bool ret = bindings.InvoiceFeatures_requires_unknown_bits(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read - */ - public byte[] write() { - byte[] ret = bindings.InvoiceFeatures_write(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write - */ - public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.InvoiceFeatures_read(ser); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Set this feature as optional. - */ - public void set_variable_length_onion_optional() { - bindings.InvoiceFeatures_set_variable_length_onion_optional(this.ptr); - GC.KeepAlive(this); - } - - /** - * Set this feature as required. - */ - public void set_variable_length_onion_required() { - bindings.InvoiceFeatures_set_variable_length_onion_required(this.ptr); - GC.KeepAlive(this); - } - - /** - * Checks if this feature is supported. - */ - public bool supports_variable_length_onion() { - bool ret = bindings.InvoiceFeatures_supports_variable_length_onion(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Checks if this feature is required. - */ - public bool requires_variable_length_onion() { - bool ret = bindings.InvoiceFeatures_requires_variable_length_onion(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Set this feature as optional. - */ - public void set_payment_secret_optional() { - bindings.InvoiceFeatures_set_payment_secret_optional(this.ptr); - GC.KeepAlive(this); - } - - /** - * Set this feature as required. - */ - public void set_payment_secret_required() { - bindings.InvoiceFeatures_set_payment_secret_required(this.ptr); - GC.KeepAlive(this); - } - - /** - * Checks if this feature is supported. - */ - public bool supports_payment_secret() { - bool ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Checks if this feature is required. - */ - public bool requires_payment_secret() { - bool ret = bindings.InvoiceFeatures_requires_payment_secret(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Set this feature as optional. - */ - public void set_basic_mpp_optional() { - bindings.InvoiceFeatures_set_basic_mpp_optional(this.ptr); - GC.KeepAlive(this); - } - - /** - * Set this feature as required. - */ - public void set_basic_mpp_required() { - bindings.InvoiceFeatures_set_basic_mpp_required(this.ptr); - GC.KeepAlive(this); - } - - /** - * Checks if this feature is supported. - */ - public bool supports_basic_mpp() { - bool ret = bindings.InvoiceFeatures_supports_basic_mpp(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Checks if this feature is required. - */ - public bool requires_basic_mpp() { - bool ret = bindings.InvoiceFeatures_requires_basic_mpp(this.ptr); - GC.KeepAlive(this); - return ret; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/InvoicePayer.cs b/c_sharp/src/org/ldk/structs/InvoicePayer.cs deleted file mode 100644 index 8c8009ac..00000000 --- a/c_sharp/src/org/ldk/structs/InvoicePayer.cs +++ /dev/null @@ -1,205 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A utility for paying [`Invoice`]s and sending spontaneous payments. - * - * See [module-level documentation] for details. - * - * [module-level documentation]: crate::payment - */ -public class InvoicePayer : CommonBase { - internal InvoicePayer(object _dummy, long ptr) : base(ptr) { } - ~InvoicePayer() { - if (ptr != 0) { bindings.InvoicePayer_free(ptr); } - } - - /** - * Creates an invoice payer that retries failed payment paths. - * - * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once - * `retry` has been exceeded for a given [`Invoice`]. - */ - public static InvoicePayer of(org.ldk.structs.Payer payer, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EventHandler event_handler, org.ldk.structs.Retry retry) { - long ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry.ptr); - GC.KeepAlive(payer); - GC.KeepAlive(router); - GC.KeepAlive(logger); - GC.KeepAlive(event_handler); - GC.KeepAlive(retry); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoicePayer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoicePayer(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payer); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(router); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(event_handler); }; - return ret_hu_conv; - } - - /** - * Pays the given [`Invoice`], caching it for later use in case a retry is needed. - * - * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long - * as the payment is still pending. Once the payment completes or fails, you must ensure that - * a second payment with the same [`PaymentHash`] is never sent. - * - * If you wish to use a different payment idempotency token, see - * [`Self::pay_invoice_with_id`]. - */ - public Result_PaymentIdPaymentErrorZ pay_invoice(org.ldk.structs.Invoice invoice) { - long ret = bindings.InvoicePayer_pay_invoice(this.ptr, invoice == null ? 0 : invoice.ptr); - GC.KeepAlive(this); - GC.KeepAlive(invoice); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(invoice); }; - return ret_hu_conv; - } - - /** - * Pays the given [`Invoice`] with a custom idempotency key, caching the invoice for later use - * in case a retry is needed. - * - * Note that idempotency is only guaranteed as long as the payment is still pending. Once the - * payment completes or fails, no idempotency guarantees are made. - * - * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`] - * has never been paid before. - * - * See [`Self::pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency - * token. - */ - public Result_NonePaymentErrorZ pay_invoice_with_id(org.ldk.structs.Invoice invoice, byte[] payment_id) { - long ret = bindings.InvoicePayer_pay_invoice_with_id(this.ptr, invoice == null ? 0 : invoice.ptr, InternalUtils.check_arr_len(payment_id, 32)); - GC.KeepAlive(this); - GC.KeepAlive(invoice); - GC.KeepAlive(payment_id); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(invoice); }; - return ret_hu_conv; - } - - /** - * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in - * case a retry is needed. - * - * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long - * as the payment is still pending. Once the payment completes or fails, you must ensure that - * a second payment with the same [`PaymentHash`] is never sent. - * - * If you wish to use a different payment idempotency token, see - * [`Self::pay_zero_value_invoice_with_id`]. - */ - public Result_PaymentIdPaymentErrorZ pay_zero_value_invoice(org.ldk.structs.Invoice invoice, long amount_msats) { - long ret = bindings.InvoicePayer_pay_zero_value_invoice(this.ptr, invoice == null ? 0 : invoice.ptr, amount_msats); - GC.KeepAlive(this); - GC.KeepAlive(invoice); - GC.KeepAlive(amount_msats); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(invoice); }; - return ret_hu_conv; - } - - /** - * Pays the given zero-value [`Invoice`] using the given amount and custom idempotency key, - * caching the invoice for later use in case a retry is needed. - * - * Note that idempotency is only guaranteed as long as the payment is still pending. Once the - * payment completes or fails, no idempotency guarantees are made. - * - * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`] - * has never been paid before. - * - * See [`Self::pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the - * idempotency token. - */ - public Result_NonePaymentErrorZ pay_zero_value_invoice_with_id(org.ldk.structs.Invoice invoice, long amount_msats, byte[] payment_id) { - long ret = bindings.InvoicePayer_pay_zero_value_invoice_with_id(this.ptr, invoice == null ? 0 : invoice.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32)); - GC.KeepAlive(this); - GC.KeepAlive(invoice); - GC.KeepAlive(amount_msats); - GC.KeepAlive(payment_id); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(invoice); }; - return ret_hu_conv; - } - - /** - * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in - * case a retry is needed. - * - * The hash of the [`PaymentPreimage`] is used as the [`PaymentId`], which ensures idempotency - * as long as the payment is still pending. Once the payment completes or fails, you must - * ensure that a second payment with the same [`PaymentPreimage`] is never sent. - */ - public Result_PaymentIdPaymentErrorZ pay_pubkey(byte[] pubkey, byte[] payment_preimage, long amount_msats, int final_cltv_expiry_delta) { - long ret = bindings.InvoicePayer_pay_pubkey(this.ptr, InternalUtils.check_arr_len(pubkey, 33), InternalUtils.check_arr_len(payment_preimage, 32), amount_msats, final_cltv_expiry_delta); - GC.KeepAlive(this); - GC.KeepAlive(pubkey); - GC.KeepAlive(payment_preimage); - GC.KeepAlive(amount_msats); - GC.KeepAlive(final_cltv_expiry_delta); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Pays `pubkey` an amount using the hash of the given preimage and a custom idempotency key, - * caching the invoice for later use in case a retry is needed. - * - * Note that idempotency is only guaranteed as long as the payment is still pending. Once the - * payment completes or fails, no idempotency guarantees are made. - * - * You should ensure that the [`PaymentPreimage`] is unique and the corresponding - * [`PaymentHash`] has never been paid before. - */ - public Result_NonePaymentErrorZ pay_pubkey_with_id(byte[] pubkey, byte[] payment_preimage, byte[] payment_id, long amount_msats, int final_cltv_expiry_delta) { - long ret = bindings.InvoicePayer_pay_pubkey_with_id(this.ptr, InternalUtils.check_arr_len(pubkey, 33), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_id, 32), amount_msats, final_cltv_expiry_delta); - GC.KeepAlive(this); - GC.KeepAlive(pubkey); - GC.KeepAlive(payment_preimage); - GC.KeepAlive(payment_id); - GC.KeepAlive(amount_msats); - GC.KeepAlive(final_cltv_expiry_delta); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Removes the payment cached by the given payment hash. - * - * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an - * [`EventHandler`]. Otherwise, calling this method is unnecessary. - */ - public void remove_cached_payment(byte[] payment_hash) { - bindings.InvoicePayer_remove_cached_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32)); - GC.KeepAlive(this); - GC.KeepAlive(payment_hash); - } - - /** - * Constructs a new EventHandler which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is - */ - public EventHandler as_EventHandler() { - long ret = bindings.InvoicePayer_as_EventHandler(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - EventHandler ret_hu_conv = new EventHandler(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequest.cs b/c_sharp/src/org/ldk/structs/InvoiceRequest.cs new file mode 100644 index 00000000..38cc22ff --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InvoiceRequest.cs @@ -0,0 +1,153 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`]. + * + * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request + * specifies these such that its recipient can send an invoice for payment. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Offer`]: crate::offers::offer::Offer + */ +public class InvoiceRequest : CommonBase { + internal InvoiceRequest(object _dummy, long ptr) : base(ptr) { } + ~InvoiceRequest() { + if (ptr != 0) { bindings.InvoiceRequest_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.InvoiceRequest_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the InvoiceRequest + */ + public InvoiceRequest clone() { + long ret = bindings.InvoiceRequest_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequest ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequest(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * An unpredictable series of bytes, typically containing information about the derivation of + * [`payer_id`]. + * + * [`payer_id`]: Self::payer_id + */ + public byte[] metadata() { + byte[] ret = bindings.InvoiceRequest_metadata(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A chain from [`Offer::chains`] that the offer is valid for. + */ + public byte[] chain() { + byte[] ret = bindings.InvoiceRequest_chain(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which + * must be greater than or equal to [`Offer::amount`], converted if necessary. + * + * [`chain`]: Self::chain + */ + public Option_u64Z amount_msats() { + long ret = bindings.InvoiceRequest_amount_msats(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Features pertaining to requesting an invoice. + */ + public InvoiceRequestFeatures features() { + long ret = bindings.InvoiceRequest_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`]. + */ + public Option_u64Z quantity() { + long ret = bindings.InvoiceRequest_quantity(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A possibly transient pubkey used to sign the invoice request. + */ + public byte[] payer_id() { + byte[] ret = bindings.InvoiceRequest_payer_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A payer-provided note which will be seen by the recipient and reflected back in the invoice + * response. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public PrintableString payer_note() { + long ret = bindings.InvoiceRequest_payer_note(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Verifies that the request was for an offer created using the given key. Returns the derived + * keys need to sign an [`Bolt12Invoice`] for the request if they could be extracted from the + * metadata. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public Result_COption_KeyPairZNoneZ verify(org.ldk.structs.ExpandedKey key) { + long ret = bindings.InvoiceRequest_verify(this.ptr, key == null ? 0 : key.ptr); + GC.KeepAlive(this); + GC.KeepAlive(key); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_KeyPairZNoneZ ret_hu_conv = Result_COption_KeyPairZNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(key); }; + return ret_hu_conv; + } + + /** + * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read + */ + public byte[] write() { + byte[] ret = bindings.InvoiceRequest_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs b/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs index db8292dd..dfad8e85 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs @@ -61,6 +61,17 @@ public class InvoiceRequestFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.InvoiceRequestFeatures other) { + bool ret = bindings.InvoiceRequestFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -72,22 +83,38 @@ public class InvoiceRequestFeatures : CommonBase { } /** - * Serialize the InvoiceRequestFeatures object into a byte array which can be read by InvoiceRequestFeatures_read + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits */ - public byte[] write() { - byte[] ret = bindings.InvoiceRequestFeatures_write(this.ptr); + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.InvoiceRequestFeatures_set_required_custom_bit(this.ptr, bit); GC.KeepAlive(this); - return ret; + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; } /** - * Read a InvoiceRequestFeatures from a byte array, created by InvoiceRequestFeatures_write + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits */ - public static Result_InvoiceRequestFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.InvoiceRequestFeatures_read(ser); - GC.KeepAlive(ser); + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.InvoiceRequestFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.constr_from_ptr(ret); + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/InvoiceSignature.cs b/c_sharp/src/org/ldk/structs/InvoiceSignature.cs deleted file mode 100644 index ff903acc..00000000 --- a/c_sharp/src/org/ldk/structs/InvoiceSignature.cs +++ /dev/null @@ -1,66 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Recoverable signature - */ -public class InvoiceSignature : CommonBase { - internal InvoiceSignature(object _dummy, long ptr) : base(ptr) { } - ~InvoiceSignature() { - if (ptr != 0) { bindings.InvoiceSignature_free(ptr); } - } - - internal long clone_ptr() { - long ret = bindings.InvoiceSignature_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the InvoiceSignature - */ - public InvoiceSignature clone() { - long ret = bindings.InvoiceSignature_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Checks if two InvoiceSignatures contain equal inner contents. - */ - public long hash() { - long ret = bindings.InvoiceSignature_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public override int GetHashCode() { - return (int)this.hash(); - } - /** - * Checks if two InvoiceSignatures contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public bool eq(org.ldk.structs.InvoiceSignature b) { - bool ret = bindings.InvoiceSignature_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - if (this != null) { this.ptrs_to.AddLast(b); }; - return ret; - } - - public override bool Equals(object o) { - if (!(o is InvoiceSignature)) return false; - return this.eq((InvoiceSignature)o); - } -} -} } } diff --git a/c_sharp/src/org/ldk/structs/KeysInterface.cs b/c_sharp/src/org/ldk/structs/KeysInterface.cs deleted file mode 100644 index d942bb5f..00000000 --- a/c_sharp/src/org/ldk/structs/KeysInterface.cs +++ /dev/null @@ -1,419 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -/** - * A trait to describe an object which can get user secrets and key material. - */ -public class KeysInterface : CommonBase { - internal readonly bindings.LDKKeysInterface bindings_instance; - internal KeysInterface(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } - private KeysInterface(bindings.LDKKeysInterface arg) : base(bindings.LDKKeysInterface_new(arg)) { - this.ptrs_to.AddLast(arg); - this.bindings_instance = arg; - } - ~KeysInterface() { - if (ptr != 0) { bindings.KeysInterface_free(ptr); } - } - - public interface KeysInterfaceInterface { - /** - * Get node secret key based on the provided [`Recipient`]. - * - * The `node_id`/`network_key` is the public key that corresponds to this secret key. - * - * This method must return the same value each time it is called with a given [`Recipient`] - * parameter. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - */ - Result_SecretKeyNoneZ get_node_secret(Recipient _recipient); - /** - * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in - * [`get_node_secret`]. - * - * This method must return the same value each time it is called with a given [`Recipient`] - * parameter. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - * - * [`get_node_secret`]: Self::get_node_secret - */ - Result_PublicKeyNoneZ get_node_id(Recipient _recipient); - /** - * Gets the ECDH shared secret of our [`node secret`] and `other_key`, multiplying by `tweak` if - * one is provided. Note that this tweak can be applied to `other_key` instead of our node - * secret, though this is less efficient. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - * - * [`node secret`]: Self::get_node_secret - */ - Result_SharedSecretNoneZ ecdh(Recipient _recipient, byte[] _other_key, Option_ScalarZ _tweak); - /** - * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. - * - * This method should return a different value each time it is called, to avoid linking - * on-chain funds across channels as controlled to the same user. - */ - byte[] get_destination_script(); - /** - * Get a script pubkey which we will send funds to when closing a channel. - * - * This method should return a different value each time it is called, to avoid linking - * on-chain funds across channels as controlled to the same user. - */ - ShutdownScript get_shutdown_scriptpubkey(); - /** - * Get a new set of [`Sign`] for per-channel secrets. These MUST be unique even if you - * restarted with some stale data! - * - * This method must return a different value each time it is called. - */ - byte[] generate_channel_keys_id(bool _inbound, long _channel_value_satoshis, UInt128 _user_channel_id); - /** - * Derives the private key material backing a `Signer`. - * - * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through - * [`KeysInterface::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be - * re-derived from its `channel_keys_id`, which can be obtained through its trait method - * [`BaseSign::channel_keys_id`]. - */ - Sign derive_channel_signer(long _channel_value_satoshis, byte[] _channel_keys_id); - /** - * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting - * onion packets and for temporary channel IDs. There is no requirement that these be - * persisted anywhere, though they must be unique across restarts. - * - * This method must return a different value each time it is called. - */ - byte[] get_secure_random_bytes(); - /** - * Reads a [`Signer`] for this [`KeysInterface`] from the given input stream. - * This is only called during deserialization of other objects which contain - * [`Sign`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). - * The bytes are exactly those which `::write()` writes, and - * contain no versioning scheme. You may wish to include your own version prefix and ensure - * you've read all of the provided bytes to ensure no corruption occurred. - * - * This method is slowly being phased out -- it will only be called when reading objects - * written by LDK versions prior to 0.0.113. - * - * [`Signer`]: Self::Signer - * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - */ - Result_SignDecodeErrorZ read_chan_signer(byte[] _reader); - /** - * Sign an invoice. - * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of - * this trait to parse the invoice and make sure they're signing what they expect, rather than - * blindly signing the hash. - * The `hrp` is ASCII bytes, while the invoice data is base32-encoded. - * - * The secret key used to sign the invoice is dependent on the [`Recipient`]. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - */ - Result_RecoverableSignatureNoneZ sign_invoice(byte[] _hrp_bytes, UInt5[] _invoice_data, Recipient _receipient); - /** - * Get secret key material as bytes for use in encrypting and decrypting inbound payment data. - * - * If the implementor of this trait supports [phantom node payments], then every node that is - * intended to be included in the phantom invoice route hints must return the same value from - * this method. - * - * This method must return the same value each time it is called. - * - * [phantom node payments]: PhantomKeysManager - */ - byte[] get_inbound_payment_key_material(); - } - private class LDKKeysInterfaceHolder { internal KeysInterface held; } - private class LDKKeysInterfaceImpl : bindings.LDKKeysInterface { - internal LDKKeysInterfaceImpl(KeysInterfaceInterface arg, LDKKeysInterfaceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } - private KeysInterfaceInterface arg; - private LDKKeysInterfaceHolder impl_holder; - public long get_node_secret(Recipient _recipient) { - Result_SecretKeyNoneZ ret = arg.get_node_secret(_recipient); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long get_node_id(Recipient _recipient) { - Result_PublicKeyNoneZ ret = arg.get_node_id(_recipient); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long ecdh(Recipient _recipient, byte[] _other_key, long _tweak) { - org.ldk.structs.Option_ScalarZ _tweak_hu_conv = org.ldk.structs.Option_ScalarZ.constr_from_ptr(_tweak); - if (_tweak_hu_conv != null) { _tweak_hu_conv.ptrs_to.AddLast(this); }; - Result_SharedSecretNoneZ ret = arg.ecdh(_recipient, _other_key, _tweak_hu_conv); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public byte[] get_destination_script() { - byte[] ret = arg.get_destination_script(); - GC.KeepAlive(arg); - return ret; - } - public long get_shutdown_scriptpubkey() { - ShutdownScript ret = arg.get_shutdown_scriptpubkey(); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public byte[] generate_channel_keys_id(bool _inbound, long _channel_value_satoshis, byte[] _user_channel_id) { - org.ldk.util.UInt128 _user_channel_id_conv = new org.ldk.util.UInt128(_user_channel_id); - byte[] ret = arg.generate_channel_keys_id(_inbound, _channel_value_satoshis, _user_channel_id_conv); - GC.KeepAlive(arg); - byte[] result = InternalUtils.check_arr_len(ret, 32); - return result; - } - public long derive_channel_signer(long _channel_value_satoshis, byte[] _channel_keys_id) { - Sign ret = arg.derive_channel_signer(_channel_value_satoshis, _channel_keys_id); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; - return result; - } - public byte[] get_secure_random_bytes() { - byte[] ret = arg.get_secure_random_bytes(); - GC.KeepAlive(arg); - byte[] result = InternalUtils.check_arr_len(ret, 32); - return result; - } - public long read_chan_signer(byte[] _reader) { - Result_SignDecodeErrorZ ret = arg.read_chan_signer(_reader); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long sign_invoice(byte[] _hrp_bytes, byte[] _invoice_data, Recipient _receipient) { - int _invoice_data_conv_7_len = _invoice_data.Length; - UInt5[] _invoice_data_conv_7_arr = new UInt5[_invoice_data_conv_7_len]; - for (int h = 0; h < _invoice_data_conv_7_len; h++) { - byte _invoice_data_conv_7 = _invoice_data[h]; - UInt5 _invoice_data_conv_7_conv = new UInt5(_invoice_data_conv_7); - _invoice_data_conv_7_arr[h] = _invoice_data_conv_7_conv; - } - Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(_hrp_bytes, _invoice_data_conv_7_arr, _receipient); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public byte[] get_inbound_payment_key_material() { - byte[] ret = arg.get_inbound_payment_key_material(); - GC.KeepAlive(arg); - byte[] result = InternalUtils.check_arr_len(ret, 32); - return result; - } - } - public static KeysInterface new_impl(KeysInterfaceInterface arg) { - LDKKeysInterfaceHolder impl_holder = new LDKKeysInterfaceHolder(); - impl_holder.held = new KeysInterface(new LDKKeysInterfaceImpl(arg, impl_holder)); - return impl_holder.held; - } - /** - * Get node secret key based on the provided [`Recipient`]. - * - * The `node_id`/`network_key` is the public key that corresponds to this secret key. - * - * This method must return the same value each time it is called with a given [`Recipient`] - * parameter. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - */ - public Result_SecretKeyNoneZ get_node_secret(Recipient recipient) { - long ret = bindings.KeysInterface_get_node_secret(this.ptr, recipient); - GC.KeepAlive(this); - GC.KeepAlive(recipient); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyNoneZ ret_hu_conv = Result_SecretKeyNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in - * [`get_node_secret`]. - * - * This method must return the same value each time it is called with a given [`Recipient`] - * parameter. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - * - * [`get_node_secret`]: Self::get_node_secret - */ - public Result_PublicKeyNoneZ get_node_id(Recipient recipient) { - long ret = bindings.KeysInterface_get_node_id(this.ptr, recipient); - GC.KeepAlive(this); - GC.KeepAlive(recipient); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Gets the ECDH shared secret of our [`node secret`] and `other_key`, multiplying by `tweak` if - * one is provided. Note that this tweak can be applied to `other_key` instead of our node - * secret, though this is less efficient. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - * - * [`node secret`]: Self::get_node_secret - */ - public Result_SharedSecretNoneZ ecdh(Recipient recipient, byte[] other_key, org.ldk.structs.Option_ScalarZ tweak) { - long ret = bindings.KeysInterface_ecdh(this.ptr, recipient, InternalUtils.check_arr_len(other_key, 33), tweak.ptr); - GC.KeepAlive(this); - GC.KeepAlive(recipient); - GC.KeepAlive(other_key); - GC.KeepAlive(tweak); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SharedSecretNoneZ ret_hu_conv = Result_SharedSecretNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. - * - * This method should return a different value each time it is called, to avoid linking - * on-chain funds across channels as controlled to the same user. - */ - public byte[] get_destination_script() { - byte[] ret = bindings.KeysInterface_get_destination_script(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Get a script pubkey which we will send funds to when closing a channel. - * - * This method should return a different value each time it is called, to avoid linking - * on-chain funds across channels as controlled to the same user. - */ - public ShutdownScript get_shutdown_scriptpubkey() { - long ret = bindings.KeysInterface_get_shutdown_scriptpubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Get a new set of [`Sign`] for per-channel secrets. These MUST be unique even if you - * restarted with some stale data! - * - * This method must return a different value each time it is called. - */ - public byte[] generate_channel_keys_id(bool inbound, long channel_value_satoshis, org.ldk.util.UInt128 user_channel_id) { - byte[] ret = bindings.KeysInterface_generate_channel_keys_id(this.ptr, inbound, channel_value_satoshis, user_channel_id.getLEBytes()); - GC.KeepAlive(this); - GC.KeepAlive(inbound); - GC.KeepAlive(channel_value_satoshis); - GC.KeepAlive(user_channel_id); - return ret; - } - - /** - * Derives the private key material backing a `Signer`. - * - * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through - * [`KeysInterface::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be - * re-derived from its `channel_keys_id`, which can be obtained through its trait method - * [`BaseSign::channel_keys_id`]. - */ - public Sign derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { - long ret = bindings.KeysInterface_derive_channel_signer(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); - GC.KeepAlive(this); - GC.KeepAlive(channel_value_satoshis); - GC.KeepAlive(channel_keys_id); - if (ret >= 0 && ret <= 4096) { return null; } - Sign ret_hu_conv = new Sign(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting - * onion packets and for temporary channel IDs. There is no requirement that these be - * persisted anywhere, though they must be unique across restarts. - * - * This method must return a different value each time it is called. - */ - public byte[] get_secure_random_bytes() { - byte[] ret = bindings.KeysInterface_get_secure_random_bytes(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Reads a [`Signer`] for this [`KeysInterface`] from the given input stream. - * This is only called during deserialization of other objects which contain - * [`Sign`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). - * The bytes are exactly those which `::write()` writes, and - * contain no versioning scheme. You may wish to include your own version prefix and ensure - * you've read all of the provided bytes to ensure no corruption occurred. - * - * This method is slowly being phased out -- it will only be called when reading objects - * written by LDK versions prior to 0.0.113. - * - * [`Signer`]: Self::Signer - * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - */ - public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) { - long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader); - GC.KeepAlive(this); - GC.KeepAlive(reader); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Sign an invoice. - * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of - * this trait to parse the invoice and make sure they're signing what they expect, rather than - * blindly signing the hash. - * The `hrp` is ASCII bytes, while the invoice data is base32-encoded. - * - * The secret key used to sign the invoice is dependent on the [`Recipient`]. - * - * Errors if the [`Recipient`] variant is not supported by the implementation. - */ - public Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, Recipient receipient) { - long ret = bindings.KeysInterface_sign_invoice(this.ptr, hrp_bytes, invoice_data != null ? InternalUtils.convUInt5Array(invoice_data) : null, receipient); - GC.KeepAlive(this); - GC.KeepAlive(hrp_bytes); - GC.KeepAlive(invoice_data); - GC.KeepAlive(receipient); - if (ret >= 0 && ret <= 4096) { return null; } - Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Get secret key material as bytes for use in encrypting and decrypting inbound payment data. - * - * If the implementor of this trait supports [phantom node payments], then every node that is - * intended to be included in the phantom invoice route hints must return the same value from - * this method. - * - * This method must return the same value each time it is called. - * - * [phantom node payments]: PhantomKeysManager - */ - public byte[] get_inbound_payment_key_material() { - byte[] ret = bindings.KeysInterface_get_inbound_payment_key_material(this.ptr); - GC.KeepAlive(this); - return ret; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/KeysManager.cs b/c_sharp/src/org/ldk/structs/KeysManager.cs index 0fbd5f64..1edacca5 100644 --- a/c_sharp/src/org/ldk/structs/KeysManager.cs +++ b/c_sharp/src/org/ldk/structs/KeysManager.cs @@ -7,8 +7,8 @@ namespace org { namespace ldk { namespace structs { /** - * Simple [`KeysInterface`] implementation that takes a 32-byte seed for use as a BIP 32 extended - * key and derives keys from that. + * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a + * 32-byte seed for use as a BIP 32 extended key and derives keys from that. * * Your `node_id` is seed/0'. * Unilateral closes may use seed/1'. @@ -58,7 +58,16 @@ public class KeysManager : CommonBase { } /** - * Derive an old [`Sign`] containing per-channel secrets based on a key derivation parameters. + * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc. + */ + public byte[] get_node_secret_key() { + byte[] ret = bindings.KeysManager_get_node_secret_key(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters. */ public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] _params) { long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(_params, 32)); @@ -71,11 +80,37 @@ public class KeysManager : CommonBase { return ret_hu_conv; } + /** + * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s. + * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there + * are no other inputs that need signing. + * + * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign. + * + * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used + * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`]. + */ + public Result_PartiallySignedTransactionNoneZ sign_spendable_outputs_psbt(SpendableOutputDescriptor[] descriptors, byte[] psbt) { + long ret = bindings.KeysManager_sign_spendable_outputs_psbt(this.ptr, descriptors != null ? InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr) : null, psbt); + GC.KeepAlive(this); + GC.KeepAlive(descriptors); + GC.KeepAlive(psbt); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PartiallySignedTransactionNoneZ ret_hu_conv = Result_PartiallySignedTransactionNoneZ.constr_from_ptr(ret); + foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (this != null) { this.ptrs_to.AddLast(descriptors_conv_27); }; }; + return ret_hu_conv; + } + /** * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an * output to the given change destination (if sufficient change value remains). The * transaction will have a feerate, at least, of the given value. * + * The `locktime` argument is used to set the transaction's locktime. If `None`, the + * transaction will have a locktime of 0. It it recommended to set this to the current block + * height to avoid fee sniping, unless you have some specific reason to use a different + * locktime. + * * Returns `Err(())` if the output value is greater than the input value minus required fee, * if a descriptor was duplicated, or if an output descriptor `script_pubkey` * does not match the one we can spend. @@ -85,27 +120,56 @@ public class KeysManager : CommonBase { * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`]. */ - public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight) { - long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr) : null, outputs != null ? InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr) : null, change_destination_script, feerate_sat_per_1000_weight); + public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_PackedLockTimeZ locktime) { + long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr) : null, outputs != null ? InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr) : null, change_destination_script, feerate_sat_per_1000_weight, locktime.ptr); GC.KeepAlive(this); GC.KeepAlive(descriptors); GC.KeepAlive(outputs); GC.KeepAlive(change_destination_script); GC.KeepAlive(feerate_sat_per_1000_weight); + GC.KeepAlive(locktime); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (this != null) { this.ptrs_to.AddLast(descriptors_conv_27); }; }; + if (this != null) { this.ptrs_to.AddLast(locktime); }; + return ret_hu_conv; + } + + /** + * Constructs a new EntropySource which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is + */ + public EntropySource as_EntropySource() { + long ret = bindings.KeysManager_as_EntropySource(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + EntropySource ret_hu_conv = new EntropySource(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new NodeSigner which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is + */ + public NodeSigner as_NodeSigner() { + long ret = bindings.KeysManager_as_NodeSigner(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + NodeSigner ret_hu_conv = new NodeSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** - * Constructs a new KeysInterface which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is + * Constructs a new SignerProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is */ - public KeysInterface as_KeysInterface() { - long ret = bindings.KeysManager_as_KeysInterface(this.ptr); + public SignerProvider as_SignerProvider() { + long ret = bindings.KeysManager_as_SignerProvider(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - KeysInterface ret_hu_conv = new KeysInterface(null, ret); + SignerProvider ret_hu_conv = new SignerProvider(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/LightningError.cs b/c_sharp/src/org/ldk/structs/LightningError.cs index 4f5cc226..da6206ed 100644 --- a/c_sharp/src/org/ldk/structs/LightningError.cs +++ b/c_sharp/src/org/ldk/structs/LightningError.cs @@ -52,6 +52,7 @@ public class LightningError : CommonBase { bindings.LightningError_set_action(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -64,6 +65,7 @@ public class LightningError : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/LockableScore.cs b/c_sharp/src/org/ldk/structs/LockableScore.cs index 9e60c395..5a499b3c 100644 --- a/c_sharp/src/org/ldk/structs/LockableScore.cs +++ b/c_sharp/src/org/ldk/structs/LockableScore.cs @@ -40,7 +40,7 @@ public class LockableScore : CommonBase { public long do_lock() { Score ret = arg.do_lock(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.ptr; + long result = ret.ptr; if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } diff --git a/c_sharp/src/org/ldk/structs/MaxDustHTLCExposure.cs b/c_sharp/src/org/ldk/structs/MaxDustHTLCExposure.cs new file mode 100644 index 00000000..93491a4e --- /dev/null +++ b/c_sharp/src/org/ldk/structs/MaxDustHTLCExposure.cs @@ -0,0 +1,120 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Options for how to set the max dust HTLC exposure allowed on a channel. See + * [`ChannelConfig::max_dust_htlc_exposure`] for details. + */ +public class MaxDustHTLCExposure : CommonBase { + protected MaxDustHTLCExposure(object _dummy, long ptr) : base(ptr) { } + ~MaxDustHTLCExposure() { + if (ptr != 0) { bindings.MaxDustHTLCExposure_free(ptr); } + } + + internal static MaxDustHTLCExposure constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKMaxDustHTLCExposure_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new MaxDustHTLCExposure_FixedLimitMsat(ptr); + case 1: return new MaxDustHTLCExposure_FeeRateMultiplier(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A MaxDustHTLCExposure of type FixedLimitMsat */ + public class MaxDustHTLCExposure_FixedLimitMsat : MaxDustHTLCExposure { + public long fixed_limit_msat; + internal MaxDustHTLCExposure_FixedLimitMsat(long ptr) : base(null, ptr) { + this.fixed_limit_msat = bindings.LDKMaxDustHTLCExposure_FixedLimitMsat_get_fixed_limit_msat(ptr); + } + } + /** A MaxDustHTLCExposure of type FeeRateMultiplier */ + public class MaxDustHTLCExposure_FeeRateMultiplier : MaxDustHTLCExposure { + public long fee_rate_multiplier; + internal MaxDustHTLCExposure_FeeRateMultiplier(long ptr) : base(null, ptr) { + this.fee_rate_multiplier = bindings.LDKMaxDustHTLCExposure_FeeRateMultiplier_get_fee_rate_multiplier(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.MaxDustHTLCExposure_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the MaxDustHTLCExposure + */ + public MaxDustHTLCExposure clone() { + long ret = bindings.MaxDustHTLCExposure_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MaxDustHTLCExposure ret_hu_conv = org.ldk.structs.MaxDustHTLCExposure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure + */ + public static MaxDustHTLCExposure fixed_limit_msat(long a) { + long ret = bindings.MaxDustHTLCExposure_fixed_limit_msat(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MaxDustHTLCExposure ret_hu_conv = org.ldk.structs.MaxDustHTLCExposure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure + */ + public static MaxDustHTLCExposure fee_rate_multiplier(long a) { + long ret = bindings.MaxDustHTLCExposure_fee_rate_multiplier(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MaxDustHTLCExposure ret_hu_conv = org.ldk.structs.MaxDustHTLCExposure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Checks if two MaxDustHTLCExposures contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.MaxDustHTLCExposure b) { + bool ret = bindings.MaxDustHTLCExposure_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is MaxDustHTLCExposure)) return false; + return this.eq((MaxDustHTLCExposure)o); + } + /** + * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read + */ + public byte[] write() { + byte[] ret = bindings.MaxDustHTLCExposure_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write + */ + public static Result_MaxDustHTLCExposureDecodeErrorZ read(byte[] ser) { + long ret = bindings.MaxDustHTLCExposure_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/MessageHandler.cs b/c_sharp/src/org/ldk/structs/MessageHandler.cs index 848e29b9..05c9671a 100644 --- a/c_sharp/src/org/ldk/structs/MessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/MessageHandler.cs @@ -37,7 +37,7 @@ public class MessageHandler : CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public void set_chan_handler(org.ldk.structs.ChannelMessageHandler val) { - bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr); + bindings.MessageHandler_set_chan_handler(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -65,15 +65,17 @@ public class MessageHandler : CommonBase { * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync */ public void set_route_handler(org.ldk.structs.RoutingMessageHandler val) { - bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr); + bindings.MessageHandler_set_route_handler(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * A message handler which handles onion messages. For now, this can only be an - * [`IgnoringMessageHandler`]. + * A message handler which handles onion messages. This should generally be an + * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`]. + * + * [`OnionMessenger`]: crate::onion_message::OnionMessenger */ public OnionMessageHandler get_onion_message_handler() { long ret = bindings.MessageHandler_get_onion_message_handler(this.ptr); @@ -85,11 +87,37 @@ public class MessageHandler : CommonBase { } /** - * A message handler which handles onion messages. For now, this can only be an - * [`IgnoringMessageHandler`]. + * A message handler which handles onion messages. This should generally be an + * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`]. + * + * [`OnionMessenger`]: crate::onion_message::OnionMessenger */ public void set_onion_message_handler(org.ldk.structs.OnionMessageHandler val) { - bindings.MessageHandler_set_onion_message_handler(this.ptr, val == null ? 0 : val.ptr); + bindings.MessageHandler_set_onion_message_handler(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * A message handler which handles custom messages. The only LDK-provided implementation is + * [`IgnoringMessageHandler`]. + */ + public CustomMessageHandler get_custom_message_handler() { + long ret = bindings.MessageHandler_get_custom_message_handler(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + CustomMessageHandler ret_hu_conv = new CustomMessageHandler(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A message handler which handles custom messages. The only LDK-provided implementation is + * [`IgnoringMessageHandler`]. + */ + public void set_custom_message_handler(org.ldk.structs.CustomMessageHandler val) { + bindings.MessageHandler_set_custom_message_handler(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -98,17 +126,19 @@ public class MessageHandler : CommonBase { /** * Constructs a new MessageHandler given each field */ - public static MessageHandler of(org.ldk.structs.ChannelMessageHandler chan_handler_arg, org.ldk.structs.RoutingMessageHandler route_handler_arg, org.ldk.structs.OnionMessageHandler onion_message_handler_arg) { - long ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr, onion_message_handler_arg == null ? 0 : onion_message_handler_arg.ptr); + public static MessageHandler of(org.ldk.structs.ChannelMessageHandler chan_handler_arg, org.ldk.structs.RoutingMessageHandler route_handler_arg, org.ldk.structs.OnionMessageHandler onion_message_handler_arg, org.ldk.structs.CustomMessageHandler custom_message_handler_arg) { + long ret = bindings.MessageHandler_new(chan_handler_arg.ptr, route_handler_arg.ptr, onion_message_handler_arg.ptr, custom_message_handler_arg.ptr); GC.KeepAlive(chan_handler_arg); GC.KeepAlive(route_handler_arg); GC.KeepAlive(onion_message_handler_arg); + GC.KeepAlive(custom_message_handler_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MessageHandler(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(chan_handler_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_handler_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(onion_message_handler_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(custom_message_handler_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/MessageRouter.cs b/c_sharp/src/org/ldk/structs/MessageRouter.cs new file mode 100644 index 00000000..c70ec240 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/MessageRouter.cs @@ -0,0 +1,69 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A trait defining behavior for routing an [`OnionMessage`]. + * + * [`OnionMessage`]: msgs::OnionMessage + */ +public class MessageRouter : CommonBase { + internal readonly bindings.LDKMessageRouter bindings_instance; + internal MessageRouter(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private MessageRouter(bindings.LDKMessageRouter arg) : base(bindings.LDKMessageRouter_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~MessageRouter() { + if (ptr != 0) { bindings.MessageRouter_free(ptr); } + } + + public interface MessageRouterInterface { + /** + * Returns a route for sending an [`OnionMessage`] to the given [`Destination`]. + * + * [`OnionMessage`]: msgs::OnionMessage + */ + Result_OnionMessagePathNoneZ find_path(byte[] _sender, byte[][] _peers, Destination _destination); + } + private class LDKMessageRouterHolder { internal MessageRouter held; } + private class LDKMessageRouterImpl : bindings.LDKMessageRouter { + internal LDKMessageRouterImpl(MessageRouterInterface arg, LDKMessageRouterHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private MessageRouterInterface arg; + private LDKMessageRouterHolder impl_holder; + public long find_path(byte[] _sender, byte[][] _peers, long _destination) { + org.ldk.structs.Destination _destination_hu_conv = org.ldk.structs.Destination.constr_from_ptr(_destination); + if (_destination_hu_conv != null) { _destination_hu_conv.ptrs_to.AddLast(this); }; + Result_OnionMessagePathNoneZ ret = arg.find_path(_sender, _peers, _destination_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + } + public static MessageRouter new_impl(MessageRouterInterface arg) { + LDKMessageRouterHolder impl_holder = new LDKMessageRouterHolder(); + impl_holder.held = new MessageRouter(new LDKMessageRouterImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Returns a route for sending an [`OnionMessage`] to the given [`Destination`]. + * + * [`OnionMessage`]: msgs::OnionMessage + */ + public Result_OnionMessagePathNoneZ find_path(byte[] sender, byte[][] peers, org.ldk.structs.Destination destination) { + long ret = bindings.MessageRouter_find_path(this.ptr, InternalUtils.check_arr_len(sender, 33), peers != null ? InternalUtils.mapArray(peers, peers_conv_8 => InternalUtils.check_arr_len(peers_conv_8, 33)) : null, destination.ptr); + GC.KeepAlive(this); + GC.KeepAlive(sender); + GC.KeepAlive(peers); + GC.KeepAlive(destination); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(destination); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/MessageSendEvent.cs b/c_sharp/src/org/ldk/structs/MessageSendEvent.cs index b1b4b9b9..233e8a1c 100644 --- a/c_sharp/src/org/ldk/structs/MessageSendEvent.cs +++ b/c_sharp/src/org/ldk/structs/MessageSendEvent.cs @@ -20,25 +20,37 @@ public class MessageSendEvent : CommonBase { long raw_ty = bindings.LDKMessageSendEvent_ty_from_ptr(ptr); switch (raw_ty) { case 0: return new MessageSendEvent_SendAcceptChannel(ptr); - case 1: return new MessageSendEvent_SendOpenChannel(ptr); - case 2: return new MessageSendEvent_SendFundingCreated(ptr); - case 3: return new MessageSendEvent_SendFundingSigned(ptr); - case 4: return new MessageSendEvent_SendChannelReady(ptr); - case 5: return new MessageSendEvent_SendAnnouncementSignatures(ptr); - case 6: return new MessageSendEvent_UpdateHTLCs(ptr); - case 7: return new MessageSendEvent_SendRevokeAndACK(ptr); - case 8: return new MessageSendEvent_SendClosingSigned(ptr); - case 9: return new MessageSendEvent_SendShutdown(ptr); - case 10: return new MessageSendEvent_SendChannelReestablish(ptr); - case 11: return new MessageSendEvent_SendChannelAnnouncement(ptr); - case 12: return new MessageSendEvent_BroadcastChannelAnnouncement(ptr); - case 13: return new MessageSendEvent_BroadcastChannelUpdate(ptr); - case 14: return new MessageSendEvent_SendChannelUpdate(ptr); - case 15: return new MessageSendEvent_HandleError(ptr); - case 16: return new MessageSendEvent_SendChannelRangeQuery(ptr); - case 17: return new MessageSendEvent_SendShortIdsQuery(ptr); - case 18: return new MessageSendEvent_SendReplyChannelRange(ptr); - case 19: return new MessageSendEvent_SendGossipTimestampFilter(ptr); + case 1: return new MessageSendEvent_SendAcceptChannelV2(ptr); + case 2: return new MessageSendEvent_SendOpenChannel(ptr); + case 3: return new MessageSendEvent_SendOpenChannelV2(ptr); + case 4: return new MessageSendEvent_SendFundingCreated(ptr); + case 5: return new MessageSendEvent_SendFundingSigned(ptr); + case 6: return new MessageSendEvent_SendTxAddInput(ptr); + case 7: return new MessageSendEvent_SendTxAddOutput(ptr); + case 8: return new MessageSendEvent_SendTxRemoveInput(ptr); + case 9: return new MessageSendEvent_SendTxRemoveOutput(ptr); + case 10: return new MessageSendEvent_SendTxComplete(ptr); + case 11: return new MessageSendEvent_SendTxSignatures(ptr); + case 12: return new MessageSendEvent_SendTxInitRbf(ptr); + case 13: return new MessageSendEvent_SendTxAckRbf(ptr); + case 14: return new MessageSendEvent_SendTxAbort(ptr); + case 15: return new MessageSendEvent_SendChannelReady(ptr); + case 16: return new MessageSendEvent_SendAnnouncementSignatures(ptr); + case 17: return new MessageSendEvent_UpdateHTLCs(ptr); + case 18: return new MessageSendEvent_SendRevokeAndACK(ptr); + case 19: return new MessageSendEvent_SendClosingSigned(ptr); + case 20: return new MessageSendEvent_SendShutdown(ptr); + case 21: return new MessageSendEvent_SendChannelReestablish(ptr); + case 22: return new MessageSendEvent_SendChannelAnnouncement(ptr); + case 23: return new MessageSendEvent_BroadcastChannelAnnouncement(ptr); + case 24: return new MessageSendEvent_BroadcastChannelUpdate(ptr); + case 25: return new MessageSendEvent_BroadcastNodeAnnouncement(ptr); + case 26: return new MessageSendEvent_SendChannelUpdate(ptr); + case 27: return new MessageSendEvent_HandleError(ptr); + case 28: return new MessageSendEvent_SendChannelRangeQuery(ptr); + case 29: return new MessageSendEvent_SendShortIdsQuery(ptr); + case 30: return new MessageSendEvent_SendReplyChannelRange(ptr); + case 31: return new MessageSendEvent_SendGossipTimestampFilter(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -62,6 +74,24 @@ public class MessageSendEvent : CommonBase { this.msg = msg_hu_conv; } } + /** A MessageSendEvent of type SendAcceptChannelV2 */ + public class MessageSendEvent_SendAcceptChannelV2 : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public AcceptChannelV2 msg; + internal MessageSendEvent_SendAcceptChannelV2(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_msg(ptr); + org.ldk.structs.AcceptChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } /** A MessageSendEvent of type SendOpenChannel */ public class MessageSendEvent_SendOpenChannel : MessageSendEvent { /** @@ -80,6 +110,24 @@ public class MessageSendEvent : CommonBase { this.msg = msg_hu_conv; } } + /** A MessageSendEvent of type SendOpenChannelV2 */ + public class MessageSendEvent_SendOpenChannelV2 : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public OpenChannelV2 msg; + internal MessageSendEvent_SendOpenChannelV2(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_msg(ptr); + org.ldk.structs.OpenChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } /** A MessageSendEvent of type SendFundingCreated */ public class MessageSendEvent_SendFundingCreated : MessageSendEvent { /** @@ -116,6 +164,168 @@ public class MessageSendEvent : CommonBase { this.msg = msg_hu_conv; } } + /** A MessageSendEvent of type SendTxAddInput */ + public class MessageSendEvent_SendTxAddInput : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxAddInput msg; + internal MessageSendEvent_SendTxAddInput(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxAddInput_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxAddInput_get_msg(ptr); + org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxAddOutput */ + public class MessageSendEvent_SendTxAddOutput : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxAddOutput msg; + internal MessageSendEvent_SendTxAddOutput(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxAddOutput_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxAddOutput_get_msg(ptr); + org.ldk.structs.TxAddOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddOutput(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxRemoveInput */ + public class MessageSendEvent_SendTxRemoveInput : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxRemoveInput msg; + internal MessageSendEvent_SendTxRemoveInput(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_msg(ptr); + org.ldk.structs.TxRemoveInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveInput(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxRemoveOutput */ + public class MessageSendEvent_SendTxRemoveOutput : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxRemoveOutput msg; + internal MessageSendEvent_SendTxRemoveOutput(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_msg(ptr); + org.ldk.structs.TxRemoveOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxComplete */ + public class MessageSendEvent_SendTxComplete : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxComplete msg; + internal MessageSendEvent_SendTxComplete(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxComplete_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxComplete_get_msg(ptr); + org.ldk.structs.TxComplete msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxComplete(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxSignatures */ + public class MessageSendEvent_SendTxSignatures : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxSignatures msg; + internal MessageSendEvent_SendTxSignatures(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxSignatures_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxSignatures_get_msg(ptr); + org.ldk.structs.TxSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxSignatures(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxInitRbf */ + public class MessageSendEvent_SendTxInitRbf : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxInitRbf msg; + internal MessageSendEvent_SendTxInitRbf(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxInitRbf_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxInitRbf_get_msg(ptr); + org.ldk.structs.TxInitRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxInitRbf(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxAckRbf */ + public class MessageSendEvent_SendTxAckRbf : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxAckRbf msg; + internal MessageSendEvent_SendTxAckRbf(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxAckRbf_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxAckRbf_get_msg(ptr); + org.ldk.structs.TxAckRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAckRbf(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } + /** A MessageSendEvent of type SendTxAbort */ + public class MessageSendEvent_SendTxAbort : MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ + public byte[] node_id; + /** + * The message which should be sent. + */ + public TxAddInput msg; + internal MessageSendEvent_SendTxAbort(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKMessageSendEvent_SendTxAbort_get_node_id(ptr); + long msg = bindings.LDKMessageSendEvent_SendTxAbort_get_msg(ptr); + org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } /** A MessageSendEvent of type SendChannelReady */ public class MessageSendEvent_SendChannelReady : MessageSendEvent { /** @@ -276,6 +486,8 @@ public class MessageSendEvent : CommonBase { public ChannelAnnouncement msg; /** * The followup channel_update which should be sent. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ public ChannelUpdate update_msg; internal MessageSendEvent_BroadcastChannelAnnouncement(long ptr) : base(null, ptr) { @@ -302,6 +514,19 @@ public class MessageSendEvent : CommonBase { this.msg = msg_hu_conv; } } + /** A MessageSendEvent of type BroadcastNodeAnnouncement */ + public class MessageSendEvent_BroadcastNodeAnnouncement : MessageSendEvent { + /** + * The node_announcement which should be sent. + */ + public NodeAnnouncement msg; + internal MessageSendEvent_BroadcastNodeAnnouncement(long ptr) : base(null, ptr) { + long msg = bindings.LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(ptr); + org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); } + if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); }; + this.msg = msg_hu_conv; + } + } /** A MessageSendEvent of type SendChannelUpdate */ public class MessageSendEvent_SendChannelUpdate : MessageSendEvent { /** @@ -442,6 +667,20 @@ public class MessageSendEvent : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent + */ + public static MessageSendEvent send_accept_channel_v2(byte[] node_id, org.ldk.structs.AcceptChannelV2 msg) { + long ret = bindings.MessageSendEvent_send_accept_channel_v2(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent */ @@ -456,6 +695,20 @@ public class MessageSendEvent : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent + */ + public static MessageSendEvent send_open_channel_v2(byte[] node_id, org.ldk.structs.OpenChannelV2 msg) { + long ret = bindings.MessageSendEvent_send_open_channel_v2(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent */ @@ -484,6 +737,132 @@ public class MessageSendEvent : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_add_input(byte[] node_id, org.ldk.structs.TxAddInput msg) { + long ret = bindings.MessageSendEvent_send_tx_add_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_add_output(byte[] node_id, org.ldk.structs.TxAddOutput msg) { + long ret = bindings.MessageSendEvent_send_tx_add_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_remove_input(byte[] node_id, org.ldk.structs.TxRemoveInput msg) { + long ret = bindings.MessageSendEvent_send_tx_remove_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_remove_output(byte[] node_id, org.ldk.structs.TxRemoveOutput msg) { + long ret = bindings.MessageSendEvent_send_tx_remove_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxComplete-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_complete(byte[] node_id, org.ldk.structs.TxComplete msg) { + long ret = bindings.MessageSendEvent_send_tx_complete(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_signatures(byte[] node_id, org.ldk.structs.TxSignatures msg) { + long ret = bindings.MessageSendEvent_send_tx_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_init_rbf(byte[] node_id, org.ldk.structs.TxInitRbf msg) { + long ret = bindings.MessageSendEvent_send_tx_init_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_ack_rbf(byte[] node_id, org.ldk.structs.TxAckRbf msg) { + long ret = bindings.MessageSendEvent_send_tx_ack_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new SendTxAbort-variant MessageSendEvent + */ + public static MessageSendEvent send_tx_abort(byte[] node_id, org.ldk.structs.TxAddInput msg) { + long ret = bindings.MessageSendEvent_send_tx_abort(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new SendChannelReady-variant MessageSendEvent */ @@ -626,6 +1005,19 @@ public class MessageSendEvent : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent + */ + public static MessageSendEvent broadcast_node_announcement(org.ldk.structs.NodeAnnouncement msg) { + long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent */ @@ -650,6 +1042,7 @@ public class MessageSendEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs b/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs index 72e66769..18bbdf92 100644 --- a/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs +++ b/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs @@ -35,6 +35,7 @@ public class MessageSendEventsProvider : CommonBase { MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events(); GC.KeepAlive(arg); long[] result = ret != null ? InternalUtils.mapArray(ret, ret_conv_18 => ret_conv_18 == null ? 0 : ret_conv_18.clone_ptr()) : null; + foreach (MessageSendEvent ret_conv_18 in ret) { if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret_conv_18); }; }; return result; } } diff --git a/c_sharp/src/org/ldk/structs/MinFinalCltvExpiry.cs b/c_sharp/src/org/ldk/structs/MinFinalCltvExpiry.cs deleted file mode 100644 index 0350bc19..00000000 --- a/c_sharp/src/org/ldk/structs/MinFinalCltvExpiry.cs +++ /dev/null @@ -1,90 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * `min_final_cltv_expiry` to use for the last HTLC in the route - */ -public class MinFinalCltvExpiry : CommonBase { - internal MinFinalCltvExpiry(object _dummy, long ptr) : base(ptr) { } - ~MinFinalCltvExpiry() { - if (ptr != 0) { bindings.MinFinalCltvExpiry_free(ptr); } - } - - public long get_a() { - long ret = bindings.MinFinalCltvExpiry_get_a(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public void set_a(long val) { - bindings.MinFinalCltvExpiry_set_a(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Constructs a new MinFinalCltvExpiry given each field - */ - public static MinFinalCltvExpiry of(long a_arg) { - long ret = bindings.MinFinalCltvExpiry_new(a_arg); - GC.KeepAlive(a_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiry(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.MinFinalCltvExpiry_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the MinFinalCltvExpiry - */ - public MinFinalCltvExpiry clone() { - long ret = bindings.MinFinalCltvExpiry_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiry(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Checks if two MinFinalCltvExpirys contain equal inner contents. - */ - public long hash() { - long ret = bindings.MinFinalCltvExpiry_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public override int GetHashCode() { - return (int)this.hash(); - } - /** - * Checks if two MinFinalCltvExpirys contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public bool eq(org.ldk.structs.MinFinalCltvExpiry b) { - bool ret = bindings.MinFinalCltvExpiry_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - if (this != null) { this.ptrs_to.AddLast(b); }; - return ret; - } - - public override bool Equals(object o) { - if (!(o is MinFinalCltvExpiry)) return false; - return this.eq((MinFinalCltvExpiry)o); - } -} -} } } diff --git a/c_sharp/src/org/ldk/structs/MinFinalCltvExpiryDelta.cs b/c_sharp/src/org/ldk/structs/MinFinalCltvExpiryDelta.cs new file mode 100644 index 00000000..e407faf8 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/MinFinalCltvExpiryDelta.cs @@ -0,0 +1,90 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * `min_final_cltv_expiry_delta` to use for the last HTLC in the route + */ +public class MinFinalCltvExpiryDelta : CommonBase { + internal MinFinalCltvExpiryDelta(object _dummy, long ptr) : base(ptr) { } + ~MinFinalCltvExpiryDelta() { + if (ptr != 0) { bindings.MinFinalCltvExpiryDelta_free(ptr); } + } + + public long get_a() { + long ret = bindings.MinFinalCltvExpiryDelta_get_a(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public void set_a(long val) { + bindings.MinFinalCltvExpiryDelta_set_a(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new MinFinalCltvExpiryDelta given each field + */ + public static MinFinalCltvExpiryDelta of(long a_arg) { + long ret = bindings.MinFinalCltvExpiryDelta_new(a_arg); + GC.KeepAlive(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MinFinalCltvExpiryDelta ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiryDelta(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.MinFinalCltvExpiryDelta_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the MinFinalCltvExpiryDelta + */ + public MinFinalCltvExpiryDelta clone() { + long ret = bindings.MinFinalCltvExpiryDelta_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MinFinalCltvExpiryDelta ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiryDelta(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta. + */ + public long hash() { + long ret = bindings.MinFinalCltvExpiryDelta_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.MinFinalCltvExpiryDelta b) { + bool ret = bindings.MinFinalCltvExpiryDelta_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is MinFinalCltvExpiryDelta)) return false; + return this.eq((MinFinalCltvExpiryDelta)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs b/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs index 7d00ca6e..95245380 100644 --- a/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs +++ b/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs @@ -34,7 +34,7 @@ public class MonitorUpdateId : CommonBase { } /** - * Checks if two MonitorUpdateIds contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId. */ public long hash() { long ret = bindings.MonitorUpdateId_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/MultiThreadedLockableScore.cs b/c_sharp/src/org/ldk/structs/MultiThreadedLockableScore.cs index 0a878bde..b4768158 100644 --- a/c_sharp/src/org/ldk/structs/MultiThreadedLockableScore.cs +++ b/c_sharp/src/org/ldk/structs/MultiThreadedLockableScore.cs @@ -54,7 +54,7 @@ public class MultiThreadedLockableScore : CommonBase { * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`]. */ public static MultiThreadedLockableScore of(org.ldk.structs.Score score) { - long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr); + long ret = bindings.MultiThreadedLockableScore_new(score.ptr); GC.KeepAlive(score); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); } diff --git a/c_sharp/src/org/ldk/structs/MultiThreadedScoreLock.cs b/c_sharp/src/org/ldk/structs/MultiThreadedScoreLock.cs index 521eaf89..9e8ee956 100644 --- a/c_sharp/src/org/ldk/structs/MultiThreadedScoreLock.cs +++ b/c_sharp/src/org/ldk/structs/MultiThreadedScoreLock.cs @@ -15,6 +15,15 @@ public class MultiThreadedScoreLock : CommonBase { if (ptr != 0) { bindings.MultiThreadedScoreLock_free(ptr); } } + /** + * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read + */ + public byte[] write() { + byte[] ret = bindings.MultiThreadedScoreLock_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Constructs a new Score which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is @@ -28,14 +37,5 @@ public class MultiThreadedScoreLock : CommonBase { return ret_hu_conv; } - /** - * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read - */ - public byte[] write() { - byte[] ret = bindings.MultiThreadedScoreLock_write(this.ptr); - GC.KeepAlive(this); - return ret; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/NetAddress.cs b/c_sharp/src/org/ldk/structs/NetAddress.cs index ab49f2f4..f4cae02c 100644 --- a/c_sharp/src/org/ldk/structs/NetAddress.cs +++ b/c_sharp/src/org/ldk/structs/NetAddress.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * An address which can be used to connect to a remote peer + * An address which can be used to connect to a remote peer. */ public class NetAddress : CommonBase { protected NetAddress(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/NetworkGraph.cs b/c_sharp/src/org/ldk/structs/NetworkGraph.cs index f664fad3..22905e65 100644 --- a/c_sharp/src/org/ldk/structs/NetworkGraph.cs +++ b/c_sharp/src/org/ldk/structs/NetworkGraph.cs @@ -18,7 +18,7 @@ public class NetworkGraph : CommonBase { /** * Handles any network updates originating from [`Event`]s. * - * [`Event`]: crate::util::events::Event + * [`Event`]: crate::events::Event */ public void handle_network_update(org.ldk.structs.NetworkUpdate network_update) { bindings.NetworkGraph_handle_network_update(this.ptr, network_update == null ? 0 : network_update.ptr); @@ -26,6 +26,15 @@ public class NetworkGraph : CommonBase { GC.KeepAlive(network_update); } + /** + * Gets the genesis hash for this network graph. + */ + public byte[] get_genesis_hash() { + byte[] ret = bindings.NetworkGraph_get_genesis_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read */ @@ -39,7 +48,7 @@ public class NetworkGraph : CommonBase { * Read a NetworkGraph from a byte array, created by NetworkGraph_write */ public static Result_NetworkGraphDecodeErrorZ read(byte[] ser, org.ldk.structs.Logger arg) { - long ret = bindings.NetworkGraph_read(ser, arg == null ? 0 : arg.ptr); + long ret = bindings.NetworkGraph_read(ser, arg.ptr); GC.KeepAlive(ser); GC.KeepAlive(arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -51,9 +60,9 @@ public class NetworkGraph : CommonBase { /** * Creates a new, empty, network graph. */ - public static NetworkGraph of(byte[] genesis_hash, org.ldk.structs.Logger logger) { - long ret = bindings.NetworkGraph_new(InternalUtils.check_arr_len(genesis_hash, 32), logger == null ? 0 : logger.ptr); - GC.KeepAlive(genesis_hash); + public static NetworkGraph of(Network network, org.ldk.structs.Logger logger) { + long ret = bindings.NetworkGraph_new(network, logger.ptr); + GC.KeepAlive(network); GC.KeepAlive(logger); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NetworkGraph(null, ret); } @@ -134,22 +143,41 @@ public class NetworkGraph : CommonBase { /** * Store or update channel info from a channel announcement. * - * You probably don't want to call this directly, instead relying on a P2PGossipSync's - * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept + * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s + * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept * routing messages from a source using a protocol other than the lightning P2P protocol. * - * If a `chain::Access` object is provided via `chain_access`, it will be called to verify + * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify * the corresponding UTXO exists on chain and is correctly-formatted. */ - public Result_NoneLightningErrorZ update_channel_from_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.Option_AccessZ chain_access) { - long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr, chain_access.ptr); + public Result_NoneLightningErrorZ update_channel_from_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.Option_UtxoLookupZ utxo_lookup) { + long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr, utxo_lookup.ptr); + GC.KeepAlive(this); + GC.KeepAlive(msg); + GC.KeepAlive(utxo_lookup); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(msg); }; + if (this != null) { this.ptrs_to.AddLast(utxo_lookup); }; + return ret_hu_conv; + } + + /** + * Store or update channel info from a channel announcement. + * + * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s + * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept + * routing messages from a source using a protocol other than the lightning P2P protocol. + * + * This will skip verification of if the channel is actually on-chain. + */ + public Result_NoneLightningErrorZ update_channel_from_announcement_no_lookup(org.ldk.structs.ChannelAnnouncement msg) { + long ret = bindings.NetworkGraph_update_channel_from_announcement_no_lookup(this.ptr, msg == null ? 0 : msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); - GC.KeepAlive(chain_access); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(msg); }; - if (this != null) { this.ptrs_to.AddLast(chain_access); }; return ret_hu_conv; } @@ -158,18 +186,18 @@ public class NetworkGraph : CommonBase { * signatures. Because we aren't given the associated signatures here we cannot relay the * channel announcement to any of our peers. * - * If a `chain::Access` object is provided via `chain_access`, it will be called to verify + * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify * the corresponding UTXO exists on chain and is correctly-formatted. */ - public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(org.ldk.structs.UnsignedChannelAnnouncement msg, org.ldk.structs.Option_AccessZ chain_access) { - long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr, chain_access.ptr); + public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(org.ldk.structs.UnsignedChannelAnnouncement msg, org.ldk.structs.Option_UtxoLookupZ utxo_lookup) { + long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr, utxo_lookup.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); - GC.KeepAlive(chain_access); + GC.KeepAlive(utxo_lookup); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(msg); }; - if (this != null) { this.ptrs_to.AddLast(chain_access); }; + if (this != null) { this.ptrs_to.AddLast(utxo_lookup); }; return ret_hu_conv; } @@ -196,16 +224,14 @@ public class NetworkGraph : CommonBase { } /** - * Marks a channel in the graph as failed if a corresponding HTLC fail was sent. - * If permanent, removes a channel from the local storage. - * May cause the removal of nodes too, if this was their last channel. - * If not permanent, makes channels unavailable for routing. + * Marks a channel in the graph as failed permanently. + * + * The channel and any node for which this was their last channel are removed from the graph. */ - public void channel_failed(long short_channel_id, bool is_permanent) { - bindings.NetworkGraph_channel_failed(this.ptr, short_channel_id, is_permanent); + public void channel_failed_permanent(long short_channel_id) { + bindings.NetworkGraph_channel_failed_permanent(this.ptr, short_channel_id); GC.KeepAlive(this); GC.KeepAlive(short_channel_id); - GC.KeepAlive(is_permanent); } /** diff --git a/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs b/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs index 9a1b4664..9540cbb4 100644 --- a/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A node_announcement message to be sent or received from a peer + * A [`node_announcement`] message to be sent to or received from a peer. + * + * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message */ public class NodeAnnouncement : CommonBase { internal NodeAnnouncement(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs b/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs index 72391935..0d1053b4 100644 --- a/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs +++ b/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs @@ -101,34 +101,6 @@ public class NodeAnnouncementInfo : CommonBase { if (this != null) { this.ptrs_to.AddLast(val); }; } - /** - * Internet-level addresses via which one can connect to the node - * - * Returns a copy of the field. - */ - public NetAddress[] get_addresses() { - long[] ret = bindings.NodeAnnouncementInfo_get_addresses(this.ptr); - GC.KeepAlive(this); - int ret_conv_12_len = ret.Length; - NetAddress[] ret_conv_12_arr = new NetAddress[ret_conv_12_len]; - for (int m = 0; m < ret_conv_12_len; m++) { - long ret_conv_12 = ret[m]; - org.ldk.structs.NetAddress ret_conv_12_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret_conv_12); - if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_12_arr[m] = ret_conv_12_hu_conv; - } - return ret_conv_12_arr; - } - - /** - * Internet-level addresses via which one can connect to the node - */ - public void set_addresses(NetAddress[] val) { - bindings.NodeAnnouncementInfo_set_addresses(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_12 => val_conv_12.ptr) : null); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * An initial announcement of the node * Mostly redundant with the data we store in fields explicitly. @@ -164,13 +136,12 @@ public class NodeAnnouncementInfo : CommonBase { /** * Constructs a new NodeAnnouncementInfo given each field */ - public static NodeAnnouncementInfo of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, NetAddress[] addresses_arg, org.ldk.structs.NodeAnnouncement announcement_message_arg) { - long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg == null ? 0 : alias_arg.ptr, addresses_arg != null ? InternalUtils.mapArray(addresses_arg, addresses_arg_conv_12 => addresses_arg_conv_12.ptr) : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr); + public static NodeAnnouncementInfo of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, org.ldk.structs.NodeAnnouncement announcement_message_arg) { + long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg == null ? 0 : alias_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr); GC.KeepAlive(features_arg); GC.KeepAlive(last_update_arg); GC.KeepAlive(rgb_arg); GC.KeepAlive(alias_arg); - GC.KeepAlive(addresses_arg); GC.KeepAlive(announcement_message_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } @@ -216,6 +187,23 @@ public class NodeAnnouncementInfo : CommonBase { if (!(o is NodeAnnouncementInfo)) return false; return this.eq((NodeAnnouncementInfo)o); } + /** + * Internet-level addresses via which one can connect to the node + */ + public NetAddress[] addresses() { + long[] ret = bindings.NodeAnnouncementInfo_addresses(this.ptr); + GC.KeepAlive(this); + int ret_conv_12_len = ret.Length; + NetAddress[] ret_conv_12_arr = new NetAddress[ret_conv_12_len]; + for (int m = 0; m < ret_conv_12_len; m++) { + long ret_conv_12 = ret[m]; + org.ldk.structs.NetAddress ret_conv_12_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret_conv_12); + if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_12_arr[m] = ret_conv_12_hu_conv; + } + return ret_conv_12_arr; + } + /** * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read */ diff --git a/c_sharp/src/org/ldk/structs/NodeFeatures.cs b/c_sharp/src/org/ldk/structs/NodeFeatures.cs index fdd108e6..84f27848 100644 --- a/c_sharp/src/org/ldk/structs/NodeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/NodeFeatures.cs @@ -61,6 +61,17 @@ public class NodeFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.NodeFeatures other) { + bool ret = bindings.NodeFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -71,6 +82,42 @@ public class NodeFeatures : CommonBase { return ret; } + /** + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.NodeFeatures_set_required_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits + */ + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.NodeFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read */ @@ -363,6 +410,74 @@ public class NodeFeatures : CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_anchors_nonzero_fee_htlc_tx_optional() { + bindings.NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_anchors_nonzero_fee_htlc_tx_required() { + bindings.NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_anchors_nonzero_fee_htlc_tx() { + bool ret = bindings.NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_anchors_nonzero_fee_htlc_tx() { + bool ret = bindings.NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_anchors_zero_fee_htlc_tx_optional() { + bindings.NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_anchors_zero_fee_htlc_tx_required() { + bindings.NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_anchors_zero_fee_htlc_tx() { + bool ret = bindings.NodeFeatures_supports_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_anchors_zero_fee_htlc_tx() { + bool ret = bindings.NodeFeatures_requires_anchors_zero_fee_htlc_tx(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Set this feature as optional. */ diff --git a/c_sharp/src/org/ldk/structs/NodeId.cs b/c_sharp/src/org/ldk/structs/NodeId.cs index ab043156..b4924b5d 100644 --- a/c_sharp/src/org/ldk/structs/NodeId.cs +++ b/c_sharp/src/org/ldk/structs/NodeId.cs @@ -55,7 +55,18 @@ public class NodeId : CommonBase { } /** - * Checks if two NodeIds contain equal inner contents. + * Get the public key from this NodeId + */ + public Result_PublicKeyErrorZ as_pubkey() { + long ret = bindings.NodeId_as_pubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the NodeId. */ public long hash() { long ret = bindings.NodeId_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/NodeInfo.cs b/c_sharp/src/org/ldk/structs/NodeInfo.cs index 87c8d14b..542ba8c1 100644 --- a/c_sharp/src/org/ldk/structs/NodeInfo.cs +++ b/c_sharp/src/org/ldk/structs/NodeInfo.cs @@ -35,36 +35,6 @@ public class NodeInfo : CommonBase { GC.KeepAlive(val); } - /** - * Lowest fees enabling routing via any of the enabled, known channels to a node. - * The two fields (flat and proportional fee) are independent, - * meaning they don't have to refer to the same channel. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public RoutingFees get_lowest_inbound_channel_fees() { - long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Lowest fees enabling routing via any of the enabled, known channels to a node. - * The two fields (flat and proportional fee) are independent, - * meaning they don't have to refer to the same channel. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public void set_lowest_inbound_channel_fees(org.ldk.structs.RoutingFees val) { - bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - /** * More information about a node from node_announcement. * Optional because we store a Node entry after learning about it from @@ -98,15 +68,13 @@ public class NodeInfo : CommonBase { /** * Constructs a new NodeInfo given each field */ - public static NodeInfo of(long[] channels_arg, org.ldk.structs.RoutingFees lowest_inbound_channel_fees_arg, org.ldk.structs.NodeAnnouncementInfo announcement_info_arg) { - long ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr, announcement_info_arg == null ? 0 : announcement_info_arg.ptr); + public static NodeInfo of(long[] channels_arg, org.ldk.structs.NodeAnnouncementInfo announcement_info_arg) { + long ret = bindings.NodeInfo_new(channels_arg, announcement_info_arg == null ? 0 : announcement_info_arg.ptr); GC.KeepAlive(channels_arg); - GC.KeepAlive(lowest_inbound_channel_fees_arg); GC.KeepAlive(announcement_info_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeInfo(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(lowest_inbound_channel_fees_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(announcement_info_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/NodeSigner.cs b/c_sharp/src/org/ldk/structs/NodeSigner.cs new file mode 100644 index 00000000..e454bb17 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/NodeSigner.cs @@ -0,0 +1,230 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A trait that can handle cryptographic operations at the scope level of a node. + */ +public class NodeSigner : CommonBase { + internal readonly bindings.LDKNodeSigner bindings_instance; + internal NodeSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private NodeSigner(bindings.LDKNodeSigner arg) : base(bindings.LDKNodeSigner_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~NodeSigner() { + if (ptr != 0) { bindings.NodeSigner_free(ptr); } + } + + public interface NodeSignerInterface { + /** + * Get secret key material as bytes for use in encrypting and decrypting inbound payment data. + * + * If the implementor of this trait supports [phantom node payments], then every node that is + * intended to be included in the phantom invoice route hints must return the same value from + * this method. + * + * This method must return the same value each time it is called. + * + * [phantom node payments]: PhantomKeysManager + */ + byte[] get_inbound_payment_key_material(); + /** + * Get node id based on the provided [`Recipient`]. + * + * This method must return the same value each time it is called with a given [`Recipient`] + * parameter. + * + * Errors if the [`Recipient`] variant is not supported by the implementation. + */ + Result_PublicKeyNoneZ get_node_id(Recipient _recipient); + /** + * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if + * one is provided. Note that this tweak can be applied to `other_key` instead of our node + * secret, though this is less efficient. + * + * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error + * should be resolved to allow LDK to resume forwarding HTLCs. + * + * Errors if the [`Recipient`] variant is not supported by the implementation. + */ + Result_SharedSecretNoneZ ecdh(Recipient _recipient, byte[] _other_key, Option_ScalarZ _tweak); + /** + * Sign an invoice. + * + * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of + * this trait to parse the invoice and make sure they're signing what they expect, rather than + * blindly signing the hash. + * + * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32. + * + * The secret key used to sign the invoice is dependent on the [`Recipient`]. + * + * Errors if the [`Recipient`] variant is not supported by the implementation. + */ + Result_RecoverableSignatureNoneZ sign_invoice(byte[] _hrp_bytes, UInt5[] _invoice_data, Recipient _recipient); + /** + * Sign a gossip message. + * + * Note that if this fails, LDK may panic and the message will not be broadcast to the network + * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the + * message to be broadcast, as otherwise it may prevent one from receiving funds over the + * corresponding channel. + */ + Result_SignatureNoneZ sign_gossip_message(UnsignedGossipMessage _msg); + } + private class LDKNodeSignerHolder { internal NodeSigner held; } + private class LDKNodeSignerImpl : bindings.LDKNodeSigner { + internal LDKNodeSignerImpl(NodeSignerInterface arg, LDKNodeSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private NodeSignerInterface arg; + private LDKNodeSignerHolder impl_holder; + public byte[] get_inbound_payment_key_material() { + byte[] ret = arg.get_inbound_payment_key_material(); + GC.KeepAlive(arg); + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; + } + public long get_node_id(Recipient _recipient) { + Result_PublicKeyNoneZ ret = arg.get_node_id(_recipient); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long ecdh(Recipient _recipient, byte[] _other_key, long _tweak) { + org.ldk.structs.Option_ScalarZ _tweak_hu_conv = org.ldk.structs.Option_ScalarZ.constr_from_ptr(_tweak); + if (_tweak_hu_conv != null) { _tweak_hu_conv.ptrs_to.AddLast(this); }; + Result_SharedSecretNoneZ ret = arg.ecdh(_recipient, _other_key, _tweak_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_invoice(byte[] _hrp_bytes, byte[] _invoice_data, Recipient _recipient) { + int _invoice_data_conv_7_len = _invoice_data.Length; + UInt5[] _invoice_data_conv_7_arr = new UInt5[_invoice_data_conv_7_len]; + for (int h = 0; h < _invoice_data_conv_7_len; h++) { + byte _invoice_data_conv_7 = _invoice_data[h]; + UInt5 _invoice_data_conv_7_conv = new UInt5(_invoice_data_conv_7); + _invoice_data_conv_7_arr[h] = _invoice_data_conv_7_conv; + } + Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(_hrp_bytes, _invoice_data_conv_7_arr, _recipient); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_gossip_message(long _msg) { + org.ldk.structs.UnsignedGossipMessage _msg_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(_msg); + if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); }; + Result_SignatureNoneZ ret = arg.sign_gossip_message(_msg_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + } + public static NodeSigner new_impl(NodeSignerInterface arg) { + LDKNodeSignerHolder impl_holder = new LDKNodeSignerHolder(); + impl_holder.held = new NodeSigner(new LDKNodeSignerImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Get secret key material as bytes for use in encrypting and decrypting inbound payment data. + * + * If the implementor of this trait supports [phantom node payments], then every node that is + * intended to be included in the phantom invoice route hints must return the same value from + * this method. + * + * This method must return the same value each time it is called. + * + * [phantom node payments]: PhantomKeysManager + */ + public byte[] get_inbound_payment_key_material() { + byte[] ret = bindings.NodeSigner_get_inbound_payment_key_material(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Get node id based on the provided [`Recipient`]. + * + * This method must return the same value each time it is called with a given [`Recipient`] + * parameter. + * + * Errors if the [`Recipient`] variant is not supported by the implementation. + */ + public Result_PublicKeyNoneZ get_node_id(Recipient recipient) { + long ret = bindings.NodeSigner_get_node_id(this.ptr, recipient); + GC.KeepAlive(this); + GC.KeepAlive(recipient); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if + * one is provided. Note that this tweak can be applied to `other_key` instead of our node + * secret, though this is less efficient. + * + * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error + * should be resolved to allow LDK to resume forwarding HTLCs. + * + * Errors if the [`Recipient`] variant is not supported by the implementation. + */ + public Result_SharedSecretNoneZ ecdh(Recipient recipient, byte[] other_key, org.ldk.structs.Option_ScalarZ tweak) { + long ret = bindings.NodeSigner_ecdh(this.ptr, recipient, InternalUtils.check_arr_len(other_key, 33), tweak.ptr); + GC.KeepAlive(this); + GC.KeepAlive(recipient); + GC.KeepAlive(other_key); + GC.KeepAlive(tweak); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SharedSecretNoneZ ret_hu_conv = Result_SharedSecretNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(tweak); }; + return ret_hu_conv; + } + + /** + * Sign an invoice. + * + * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of + * this trait to parse the invoice and make sure they're signing what they expect, rather than + * blindly signing the hash. + * + * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32. + * + * The secret key used to sign the invoice is dependent on the [`Recipient`]. + * + * Errors if the [`Recipient`] variant is not supported by the implementation. + */ + public Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, Recipient recipient) { + long ret = bindings.NodeSigner_sign_invoice(this.ptr, hrp_bytes, invoice_data != null ? InternalUtils.convUInt5Array(invoice_data) : null, recipient); + GC.KeepAlive(this); + GC.KeepAlive(hrp_bytes); + GC.KeepAlive(invoice_data); + GC.KeepAlive(recipient); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Sign a gossip message. + * + * Note that if this fails, LDK may panic and the message will not be broadcast to the network + * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the + * message to be broadcast, as otherwise it may prevent one from receiving funds over the + * corresponding channel. + */ + public Result_SignatureNoneZ sign_gossip_message(org.ldk.structs.UnsignedGossipMessage msg) { + long ret = bindings.NodeSigner_sign_gossip_message(this.ptr, msg.ptr); + GC.KeepAlive(this); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Offer.cs b/c_sharp/src/org/ldk/structs/Offer.cs new file mode 100644 index 00000000..c23621e4 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Offer.cs @@ -0,0 +1,240 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An `Offer` is a potentially long-lived proposal for payment of a good or service. + * + * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a + * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient + * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`]. + * + * Offers may be denominated in currency other than bitcoin but are ultimately paid using the + * latter. + * + * Through the use of [`BlindedPath`]s, offers provide recipient privacy. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ +public class Offer : CommonBase { + internal Offer(object _dummy, long ptr) : base(ptr) { } + ~Offer() { + if (ptr != 0) { bindings.Offer_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Offer_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Offer + */ + public Offer clone() { + long ret = bindings.Offer_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Offer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Offer(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet). + * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats) + * for the selected chain. + */ + public byte[][] chains() { + byte[][] ret = bindings.Offer_chains(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Returns whether the given chain is supported by the offer. + */ + public bool supports_chain(byte[] chain) { + bool ret = bindings.Offer_supports_chain(this.ptr, InternalUtils.check_arr_len(chain, 32)); + GC.KeepAlive(this); + GC.KeepAlive(chain); + return ret; + } + + /** + * Opaque bytes set by the originator. Useful for authentication and validating fields since it + * is reflected in `invoice_request` messages along with all the other fields from the `offer`. + */ + public Option_CVec_u8ZZ metadata() { + long ret = bindings.Offer_metadata(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The minimum amount required for a successful payment of a single item. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Amount amount() { + long ret = bindings.Offer_amount(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A complete description of the purpose of the payment. Intended to be displayed to the user + * but with the caveat that it has not been verified in any way. + */ + public PrintableString description() { + long ret = bindings.Offer_description(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Features pertaining to the offer. + */ + public OfferFeatures features() { + long ret = bindings.Offer_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Duration since the Unix epoch when an invoice should no longer be requested. + * + * If `None`, the offer does not expire. + */ + public Option_DurationZ absolute_expiry() { + long ret = bindings.Offer_absolute_expiry(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Whether the offer has expired. + */ + public bool is_expired() { + bool ret = bindings.Offer_is_expired(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be + * displayed to the user but with the caveat that it has not been verified in any way. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public PrintableString issuer() { + long ret = bindings.Offer_issuer(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide + * recipient privacy by obfuscating its node id. + */ + public BlindedPath[] paths() { + long[] ret = bindings.Offer_paths(this.ptr); + GC.KeepAlive(this); + int ret_conv_13_len = ret.Length; + BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; + for (int n = 0; n < ret_conv_13_len; n++) { + long ret_conv_13 = ret[n]; + org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } + if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_13_arr[n] = ret_conv_13_hu_conv; + } + return ret_conv_13_arr; + } + + /** + * The quantity of items supported. + */ + public Quantity supported_quantity() { + long ret = bindings.Offer_supported_quantity(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Returns whether the given quantity is valid for the offer. + */ + public bool is_valid_quantity(long quantity) { + bool ret = bindings.Offer_is_valid_quantity(this.ptr, quantity); + GC.KeepAlive(this); + GC.KeepAlive(quantity); + return ret; + } + + /** + * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public bool expects_quantity() { + bool ret = bindings.Offer_expects_quantity(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The public key used by the recipient to sign invoices. + */ + public byte[] signing_pubkey() { + byte[] ret = bindings.Offer_signing_pubkey(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Serialize the Offer object into a byte array which can be read by Offer_read + */ + public byte[] write() { + byte[] ret = bindings.Offer_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a Offer object from a string + */ + public static Result_OfferBolt12ParseErrorZ from_str(string s) { + long ret = bindings.Offer_from_str(s); + GC.KeepAlive(s); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OfferFeatures.cs b/c_sharp/src/org/ldk/structs/OfferFeatures.cs index 359c0fb2..6ce10456 100644 --- a/c_sharp/src/org/ldk/structs/OfferFeatures.cs +++ b/c_sharp/src/org/ldk/structs/OfferFeatures.cs @@ -61,6 +61,17 @@ public class OfferFeatures : CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains required features unknown by `other`. + */ + public bool requires_unknown_bits_from(org.ldk.structs.OfferFeatures other) { + bool ret = bindings.OfferFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + GC.KeepAlive(this); + GC.KeepAlive(other); + if (this != null) { this.ptrs_to.AddLast(other); }; + return ret; + } + /** * Returns true if this `Features` object contains unknown feature flags which are set as * \"required\". @@ -72,22 +83,38 @@ public class OfferFeatures : CommonBase { } /** - * Serialize the OfferFeatures object into a byte array which can be read by OfferFeatures_read + * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will + * be set instead (i.e., `bit - 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits */ - public byte[] write() { - byte[] ret = bindings.OfferFeatures_write(this.ptr); + public Result_NoneNoneZ set_required_custom_bit(long bit) { + long ret = bindings.OfferFeatures_set_required_custom_bit(this.ptr, bit); GC.KeepAlive(this); - return ret; + GC.KeepAlive(bit); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; } /** - * Read a OfferFeatures from a byte array, created by OfferFeatures_write + * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined + * by [bLIP 2] or if it is a known `T` feature. + * + * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be + * set instead (i.e., `bit + 1`). + * + * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits */ - public static Result_OfferFeaturesDecodeErrorZ read(byte[] ser) { - long ret = bindings.OfferFeatures_read(ser); - GC.KeepAlive(ser); + public Result_NoneNoneZ set_optional_custom_bit(long bit) { + long ret = bindings.OfferFeatures_set_optional_custom_bit(this.ptr, bit); + GC.KeepAlive(this); + GC.KeepAlive(bit); if (ret >= 0 && ret <= 4096) { return null; } - Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.constr_from_ptr(ret); + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/OffersMessage.cs b/c_sharp/src/org/ldk/structs/OffersMessage.cs new file mode 100644 index 00000000..dbe6f19d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OffersMessage.cs @@ -0,0 +1,150 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`]. + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +public class OffersMessage : CommonBase { + protected OffersMessage(object _dummy, long ptr) : base(ptr) { } + ~OffersMessage() { + if (ptr != 0) { bindings.OffersMessage_free(ptr); } + } + + internal static OffersMessage constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKOffersMessage_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new OffersMessage_InvoiceRequest(ptr); + case 1: return new OffersMessage_Invoice(ptr); + case 2: return new OffersMessage_InvoiceError(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A OffersMessage of type InvoiceRequest */ + public class OffersMessage_InvoiceRequest : OffersMessage { + public InvoiceRequest invoice_request; + internal OffersMessage_InvoiceRequest(long ptr) : base(null, ptr) { + long invoice_request = bindings.LDKOffersMessage_InvoiceRequest_get_invoice_request(ptr); + org.ldk.structs.InvoiceRequest invoice_request_hu_conv = null; if (invoice_request < 0 || invoice_request > 4096) { invoice_request_hu_conv = new org.ldk.structs.InvoiceRequest(null, invoice_request); } + if (invoice_request_hu_conv != null) { invoice_request_hu_conv.ptrs_to.AddLast(this); }; + this.invoice_request = invoice_request_hu_conv; + } + } + /** A OffersMessage of type Invoice */ + public class OffersMessage_Invoice : OffersMessage { + public Bolt12Invoice invoice; + internal OffersMessage_Invoice(long ptr) : base(null, ptr) { + long invoice = bindings.LDKOffersMessage_Invoice_get_invoice(ptr); + org.ldk.structs.Bolt12Invoice invoice_hu_conv = null; if (invoice < 0 || invoice > 4096) { invoice_hu_conv = new org.ldk.structs.Bolt12Invoice(null, invoice); } + if (invoice_hu_conv != null) { invoice_hu_conv.ptrs_to.AddLast(this); }; + this.invoice = invoice_hu_conv; + } + } + /** A OffersMessage of type InvoiceError */ + public class OffersMessage_InvoiceError : OffersMessage { + public InvoiceError invoice_error; + internal OffersMessage_InvoiceError(long ptr) : base(null, ptr) { + long invoice_error = bindings.LDKOffersMessage_InvoiceError_get_invoice_error(ptr); + org.ldk.structs.InvoiceError invoice_error_hu_conv = null; if (invoice_error < 0 || invoice_error > 4096) { invoice_error_hu_conv = new org.ldk.structs.InvoiceError(null, invoice_error); } + if (invoice_error_hu_conv != null) { invoice_error_hu_conv.ptrs_to.AddLast(this); }; + this.invoice_error = invoice_error_hu_conv; + } + } + internal long clone_ptr() { + long ret = bindings.OffersMessage_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OffersMessage + */ + public OffersMessage clone() { + long ret = bindings.OffersMessage_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvoiceRequest-variant OffersMessage + */ + public static OffersMessage invoice_request(org.ldk.structs.InvoiceRequest a) { + long ret = bindings.OffersMessage_invoice_request(a == null ? 0 : a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Invoice-variant OffersMessage + */ + public static OffersMessage invoice(org.ldk.structs.Bolt12Invoice a) { + long ret = bindings.OffersMessage_invoice(a == null ? 0 : a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InvoiceError-variant OffersMessage + */ + public static OffersMessage invoice_error(org.ldk.structs.InvoiceError a) { + long ret = bindings.OffersMessage_invoice_error(a == null ? 0 : a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * The TLV record type for the message as used in an `onionmsg_tlv` TLV stream. + */ + public long tlv_type() { + long ret = bindings.OffersMessage_tlv_type(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read + */ + public byte[] write() { + byte[] ret = bindings.OffersMessage_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a OffersMessage from a byte array, created by OffersMessage_write + */ + public static Result_OffersMessageDecodeErrorZ read(byte[] ser, long arg_a, org.ldk.structs.Logger arg_b) { + long ret = bindings.OffersMessage_read(ser, arg_a, arg_b.ptr); + GC.KeepAlive(ser); + GC.KeepAlive(arg_a); + GC.KeepAlive(arg_b); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_b); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs b/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs new file mode 100644 index 00000000..30b15de9 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs @@ -0,0 +1,67 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload. + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +public class OffersMessageHandler : CommonBase { + internal readonly bindings.LDKOffersMessageHandler bindings_instance; + internal OffersMessageHandler(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private OffersMessageHandler(bindings.LDKOffersMessageHandler arg) : base(bindings.LDKOffersMessageHandler_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~OffersMessageHandler() { + if (ptr != 0) { bindings.OffersMessageHandler_free(ptr); } + } + + public interface OffersMessageHandlerInterface { + /** + * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment, + * or replying with an error. + */ + Option_OffersMessageZ handle_message(OffersMessage _message); + } + private class LDKOffersMessageHandlerHolder { internal OffersMessageHandler held; } + private class LDKOffersMessageHandlerImpl : bindings.LDKOffersMessageHandler { + internal LDKOffersMessageHandlerImpl(OffersMessageHandlerInterface arg, LDKOffersMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private OffersMessageHandlerInterface arg; + private LDKOffersMessageHandlerHolder impl_holder; + public long handle_message(long _message) { + org.ldk.structs.OffersMessage _message_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(_message); + if (_message_hu_conv != null) { _message_hu_conv.ptrs_to.AddLast(this); }; + Option_OffersMessageZ ret = arg.handle_message(_message_hu_conv); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; + return result; + } + } + public static OffersMessageHandler new_impl(OffersMessageHandlerInterface arg) { + LDKOffersMessageHandlerHolder impl_holder = new LDKOffersMessageHandlerHolder(); + impl_holder.held = new OffersMessageHandler(new LDKOffersMessageHandlerImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment, + * or replying with an error. + */ + public Option_OffersMessageZ handle_message(org.ldk.structs.OffersMessage message) { + long ret = bindings.OffersMessageHandler_handle_message(this.ptr, message.ptr); + GC.KeepAlive(this); + GC.KeepAlive(message); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(message); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OnionMessage.cs b/c_sharp/src/org/ldk/structs/OnionMessage.cs index 60e5e0b6..f20ba5ce 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessage.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessage.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * An onion message to be sent or received from a peer + * An onion message to be sent to or received from a peer. */ public class OnionMessage : CommonBase { internal OnionMessage(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/OnionMessageContents.cs b/c_sharp/src/org/ldk/structs/OnionMessageContents.cs index dea75334..ab3ff3ff 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessageContents.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessageContents.cs @@ -18,12 +18,23 @@ public class OnionMessageContents : CommonBase { internal static OnionMessageContents constr_from_ptr(long ptr) { long raw_ty = bindings.LDKOnionMessageContents_ty_from_ptr(ptr); switch (raw_ty) { - case 0: return new OnionMessageContents_Custom(ptr); + case 0: return new OnionMessageContents_Offers(ptr); + case 1: return new OnionMessageContents_Custom(ptr); default: throw new ArgumentException("Impossible enum variant"); } } + /** A OnionMessageContents of type Offers */ + public class OnionMessageContents_Offers : OnionMessageContents { + public OffersMessage offers; + internal OnionMessageContents_Offers(long ptr) : base(null, ptr) { + long offers = bindings.LDKOnionMessageContents_Offers_get_offers(ptr); + org.ldk.structs.OffersMessage offers_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(offers); + if (offers_hu_conv != null) { offers_hu_conv.ptrs_to.AddLast(this); }; + this.offers = offers_hu_conv; + } + } /** A OnionMessageContents of type Custom */ public class OnionMessageContents_Custom : OnionMessageContents { public CustomOnionMessageContents custom; @@ -52,11 +63,24 @@ public class OnionMessageContents : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new Offers-variant OnionMessageContents + */ + public static OnionMessageContents offers(org.ldk.structs.OffersMessage a) { + long ret = bindings.OnionMessageContents_offers(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OnionMessageContents ret_hu_conv = org.ldk.structs.OnionMessageContents.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new Custom-variant OnionMessageContents */ public static OnionMessageContents custom(org.ldk.structs.CustomOnionMessageContents a) { - long ret = bindings.OnionMessageContents_custom(a == null ? 0 : a.ptr); + long ret = bindings.OnionMessageContents_custom(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessageContents ret_hu_conv = org.ldk.structs.OnionMessageContents.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs b/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs index 891c162a..6b77c7a8 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs @@ -22,7 +22,7 @@ public class OnionMessageHandler : CommonBase { public interface OnionMessageHandlerInterface { /** - * Handle an incoming onion_message message from the given peer. + * Handle an incoming `onion_message` message from the given peer. */ void handle_onion_message(byte[] _peer_node_id, OnionMessage _msg); /** @@ -33,15 +33,12 @@ public class OnionMessageHandler : CommonBase { * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - Result_NoneNoneZ peer_connected(byte[] _their_node_id, Init _init); + Result_NoneNoneZ peer_connected(byte[] _their_node_id, Init _init, bool _inbound); /** * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to * drop and refuse to forward onion messages to this peer. - * - * Note that in some rare cases this may be called without a corresponding - * [`Self::peer_connected`]. */ - void peer_disconnected(byte[] _their_node_id, bool _no_connection_possible); + void peer_disconnected(byte[] _their_node_id); /** * Gets the node feature flags which this handler itself supports. All available handlers are * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] @@ -67,15 +64,15 @@ public class OnionMessageHandler : CommonBase { arg.handle_onion_message(_peer_node_id, _msg_hu_conv); GC.KeepAlive(arg); } - public long peer_connected(byte[] _their_node_id, long _init) { + public long peer_connected(byte[] _their_node_id, long _init, bool _inbound) { org.ldk.structs.Init _init_hu_conv = null; if (_init < 0 || _init > 4096) { _init_hu_conv = new org.ldk.structs.Init(null, _init); } - Result_NoneNoneZ ret = arg.peer_connected(_their_node_id, _init_hu_conv); + Result_NoneNoneZ ret = arg.peer_connected(_their_node_id, _init_hu_conv, _inbound); GC.KeepAlive(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } - public void peer_disconnected(byte[] _their_node_id, bool _no_connection_possible) { - arg.peer_disconnected(_their_node_id, _no_connection_possible); + public void peer_disconnected(byte[] _their_node_id) { + arg.peer_disconnected(_their_node_id); GC.KeepAlive(arg); } public long provided_node_features() { @@ -107,7 +104,7 @@ public class OnionMessageHandler : CommonBase { } /** - * Handle an incoming onion_message message from the given peer. + * Handle an incoming `onion_message` message from the given peer. */ public void handle_onion_message(byte[] peer_node_id, org.ldk.structs.OnionMessage msg) { bindings.OnionMessageHandler_handle_onion_message(this.ptr, InternalUtils.check_arr_len(peer_node_id, 33), msg == null ? 0 : msg.ptr); @@ -125,11 +122,12 @@ public class OnionMessageHandler : CommonBase { * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init) { - long ret = bindings.OnionMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr); + public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init, bool inbound) { + long ret = bindings.OnionMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr, inbound); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(init); + GC.KeepAlive(inbound); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(init); }; @@ -139,15 +137,11 @@ public class OnionMessageHandler : CommonBase { /** * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to * drop and refuse to forward onion messages to this peer. - * - * Note that in some rare cases this may be called without a corresponding - * [`Self::peer_connected`]. */ - public void peer_disconnected(byte[] their_node_id, bool no_connection_possible) { - bindings.OnionMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible); + public void peer_disconnected(byte[] their_node_id) { + bindings.OnionMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33)); GC.KeepAlive(this); GC.KeepAlive(their_node_id); - GC.KeepAlive(no_connection_possible); } /** diff --git a/c_sharp/src/org/ldk/structs/OnionMessagePath.cs b/c_sharp/src/org/ldk/structs/OnionMessagePath.cs new file mode 100644 index 00000000..fca88d97 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OnionMessagePath.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A path for sending an [`msgs::OnionMessage`]. + */ +public class OnionMessagePath : CommonBase { + internal OnionMessagePath(object _dummy, long ptr) : base(ptr) { } + ~OnionMessagePath() { + if (ptr != 0) { bindings.OnionMessagePath_free(ptr); } + } + + /** + * Nodes on the path between the sender and the destination. + * + * Returns a copy of the field. + */ + public byte[][] get_intermediate_nodes() { + byte[][] ret = bindings.OnionMessagePath_get_intermediate_nodes(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Nodes on the path between the sender and the destination. + */ + public void set_intermediate_nodes(byte[][] val) { + bindings.OnionMessagePath_set_intermediate_nodes(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_8 => InternalUtils.check_arr_len(val_conv_8, 33)) : null); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The recipient of the message. + */ + public Destination get_destination() { + long ret = bindings.OnionMessagePath_get_destination(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The recipient of the message. + */ + public void set_destination(org.ldk.structs.Destination val) { + bindings.OnionMessagePath_set_destination(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new OnionMessagePath given each field + */ + public static OnionMessagePath of(byte[][] intermediate_nodes_arg, org.ldk.structs.Destination destination_arg) { + long ret = bindings.OnionMessagePath_new(intermediate_nodes_arg != null ? InternalUtils.mapArray(intermediate_nodes_arg, intermediate_nodes_arg_conv_8 => InternalUtils.check_arr_len(intermediate_nodes_arg_conv_8, 33)) : null, destination_arg.ptr); + GC.KeepAlive(intermediate_nodes_arg); + GC.KeepAlive(destination_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(destination_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.OnionMessagePath_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OnionMessagePath + */ + public OnionMessagePath clone() { + long ret = bindings.OnionMessagePath_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OnionMessenger.cs b/c_sharp/src/org/ldk/structs/OnionMessenger.cs index 8bf9adb7..457b9608 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessenger.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessenger.cs @@ -17,19 +17,25 @@ namespace org { namespace ldk { namespace structs { * # extern crate bitcoin; * # use bitcoin::hashes::_export::_core::time::Duration; * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey}; - * # use lightning::chain::keysinterface::{InMemorySigner, KeysManager, KeysInterface}; - * # use lightning::ln::msgs::DecodeError; + * # use lightning::blinded_path::BlindedPath; + * # use lightning::sign::KeysManager; * # use lightning::ln::peer_handler::IgnoringMessageHandler; - * # use lightning::onion_message::blinded_path::BlindedPath; - * # use lightning::onion_message::messenger::{CustomOnionMessageContents, Destination, OnionMessageContents, OnionMessenger}; + * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessenger, OnionMessagePath}; + * # use lightning::onion_message::packet::{CustomOnionMessageContents, OnionMessageContents}; * # use lightning::util::logger::{Logger, Record}; * # use lightning::util::ser::{Writeable, Writer}; * # use lightning::io; * # use std::sync::Arc; - * # struct FakeLogger {}; + * # struct FakeLogger; * # impl Logger for FakeLogger { * # fn log(&self, record: &Record) { unimplemented!() } * # } + * # struct FakeMessageRouter {} + * # impl MessageRouter for FakeMessageRouter { + * # fn find_path(&self, sender: PublicKey, peers: Vec, destination: Destination) -> Result { + * # unimplemented!() + * # } + * # } * # let seed = [42u8; 32]; * # let time = Duration::from_secs(123456); * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos()); @@ -39,10 +45,15 @@ namespace org { namespace ldk { namespace structs { * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret); * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1); * # let destination_node_id = hop_node_id1; - * # let your_custom_message_handler = IgnoringMessageHandler {}; + * # let message_router = Arc::new(FakeMessageRouter {}); + * # let custom_message_handler = IgnoringMessageHandler {}; + * # let offers_message_handler = IgnoringMessageHandler {}; * Create the onion messenger. This must use the same `keys_manager` as is passed to your * ChannelManager. - * let onion_messenger = OnionMessenger::new(&keys_manager, logger, your_custom_message_handler); + * let onion_messenger = OnionMessenger::new( + * &keys_manager, &keys_manager, logger, message_router, &offers_message_handler, + * &custom_message_handler + * ); * * # #[derive(Clone)] * # struct YourCustomMessage {} @@ -59,23 +70,29 @@ namespace org { namespace ldk { namespace structs { * \t} * } * Send a custom onion message to a node id. - * let intermediate_hops = [hop_node_id1, hop_node_id2]; + * let path = OnionMessagePath { + * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2], + * \tdestination: Destination::Node(destination_node_id), + * }; * let reply_path = None; * # let your_custom_message = YourCustomMessage {}; * let message = OnionMessageContents::Custom(your_custom_message); - * onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path); + * onion_messenger.send_onion_message(path, message, reply_path); * * Create a blinded path to yourself, for someone to send an onion message to. * # let your_node_id = hop_node_id1; * let hops = [hop_node_id3, hop_node_id4, your_node_id]; - * let blinded_path = BlindedPath::new(&hops, &keys_manager, &secp_ctx).unwrap(); + * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap(); * * Send a custom onion message to a blinded path. - * # let intermediate_hops = [hop_node_id1, hop_node_id2]; + * let path = OnionMessagePath { + * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2], + * \tdestination: Destination::BlindedPath(blinded_path), + * }; * let reply_path = None; * # let your_custom_message = YourCustomMessage {}; * let message = OnionMessageContents::Custom(your_custom_message); - * onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedPath(blinded_path), message, reply_path); + * onion_messenger.send_onion_message(path, message, reply_path); * ``` * * [offers]: @@ -91,35 +108,43 @@ public class OnionMessenger : CommonBase { * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to * their respective handlers. */ - public static OnionMessenger of(org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, org.ldk.structs.CustomOnionMessageHandler custom_handler) { - long ret = bindings.OnionMessenger_new(keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, custom_handler == null ? 0 : custom_handler.ptr); - GC.KeepAlive(keys_manager); + public static OnionMessenger of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.MessageRouter message_router, org.ldk.structs.OffersMessageHandler offers_handler, org.ldk.structs.CustomOnionMessageHandler custom_handler) { + long ret = bindings.OnionMessenger_new(entropy_source.ptr, node_signer.ptr, logger.ptr, message_router.ptr, offers_handler.ptr, custom_handler.ptr); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); + GC.KeepAlive(message_router); + GC.KeepAlive(offers_handler); GC.KeepAlive(custom_handler); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OnionMessenger ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessenger(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_router); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(offers_handler); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(custom_handler); }; return ret_hu_conv; } /** - * Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`. + * Send an onion message with contents `message` to the destination of `path`. + * * See [`OnionMessenger`] for example usage. * * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_NoneSendErrorZ send_onion_message(byte[][] intermediate_nodes, org.ldk.structs.Destination destination, org.ldk.structs.OnionMessageContents message, org.ldk.structs.BlindedPath reply_path) { - long ret = bindings.OnionMessenger_send_onion_message(this.ptr, intermediate_nodes != null ? InternalUtils.mapArray(intermediate_nodes, intermediate_nodes_conv_8 => InternalUtils.check_arr_len(intermediate_nodes_conv_8, 33)) : null, destination.ptr, message.ptr, reply_path == null ? 0 : reply_path.ptr); + public Result_NoneSendErrorZ send_onion_message(org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents message, org.ldk.structs.BlindedPath reply_path) { + long ret = bindings.OnionMessenger_send_onion_message(this.ptr, path == null ? 0 : path.ptr, message.ptr, reply_path == null ? 0 : reply_path.ptr); GC.KeepAlive(this); - GC.KeepAlive(intermediate_nodes); - GC.KeepAlive(destination); + GC.KeepAlive(path); GC.KeepAlive(message); GC.KeepAlive(reply_path); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(path); }; + if (this != null) { this.ptrs_to.AddLast(message); }; if (this != null) { this.ptrs_to.AddLast(reply_path); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/OpenChannel.cs b/c_sharp/src/org/ldk/structs/OpenChannel.cs index 076ef3e5..a7e11222 100644 --- a/c_sharp/src/org/ldk/structs/OpenChannel.cs +++ b/c_sharp/src/org/ldk/structs/OpenChannel.cs @@ -7,7 +7,11 @@ namespace org { namespace ldk { namespace structs { /** - * An open_channel message to be sent or received from a peer + * An [`open_channel`] message to be sent to or received from a peer. + * + * Used in V1 channel establishment + * + * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message */ public class OpenChannel : CommonBase { internal OpenChannel(object _dummy, long ptr) : base(ptr) { } @@ -160,7 +164,8 @@ public class OpenChannel : CommonBase { } /** - * The feerate per 1000-weight of sender generated transactions, until updated by update_fee + * The feerate per 1000-weight of sender generated transactions, until updated by + * [`UpdateFee`] */ public int get_feerate_per_kw() { int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr); @@ -169,7 +174,8 @@ public class OpenChannel : CommonBase { } /** - * The feerate per 1000-weight of sender generated transactions, until updated by update_fee + * The feerate per 1000-weight of sender generated transactions, until updated by + * [`UpdateFee`] */ public void set_feerate_per_kw(int val) { bindings.OpenChannel_set_feerate_per_kw(this.ptr, val); @@ -178,7 +184,8 @@ public class OpenChannel : CommonBase { } /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + * The number of blocks which the counterparty will have to wait to claim on-chain funds if + * they broadcast a commitment transaction */ public short get_to_self_delay() { short ret = bindings.OpenChannel_get_to_self_delay(this.ptr); @@ -187,7 +194,8 @@ public class OpenChannel : CommonBase { } /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + * The number of blocks which the counterparty will have to wait to claim on-chain funds if + * they broadcast a commitment transaction */ public void set_to_self_delay(short val) { bindings.OpenChannel_set_to_self_delay(this.ptr, val); @@ -322,7 +330,7 @@ public class OpenChannel : CommonBase { } /** - * Channel flags + * The channel flags to be used */ public byte get_channel_flags() { byte ret = bindings.OpenChannel_get_channel_flags(this.ptr); @@ -331,7 +339,7 @@ public class OpenChannel : CommonBase { } /** - * Channel flags + * The channel flags to be used */ public void set_channel_flags(byte val) { bindings.OpenChannel_set_channel_flags(this.ptr, val); @@ -340,9 +348,32 @@ public class OpenChannel : CommonBase { } /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. + * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close + */ + public Option_ScriptZ get_shutdown_scriptpubkey() { + long ret = bindings.OpenChannel_get_shutdown_scriptpubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScriptZ ret_hu_conv = org.ldk.structs.Option_ScriptZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close + */ + public void set_shutdown_scriptpubkey(org.ldk.structs.Option_ScriptZ val) { + bindings.OpenChannel_set_shutdown_scriptpubkey(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The channel type that this channel will represent + * + * If this is `None`, we derive the channel type from the intersection of our + * feature bits with our counterparty's feature bits from the [`Init`] message. * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -356,9 +387,10 @@ public class OpenChannel : CommonBase { } /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. + * The channel type that this channel will represent + * + * If this is `None`, we derive the channel type from the intersection of our + * feature bits with our counterparty's feature bits from the [`Init`] message. * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -369,6 +401,39 @@ public class OpenChannel : CommonBase { if (this != null) { this.ptrs_to.AddLast(val); }; } + /** + * Constructs a new OpenChannel given each field + */ + public static OpenChannel of(byte[] chain_hash_arg, byte[] temporary_channel_id_arg, long funding_satoshis_arg, long push_msat_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long channel_reserve_satoshis_arg, long htlc_minimum_msat_arg, int feerate_per_kw_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte channel_flags_arg, org.ldk.structs.Option_ScriptZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg) { + long ret = bindings.OpenChannel_new(InternalUtils.check_arr_len(chain_hash_arg, 32), InternalUtils.check_arr_len(temporary_channel_id_arg, 32), funding_satoshis_arg, push_msat_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, channel_reserve_satoshis_arg, htlc_minimum_msat_arg, feerate_per_kw_arg, to_self_delay_arg, max_accepted_htlcs_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_point_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33), InternalUtils.check_arr_len(first_per_commitment_point_arg, 33), channel_flags_arg, shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr); + GC.KeepAlive(chain_hash_arg); + GC.KeepAlive(temporary_channel_id_arg); + GC.KeepAlive(funding_satoshis_arg); + GC.KeepAlive(push_msat_arg); + GC.KeepAlive(dust_limit_satoshis_arg); + GC.KeepAlive(max_htlc_value_in_flight_msat_arg); + GC.KeepAlive(channel_reserve_satoshis_arg); + GC.KeepAlive(htlc_minimum_msat_arg); + GC.KeepAlive(feerate_per_kw_arg); + GC.KeepAlive(to_self_delay_arg); + GC.KeepAlive(max_accepted_htlcs_arg); + GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(revocation_basepoint_arg); + GC.KeepAlive(payment_point_arg); + GC.KeepAlive(delayed_payment_basepoint_arg); + GC.KeepAlive(htlc_basepoint_arg); + GC.KeepAlive(first_per_commitment_point_arg); + GC.KeepAlive(channel_flags_arg); + GC.KeepAlive(shutdown_scriptpubkey_arg); + GC.KeepAlive(channel_type_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannel(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + return ret_hu_conv; + } + internal long clone_ptr() { long ret = bindings.OpenChannel_clone_ptr(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/OpenChannelV2.cs b/c_sharp/src/org/ldk/structs/OpenChannelV2.cs new file mode 100644 index 00000000..dbe0ff4b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OpenChannelV2.cs @@ -0,0 +1,531 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An open_channel2 message to be sent by or received from the channel initiator. + * + * Used in V2 channel establishment + */ +public class OpenChannelV2 : CommonBase { + internal OpenChannelV2(object _dummy, long ptr) : base(ptr) { } + ~OpenChannelV2() { + if (ptr != 0) { bindings.OpenChannelV2_free(ptr); } + } + + /** + * The genesis hash of the blockchain where the channel is to be opened + */ + public byte[] get_chain_hash() { + byte[] ret = bindings.OpenChannelV2_get_chain_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The genesis hash of the blockchain where the channel is to be opened + */ + public void set_chain_hash(byte[] val) { + bindings.OpenChannelV2_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint + */ + public byte[] get_temporary_channel_id() { + byte[] ret = bindings.OpenChannelV2_get_temporary_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint + */ + public void set_temporary_channel_id(byte[] val) { + bindings.OpenChannelV2_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The feerate for the funding transaction set by the channel initiator + */ + public int get_funding_feerate_sat_per_1000_weight() { + int ret = bindings.OpenChannelV2_get_funding_feerate_sat_per_1000_weight(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The feerate for the funding transaction set by the channel initiator + */ + public void set_funding_feerate_sat_per_1000_weight(int val) { + bindings.OpenChannelV2_set_funding_feerate_sat_per_1000_weight(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The feerate for the commitment transaction set by the channel initiator + */ + public int get_commitment_feerate_sat_per_1000_weight() { + int ret = bindings.OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The feerate for the commitment transaction set by the channel initiator + */ + public void set_commitment_feerate_sat_per_1000_weight(int val) { + bindings.OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Part of the channel value contributed by the channel initiator + */ + public long get_funding_satoshis() { + long ret = bindings.OpenChannelV2_get_funding_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Part of the channel value contributed by the channel initiator + */ + public void set_funding_satoshis(long val) { + bindings.OpenChannelV2_set_funding_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The threshold below which outputs on transactions broadcast by the channel initiator will be + * omitted + */ + public long get_dust_limit_satoshis() { + long ret = bindings.OpenChannelV2_get_dust_limit_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The threshold below which outputs on transactions broadcast by the channel initiator will be + * omitted + */ + public void set_dust_limit_satoshis(long val) { + bindings.OpenChannelV2_set_dust_limit_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi + */ + public long get_max_htlc_value_in_flight_msat() { + long ret = bindings.OpenChannelV2_get_max_htlc_value_in_flight_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi + */ + public void set_max_htlc_value_in_flight_msat(long val) { + bindings.OpenChannelV2_set_max_htlc_value_in_flight_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The minimum HTLC size incoming to channel initiator, in milli-satoshi + */ + public long get_htlc_minimum_msat() { + long ret = bindings.OpenChannelV2_get_htlc_minimum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum HTLC size incoming to channel initiator, in milli-satoshi + */ + public void set_htlc_minimum_msat(long val) { + bindings.OpenChannelV2_set_htlc_minimum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public short get_to_self_delay() { + short ret = bindings.OpenChannelV2_get_to_self_delay(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public void set_to_self_delay(short val) { + bindings.OpenChannelV2_set_to_self_delay(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum number of inbound HTLCs towards channel initiator + */ + public short get_max_accepted_htlcs() { + short ret = bindings.OpenChannelV2_get_max_accepted_htlcs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum number of inbound HTLCs towards channel initiator + */ + public void set_max_accepted_htlcs(short val) { + bindings.OpenChannelV2_set_max_accepted_htlcs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The locktime for the funding transaction + */ + public int get_locktime() { + int ret = bindings.OpenChannelV2_get_locktime(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The locktime for the funding transaction + */ + public void set_locktime(int val) { + bindings.OpenChannelV2_set_locktime(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The channel initiator's key controlling the funding transaction + */ + public byte[] get_funding_pubkey() { + byte[] ret = bindings.OpenChannelV2_get_funding_pubkey(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel initiator's key controlling the funding transaction + */ + public void set_funding_pubkey(byte[] val) { + bindings.OpenChannelV2_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public byte[] get_revocation_basepoint() { + byte[] ret = bindings.OpenChannelV2_get_revocation_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public void set_revocation_basepoint(byte[] val) { + bindings.OpenChannelV2_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A payment key to channel initiator for transactions broadcast by counterparty + */ + public byte[] get_payment_basepoint() { + byte[] ret = bindings.OpenChannelV2_get_payment_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A payment key to channel initiator for transactions broadcast by counterparty + */ + public void set_payment_basepoint(byte[] val) { + bindings.OpenChannelV2_set_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a payment key to channel initiator for transactions broadcast by channel + * initiator + */ + public byte[] get_delayed_payment_basepoint() { + byte[] ret = bindings.OpenChannelV2_get_delayed_payment_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Used to derive a payment key to channel initiator for transactions broadcast by channel + * initiator + */ + public void set_delayed_payment_basepoint(byte[] val) { + bindings.OpenChannelV2_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive an HTLC payment key to channel initiator + */ + public byte[] get_htlc_basepoint() { + byte[] ret = bindings.OpenChannelV2_get_htlc_basepoint(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Used to derive an HTLC payment key to channel initiator + */ + public void set_htlc_basepoint(byte[] val) { + bindings.OpenChannelV2_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The first to-be-broadcast-by-channel-initiator transaction's per commitment point + */ + public byte[] get_first_per_commitment_point() { + byte[] ret = bindings.OpenChannelV2_get_first_per_commitment_point(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The first to-be-broadcast-by-channel-initiator transaction's per commitment point + */ + public void set_first_per_commitment_point(byte[] val) { + bindings.OpenChannelV2_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The second to-be-broadcast-by-channel-initiator transaction's per commitment point + */ + public byte[] get_second_per_commitment_point() { + byte[] ret = bindings.OpenChannelV2_get_second_per_commitment_point(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The second to-be-broadcast-by-channel-initiator transaction's per commitment point + */ + public void set_second_per_commitment_point(byte[] val) { + bindings.OpenChannelV2_set_second_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Channel flags + */ + public byte get_channel_flags() { + byte ret = bindings.OpenChannelV2_get_channel_flags(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Channel flags + */ + public void set_channel_flags(byte val) { + bindings.OpenChannelV2_set_channel_flags(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we + * collaboratively close + */ + public Option_ScriptZ get_shutdown_scriptpubkey() { + long ret = bindings.OpenChannelV2_get_shutdown_scriptpubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScriptZ ret_hu_conv = org.ldk.structs.Option_ScriptZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we + * collaboratively close + */ + public void set_shutdown_scriptpubkey(org.ldk.structs.Option_ScriptZ val) { + bindings.OpenChannelV2_set_shutdown_scriptpubkey(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelTypeFeatures get_channel_type() { + long ret = bindings.OpenChannelV2_get_channel_type(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { + bindings.OpenChannelV2_set_channel_type(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Optionally, a requirement that only confirmed inputs can be added + */ + public COption_NoneZ get_require_confirmed_inputs() { + COption_NoneZ ret = bindings.OpenChannelV2_get_require_confirmed_inputs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Optionally, a requirement that only confirmed inputs can be added + */ + public void set_require_confirmed_inputs(COption_NoneZ val) { + bindings.OpenChannelV2_set_require_confirmed_inputs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new OpenChannelV2 given each field + */ + public static OpenChannelV2 of(byte[] chain_hash_arg, byte[] temporary_channel_id_arg, int funding_feerate_sat_per_1000_weight_arg, int commitment_feerate_sat_per_1000_weight_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, int locktime_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte[] second_per_commitment_point_arg, byte channel_flags_arg, org.ldk.structs.Option_ScriptZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.OpenChannelV2_new(InternalUtils.check_arr_len(chain_hash_arg, 32), InternalUtils.check_arr_len(temporary_channel_id_arg, 32), funding_feerate_sat_per_1000_weight_arg, commitment_feerate_sat_per_1000_weight_arg, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, to_self_delay_arg, max_accepted_htlcs_arg, locktime_arg, InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_basepoint_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33), InternalUtils.check_arr_len(first_per_commitment_point_arg, 33), InternalUtils.check_arr_len(second_per_commitment_point_arg, 33), channel_flags_arg, shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, require_confirmed_inputs_arg); + GC.KeepAlive(chain_hash_arg); + GC.KeepAlive(temporary_channel_id_arg); + GC.KeepAlive(funding_feerate_sat_per_1000_weight_arg); + GC.KeepAlive(commitment_feerate_sat_per_1000_weight_arg); + GC.KeepAlive(funding_satoshis_arg); + GC.KeepAlive(dust_limit_satoshis_arg); + GC.KeepAlive(max_htlc_value_in_flight_msat_arg); + GC.KeepAlive(htlc_minimum_msat_arg); + GC.KeepAlive(to_self_delay_arg); + GC.KeepAlive(max_accepted_htlcs_arg); + GC.KeepAlive(locktime_arg); + GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(revocation_basepoint_arg); + GC.KeepAlive(payment_basepoint_arg); + GC.KeepAlive(delayed_payment_basepoint_arg); + GC.KeepAlive(htlc_basepoint_arg); + GC.KeepAlive(first_per_commitment_point_arg); + GC.KeepAlive(second_per_commitment_point_arg); + GC.KeepAlive(channel_flags_arg); + GC.KeepAlive(shutdown_scriptpubkey_arg); + GC.KeepAlive(channel_type_arg); + GC.KeepAlive(require_confirmed_inputs_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OpenChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannelV2(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.OpenChannelV2_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OpenChannelV2 + */ + public OpenChannelV2 clone() { + long ret = bindings.OpenChannelV2_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OpenChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannelV2(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two OpenChannelV2s contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.OpenChannelV2 b) { + bool ret = bindings.OpenChannelV2_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is OpenChannelV2)) return false; + return this.eq((OpenChannelV2)o); + } + /** + * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read + */ + public byte[] write() { + byte[] ret = bindings.OpenChannelV2_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write + */ + public static Result_OpenChannelV2DecodeErrorZ read(byte[] ser) { + long ret = bindings.OpenChannelV2_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_APIErrorZ.cs b/c_sharp/src/org/ldk/structs/Option_APIErrorZ.cs new file mode 100644 index 00000000..79a86b95 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_APIErrorZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::util::errors::APIError or not + */ +public class Option_APIErrorZ : CommonBase { + protected Option_APIErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Option_APIErrorZ() { + if (ptr != 0) { bindings.COption_APIErrorZ_free(ptr); } + } + + internal static Option_APIErrorZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_APIErrorZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_APIErrorZ_Some(ptr); + case 1: return new Option_APIErrorZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_APIErrorZ of type Some */ + public class Option_APIErrorZ_Some : Option_APIErrorZ { + public APIError some; + internal Option_APIErrorZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_APIErrorZ_Some_get_some(ptr); + org.ldk.structs.APIError some_hu_conv = org.ldk.structs.APIError.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_APIErrorZ of type None */ + public class Option_APIErrorZ_None : Option_APIErrorZ { + internal Option_APIErrorZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError + */ + public static Option_APIErrorZ some(org.ldk.structs.APIError o) { + long ret = bindings.COption_APIErrorZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_APIErrorZ ret_hu_conv = org.ldk.structs.Option_APIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_APIErrorZ containing nothing + */ + public static Option_APIErrorZ none() { + long ret = bindings.COption_APIErrorZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_APIErrorZ ret_hu_conv = org.ldk.structs.Option_APIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_APIErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_APIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_APIErrorZ clone() { + long ret = bindings.COption_APIErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_APIErrorZ ret_hu_conv = org.ldk.structs.Option_APIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_AccessZ.cs b/c_sharp/src/org/ldk/structs/Option_AccessZ.cs deleted file mode 100644 index ce958617..00000000 --- a/c_sharp/src/org/ldk/structs/Option_AccessZ.cs +++ /dev/null @@ -1,67 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -/** - * An enum which can either contain a crate::lightning::chain::Access or not - */ -public class Option_AccessZ : CommonBase { - protected Option_AccessZ(object _dummy, long ptr) : base(ptr) { } - ~Option_AccessZ() { - if (ptr != 0) { bindings.COption_AccessZ_free(ptr); } - } - - internal static Option_AccessZ constr_from_ptr(long ptr) { - long raw_ty = bindings.LDKCOption_AccessZ_ty_from_ptr(ptr); - switch (raw_ty) { - case 0: return new Option_AccessZ_Some(ptr); - case 1: return new Option_AccessZ_None(ptr); - default: - throw new ArgumentException("Impossible enum variant"); - } - } - - /** A Option_AccessZ of type Some */ - public class Option_AccessZ_Some : Option_AccessZ { - public Access some; - internal Option_AccessZ_Some(long ptr) : base(null, ptr) { - long some = bindings.LDKCOption_AccessZ_Some_get_some(ptr); - Access ret_hu_conv = new Access(null, some); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - this.some = ret_hu_conv; - } - } - /** A Option_AccessZ of type None */ - public class Option_AccessZ_None : Option_AccessZ { - internal Option_AccessZ_None(long ptr) : base(null, ptr) { - } - } - /** - * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access - */ - public static Option_AccessZ some(org.ldk.structs.Access o) { - long ret = bindings.COption_AccessZ_some(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_AccessZ ret_hu_conv = org.ldk.structs.Option_AccessZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Constructs a new COption_AccessZ containing nothing - */ - public static Option_AccessZ none() { - long ret = bindings.COption_AccessZ_none(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_AccessZ ret_hu_conv = org.ldk.structs.Option_AccessZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Option_BlockHashZ.cs b/c_sharp/src/org/ldk/structs/Option_BlockHashZ.cs new file mode 100644 index 00000000..bb039db3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_BlockHashZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not + */ +public class Option_BlockHashZ : CommonBase { + protected Option_BlockHashZ(object _dummy, long ptr) : base(ptr) { } + ~Option_BlockHashZ() { + if (ptr != 0) { bindings.COption_BlockHashZ_free(ptr); } + } + + internal static Option_BlockHashZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_BlockHashZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_BlockHashZ_Some(ptr); + case 1: return new Option_BlockHashZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_BlockHashZ of type Some */ + public class Option_BlockHashZ_Some : Option_BlockHashZ { + public byte[] some; + internal Option_BlockHashZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_BlockHashZ_Some_get_some(ptr); + } + } + /** A Option_BlockHashZ of type None */ + public class Option_BlockHashZ_None : Option_BlockHashZ { + internal Option_BlockHashZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_BlockHashZ containing a crate::c_types::ThirtyTwoBytes + */ + public static Option_BlockHashZ some(byte[] o) { + long ret = bindings.COption_BlockHashZ_some(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_BlockHashZ ret_hu_conv = org.ldk.structs.Option_BlockHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_BlockHashZ containing nothing + */ + public static Option_BlockHashZ none() { + long ret = bindings.COption_BlockHashZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_BlockHashZ ret_hu_conv = org.ldk.structs.Option_BlockHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_BlockHashZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_BlockHashZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_BlockHashZ clone() { + long ret = bindings.COption_BlockHashZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_BlockHashZ ret_hu_conv = org.ldk.structs.Option_BlockHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_C2Tuple_EightU16sEightU16sZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_EightU16sEightU16sZZ.cs new file mode 100644 index 00000000..cb718e26 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_EightU16sEightU16sZZ.cs @@ -0,0 +1,85 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::derived::C2Tuple__u168_u168Z or not + */ +public class Option_C2Tuple_EightU16sEightU16sZZ : CommonBase { + protected Option_C2Tuple_EightU16sEightU16sZZ(object _dummy, long ptr) : base(ptr) { } + ~Option_C2Tuple_EightU16sEightU16sZZ() { + if (ptr != 0) { bindings.COption_C2Tuple_EightU16sEightU16sZZ_free(ptr); } + } + + internal static Option_C2Tuple_EightU16sEightU16sZZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_C2Tuple_EightU16sEightU16sZZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_C2Tuple_EightU16sEightU16sZZ_Some(ptr); + case 1: return new Option_C2Tuple_EightU16sEightU16sZZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_C2Tuple_EightU16sEightU16sZZ of type Some */ + public class Option_C2Tuple_EightU16sEightU16sZZ_Some : Option_C2Tuple_EightU16sEightU16sZZ { + public TwoTuple__u168_u168Z some; + internal Option_C2Tuple_EightU16sEightU16sZZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_get_some(ptr); + TwoTuple__u168_u168Z some_hu_conv = new TwoTuple__u168_u168Z(null, some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_C2Tuple_EightU16sEightU16sZZ of type None */ + public class Option_C2Tuple_EightU16sEightU16sZZ_None : Option_C2Tuple_EightU16sEightU16sZZ { + internal Option_C2Tuple_EightU16sEightU16sZZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing a crate::c_types::derived::C2Tuple__u168_u168Z + */ + public static Option_C2Tuple_EightU16sEightU16sZZ some(org.ldk.structs.TwoTuple__u168_u168Z o) { + long ret = bindings.COption_C2Tuple_EightU16sEightU16sZZ_some(o != null ? o.ptr : 0); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing nothing + */ + public static Option_C2Tuple_EightU16sEightU16sZZ none() { + long ret = bindings.COption_C2Tuple_EightU16sEightU16sZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_EightU16sEightU16sZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_EightU16sEightU16sZZ clone() { + long ret = bindings.COption_C2Tuple_EightU16sEightU16sZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_CVec_ChainHashZZ.cs b/c_sharp/src/org/ldk/structs/Option_CVec_ChainHashZZ.cs new file mode 100644 index 00000000..49c008bd --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_CVec_ChainHashZZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::derived::CVec_ChainHashZ or not + */ +public class Option_CVec_ChainHashZZ : CommonBase { + protected Option_CVec_ChainHashZZ(object _dummy, long ptr) : base(ptr) { } + ~Option_CVec_ChainHashZZ() { + if (ptr != 0) { bindings.COption_CVec_ChainHashZZ_free(ptr); } + } + + internal static Option_CVec_ChainHashZZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_CVec_ChainHashZZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_CVec_ChainHashZZ_Some(ptr); + case 1: return new Option_CVec_ChainHashZZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_CVec_ChainHashZZ of type Some */ + public class Option_CVec_ChainHashZZ_Some : Option_CVec_ChainHashZZ { + public byte[][] some; + internal Option_CVec_ChainHashZZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_CVec_ChainHashZZ_Some_get_some(ptr); + } + } + /** A Option_CVec_ChainHashZZ of type None */ + public class Option_CVec_ChainHashZZ_None : Option_CVec_ChainHashZZ { + internal Option_CVec_ChainHashZZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_CVec_ChainHashZZ containing a crate::c_types::derived::CVec_ChainHashZ + */ + public static Option_CVec_ChainHashZZ some(byte[][] o) { + long ret = bindings.COption_CVec_ChainHashZZ_some(o != null ? InternalUtils.mapArray(o, o_conv_8 => InternalUtils.check_arr_len(o_conv_8, 32)) : null); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_ChainHashZZ ret_hu_conv = org.ldk.structs.Option_CVec_ChainHashZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_CVec_ChainHashZZ containing nothing + */ + public static Option_CVec_ChainHashZZ none() { + long ret = bindings.COption_CVec_ChainHashZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_ChainHashZZ ret_hu_conv = org.ldk.structs.Option_CVec_ChainHashZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_CVec_ChainHashZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_CVec_ChainHashZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_CVec_ChainHashZZ clone() { + long ret = bindings.COption_CVec_ChainHashZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_ChainHashZZ ret_hu_conv = org.ldk.structs.Option_CVec_ChainHashZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_CVec_NetAddressZZ.cs b/c_sharp/src/org/ldk/structs/Option_CVec_NetAddressZZ.cs index d2f87fd6..70910cd8 100644 --- a/c_sharp/src/org/ldk/structs/Option_CVec_NetAddressZZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_CVec_NetAddressZZ.cs @@ -54,6 +54,7 @@ public class Option_CVec_NetAddressZZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_CVec_NetAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_NetAddressZZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (NetAddress o_conv_12 in o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_conv_12); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_CVec_u8ZZ.cs b/c_sharp/src/org/ldk/structs/Option_CVec_u8ZZ.cs new file mode 100644 index 00000000..3e0cc359 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_CVec_u8ZZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not + */ +public class Option_CVec_u8ZZ : CommonBase { + protected Option_CVec_u8ZZ(object _dummy, long ptr) : base(ptr) { } + ~Option_CVec_u8ZZ() { + if (ptr != 0) { bindings.COption_CVec_u8ZZ_free(ptr); } + } + + internal static Option_CVec_u8ZZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_CVec_u8ZZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_CVec_u8ZZ_Some(ptr); + case 1: return new Option_CVec_u8ZZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_CVec_u8ZZ of type Some */ + public class Option_CVec_u8ZZ_Some : Option_CVec_u8ZZ { + public byte[] some; + internal Option_CVec_u8ZZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_CVec_u8ZZ_Some_get_some(ptr); + } + } + /** A Option_CVec_u8ZZ of type None */ + public class Option_CVec_u8ZZ_None : Option_CVec_u8ZZ { + internal Option_CVec_u8ZZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z + */ + public static Option_CVec_u8ZZ some(byte[] o) { + long ret = bindings.COption_CVec_u8ZZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_CVec_u8ZZ containing nothing + */ + public static Option_CVec_u8ZZ none() { + long ret = bindings.COption_CVec_u8ZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_CVec_u8ZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_CVec_u8ZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_CVec_u8ZZ clone() { + long ret = bindings.COption_CVec_u8ZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_ChannelShutdownStateZ.cs b/c_sharp/src/org/ldk/structs/Option_ChannelShutdownStateZ.cs new file mode 100644 index 00000000..a6954e59 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_ChannelShutdownStateZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not + */ +public class Option_ChannelShutdownStateZ : CommonBase { + protected Option_ChannelShutdownStateZ(object _dummy, long ptr) : base(ptr) { } + ~Option_ChannelShutdownStateZ() { + if (ptr != 0) { bindings.COption_ChannelShutdownStateZ_free(ptr); } + } + + internal static Option_ChannelShutdownStateZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_ChannelShutdownStateZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_ChannelShutdownStateZ_Some(ptr); + case 1: return new Option_ChannelShutdownStateZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_ChannelShutdownStateZ of type Some */ + public class Option_ChannelShutdownStateZ_Some : Option_ChannelShutdownStateZ { + public ChannelShutdownState some; + internal Option_ChannelShutdownStateZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_ChannelShutdownStateZ_Some_get_some(ptr); + } + } + /** A Option_ChannelShutdownStateZ of type None */ + public class Option_ChannelShutdownStateZ_None : Option_ChannelShutdownStateZ { + internal Option_ChannelShutdownStateZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState + */ + public static Option_ChannelShutdownStateZ some(ChannelShutdownState o) { + long ret = bindings.COption_ChannelShutdownStateZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_ChannelShutdownStateZ containing nothing + */ + public static Option_ChannelShutdownStateZ none() { + long ret = bindings.COption_ChannelShutdownStateZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_ChannelShutdownStateZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_ChannelShutdownStateZ clone() { + long ret = bindings.COption_ChannelShutdownStateZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs b/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs index eb2ca5b8..b446b58f 100644 --- a/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_ClosureReasonZ.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * An enum which can either contain a crate::lightning::util::events::ClosureReason or not + * An enum which can either contain a crate::lightning::events::ClosureReason or not */ public class Option_ClosureReasonZ : CommonBase { protected Option_ClosureReasonZ(object _dummy, long ptr) : base(ptr) { } @@ -40,7 +40,7 @@ public class Option_ClosureReasonZ : CommonBase { } } /** - * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason + * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason */ public static Option_ClosureReasonZ some(org.ldk.structs.ClosureReason o) { long ret = bindings.COption_ClosureReasonZ_some(o.ptr); @@ -48,6 +48,7 @@ public class Option_ClosureReasonZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_ClosureReasonZ ret_hu_conv = org.ldk.structs.Option_ClosureReasonZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_CustomOnionMessageContentsZ.cs b/c_sharp/src/org/ldk/structs/Option_CustomOnionMessageContentsZ.cs index b91fadde..472dcba5 100644 --- a/c_sharp/src/org/ldk/structs/Option_CustomOnionMessageContentsZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_CustomOnionMessageContentsZ.cs @@ -43,7 +43,7 @@ public class Option_CustomOnionMessageContentsZ : CommonBase { * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents */ public static Option_CustomOnionMessageContentsZ some(org.ldk.structs.CustomOnionMessageContents o) { - long ret = bindings.COption_CustomOnionMessageContentsZ_some(o == null ? 0 : o.ptr); + long ret = bindings.COption_CustomOnionMessageContentsZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_CustomOnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_DurationZ.cs b/c_sharp/src/org/ldk/structs/Option_DurationZ.cs new file mode 100644 index 00000000..b9e182d6 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_DurationZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a u64 or not + */ +public class Option_DurationZ : CommonBase { + protected Option_DurationZ(object _dummy, long ptr) : base(ptr) { } + ~Option_DurationZ() { + if (ptr != 0) { bindings.COption_DurationZ_free(ptr); } + } + + internal static Option_DurationZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_DurationZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_DurationZ_Some(ptr); + case 1: return new Option_DurationZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_DurationZ of type Some */ + public class Option_DurationZ_Some : Option_DurationZ { + public long some; + internal Option_DurationZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_DurationZ_Some_get_some(ptr); + } + } + /** A Option_DurationZ of type None */ + public class Option_DurationZ_None : Option_DurationZ { + internal Option_DurationZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_DurationZ containing a u64 + */ + public static Option_DurationZ some(long o) { + long ret = bindings.COption_DurationZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_DurationZ containing nothing + */ + public static Option_DurationZ none() { + long ret = bindings.COption_DurationZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_DurationZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_DurationZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_DurationZ clone() { + long ret = bindings.COption_DurationZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_EventZ.cs b/c_sharp/src/org/ldk/structs/Option_EventZ.cs index feeba9e3..7dbb57ae 100644 --- a/c_sharp/src/org/ldk/structs/Option_EventZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_EventZ.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * An enum which can either contain a crate::lightning::util::events::Event or not + * An enum which can either contain a crate::lightning::events::Event or not */ public class Option_EventZ : CommonBase { protected Option_EventZ(object _dummy, long ptr) : base(ptr) { } @@ -40,7 +40,7 @@ public class Option_EventZ : CommonBase { } } /** - * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event + * Constructs a new COption_EventZ containing a crate::lightning::events::Event */ public static Option_EventZ some(org.ldk.structs.Event o) { long ret = bindings.COption_EventZ_some(o.ptr); @@ -48,6 +48,7 @@ public class Option_EventZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_EventZ ret_hu_conv = org.ldk.structs.Option_EventZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_FilterZ.cs b/c_sharp/src/org/ldk/structs/Option_FilterZ.cs index b2132e8b..83b62ae5 100644 --- a/c_sharp/src/org/ldk/structs/Option_FilterZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_FilterZ.cs @@ -43,7 +43,7 @@ public class Option_FilterZ : CommonBase { * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter */ public static Option_FilterZ some(org.ldk.structs.Filter o) { - long ret = bindings.COption_FilterZ_some(o == null ? 0 : o.ptr); + long ret = bindings.COption_FilterZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_FilterZ ret_hu_conv = org.ldk.structs.Option_FilterZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs b/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs index 86874993..b7ba1f9f 100644 --- a/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_HTLCDestinationZ.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not + * An enum which can either contain a crate::lightning::events::HTLCDestination or not */ public class Option_HTLCDestinationZ : CommonBase { protected Option_HTLCDestinationZ(object _dummy, long ptr) : base(ptr) { } @@ -40,7 +40,7 @@ public class Option_HTLCDestinationZ : CommonBase { } } /** - * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination + * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination */ public static Option_HTLCDestinationZ some(org.ldk.structs.HTLCDestination o) { long ret = bindings.COption_HTLCDestinationZ_some(o.ptr); @@ -48,6 +48,7 @@ public class Option_HTLCDestinationZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_HTLCDestinationZ ret_hu_conv = org.ldk.structs.Option_HTLCDestinationZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_KeyPairZ.cs b/c_sharp/src/org/ldk/structs/Option_KeyPairZ.cs new file mode 100644 index 00000000..5722cae8 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_KeyPairZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::SecretKey or not + */ +public class Option_KeyPairZ : CommonBase { + protected Option_KeyPairZ(object _dummy, long ptr) : base(ptr) { } + ~Option_KeyPairZ() { + if (ptr != 0) { bindings.COption_KeyPairZ_free(ptr); } + } + + internal static Option_KeyPairZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_KeyPairZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_KeyPairZ_Some(ptr); + case 1: return new Option_KeyPairZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_KeyPairZ of type Some */ + public class Option_KeyPairZ_Some : Option_KeyPairZ { + public byte[] some; + internal Option_KeyPairZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_KeyPairZ_Some_get_some(ptr); + } + } + /** A Option_KeyPairZ of type None */ + public class Option_KeyPairZ_None : Option_KeyPairZ { + internal Option_KeyPairZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_KeyPairZ containing a crate::c_types::SecretKey + */ + public static Option_KeyPairZ some(byte[] o) { + long ret = bindings.COption_KeyPairZ_some(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_KeyPairZ ret_hu_conv = org.ldk.structs.Option_KeyPairZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_KeyPairZ containing nothing + */ + public static Option_KeyPairZ none() { + long ret = bindings.COption_KeyPairZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_KeyPairZ ret_hu_conv = org.ldk.structs.Option_KeyPairZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_KeyPairZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_KeyPairZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_KeyPairZ clone() { + long ret = bindings.COption_KeyPairZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_KeyPairZ ret_hu_conv = org.ldk.structs.Option_KeyPairZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_MaxDustHTLCExposureZ.cs b/c_sharp/src/org/ldk/structs/Option_MaxDustHTLCExposureZ.cs new file mode 100644 index 00000000..d1857790 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_MaxDustHTLCExposureZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not + */ +public class Option_MaxDustHTLCExposureZ : CommonBase { + protected Option_MaxDustHTLCExposureZ(object _dummy, long ptr) : base(ptr) { } + ~Option_MaxDustHTLCExposureZ() { + if (ptr != 0) { bindings.COption_MaxDustHTLCExposureZ_free(ptr); } + } + + internal static Option_MaxDustHTLCExposureZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_MaxDustHTLCExposureZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_MaxDustHTLCExposureZ_Some(ptr); + case 1: return new Option_MaxDustHTLCExposureZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_MaxDustHTLCExposureZ of type Some */ + public class Option_MaxDustHTLCExposureZ_Some : Option_MaxDustHTLCExposureZ { + public MaxDustHTLCExposure some; + internal Option_MaxDustHTLCExposureZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_MaxDustHTLCExposureZ_Some_get_some(ptr); + org.ldk.structs.MaxDustHTLCExposure some_hu_conv = org.ldk.structs.MaxDustHTLCExposure.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_MaxDustHTLCExposureZ of type None */ + public class Option_MaxDustHTLCExposureZ_None : Option_MaxDustHTLCExposureZ { + internal Option_MaxDustHTLCExposureZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure + */ + public static Option_MaxDustHTLCExposureZ some(org.ldk.structs.MaxDustHTLCExposure o) { + long ret = bindings.COption_MaxDustHTLCExposureZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MaxDustHTLCExposureZ ret_hu_conv = org.ldk.structs.Option_MaxDustHTLCExposureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_MaxDustHTLCExposureZ containing nothing + */ + public static Option_MaxDustHTLCExposureZ none() { + long ret = bindings.COption_MaxDustHTLCExposureZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MaxDustHTLCExposureZ ret_hu_conv = org.ldk.structs.Option_MaxDustHTLCExposureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_MaxDustHTLCExposureZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_MaxDustHTLCExposureZ clone() { + long ret = bindings.COption_MaxDustHTLCExposureZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_MaxDustHTLCExposureZ ret_hu_conv = org.ldk.structs.Option_MaxDustHTLCExposureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_MonitorEventZ.cs b/c_sharp/src/org/ldk/structs/Option_MonitorEventZ.cs index 10ca0582..1032ce18 100644 --- a/c_sharp/src/org/ldk/structs/Option_MonitorEventZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_MonitorEventZ.cs @@ -48,6 +48,7 @@ public class Option_MonitorEventZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_MonitorEventZ ret_hu_conv = org.ldk.structs.Option_MonitorEventZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_NetAddressZ.cs b/c_sharp/src/org/ldk/structs/Option_NetAddressZ.cs index 74240513..f2e9ca01 100644 --- a/c_sharp/src/org/ldk/structs/Option_NetAddressZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_NetAddressZ.cs @@ -48,6 +48,7 @@ public class Option_NetAddressZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_NetAddressZ ret_hu_conv = org.ldk.structs.Option_NetAddressZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs b/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs index ff05f1d9..a5b3b4f1 100644 --- a/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_NetworkUpdateZ.cs @@ -48,6 +48,7 @@ public class Option_NetworkUpdateZ : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_NetworkUpdateZ ret_hu_conv = org.ldk.structs.Option_NetworkUpdateZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_OffersMessageZ.cs b/c_sharp/src/org/ldk/structs/Option_OffersMessageZ.cs new file mode 100644 index 00000000..88a2c1fa --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_OffersMessageZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not + */ +public class Option_OffersMessageZ : CommonBase { + protected Option_OffersMessageZ(object _dummy, long ptr) : base(ptr) { } + ~Option_OffersMessageZ() { + if (ptr != 0) { bindings.COption_OffersMessageZ_free(ptr); } + } + + internal static Option_OffersMessageZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_OffersMessageZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_OffersMessageZ_Some(ptr); + case 1: return new Option_OffersMessageZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_OffersMessageZ of type Some */ + public class Option_OffersMessageZ_Some : Option_OffersMessageZ { + public OffersMessage some; + internal Option_OffersMessageZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_OffersMessageZ_Some_get_some(ptr); + org.ldk.structs.OffersMessage some_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_OffersMessageZ of type None */ + public class Option_OffersMessageZ_None : Option_OffersMessageZ { + internal Option_OffersMessageZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage + */ + public static Option_OffersMessageZ some(org.ldk.structs.OffersMessage o) { + long ret = bindings.COption_OffersMessageZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_OffersMessageZ containing nothing + */ + public static Option_OffersMessageZ none() { + long ret = bindings.COption_OffersMessageZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_OffersMessageZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_OffersMessageZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_OffersMessageZ clone() { + long ret = bindings.COption_OffersMessageZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_OffersMessageZ ret_hu_conv = org.ldk.structs.Option_OffersMessageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PackedLockTimeZ.cs b/c_sharp/src/org/ldk/structs/Option_PackedLockTimeZ.cs new file mode 100644 index 00000000..ac874e65 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PackedLockTimeZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a u32 or not + */ +public class Option_PackedLockTimeZ : CommonBase { + protected Option_PackedLockTimeZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PackedLockTimeZ() { + if (ptr != 0) { bindings.COption_PackedLockTimeZ_free(ptr); } + } + + internal static Option_PackedLockTimeZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PackedLockTimeZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PackedLockTimeZ_Some(ptr); + case 1: return new Option_PackedLockTimeZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PackedLockTimeZ of type Some */ + public class Option_PackedLockTimeZ_Some : Option_PackedLockTimeZ { + public int some; + internal Option_PackedLockTimeZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_PackedLockTimeZ_Some_get_some(ptr); + } + } + /** A Option_PackedLockTimeZ of type None */ + public class Option_PackedLockTimeZ_None : Option_PackedLockTimeZ { + internal Option_PackedLockTimeZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PackedLockTimeZ containing a u32 + */ + public static Option_PackedLockTimeZ some(int o) { + long ret = bindings.COption_PackedLockTimeZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PackedLockTimeZ ret_hu_conv = org.ldk.structs.Option_PackedLockTimeZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PackedLockTimeZ containing nothing + */ + public static Option_PackedLockTimeZ none() { + long ret = bindings.COption_PackedLockTimeZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PackedLockTimeZ ret_hu_conv = org.ldk.structs.Option_PackedLockTimeZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PackedLockTimeZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PackedLockTimeZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PackedLockTimeZ clone() { + long ret = bindings.COption_PackedLockTimeZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PackedLockTimeZ ret_hu_conv = org.ldk.structs.Option_PackedLockTimeZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PathFailureZ.cs b/c_sharp/src/org/ldk/structs/Option_PathFailureZ.cs new file mode 100644 index 00000000..b16753b9 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PathFailureZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::events::PathFailure or not + */ +public class Option_PathFailureZ : CommonBase { + protected Option_PathFailureZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PathFailureZ() { + if (ptr != 0) { bindings.COption_PathFailureZ_free(ptr); } + } + + internal static Option_PathFailureZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PathFailureZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PathFailureZ_Some(ptr); + case 1: return new Option_PathFailureZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PathFailureZ of type Some */ + public class Option_PathFailureZ_Some : Option_PathFailureZ { + public PathFailure some; + internal Option_PathFailureZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_PathFailureZ_Some_get_some(ptr); + org.ldk.structs.PathFailure some_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_PathFailureZ of type None */ + public class Option_PathFailureZ_None : Option_PathFailureZ { + internal Option_PathFailureZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure + */ + public static Option_PathFailureZ some(org.ldk.structs.PathFailure o) { + long ret = bindings.COption_PathFailureZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PathFailureZ ret_hu_conv = org.ldk.structs.Option_PathFailureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PathFailureZ containing nothing + */ + public static Option_PathFailureZ none() { + long ret = bindings.COption_PathFailureZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PathFailureZ ret_hu_conv = org.ldk.structs.Option_PathFailureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PathFailureZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PathFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PathFailureZ clone() { + long ret = bindings.COption_PathFailureZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PathFailureZ ret_hu_conv = org.ldk.structs.Option_PathFailureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PaymentFailureReasonZ.cs b/c_sharp/src/org/ldk/structs/Option_PaymentFailureReasonZ.cs new file mode 100644 index 00000000..f264ec3c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PaymentFailureReasonZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not + */ +public class Option_PaymentFailureReasonZ : CommonBase { + protected Option_PaymentFailureReasonZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PaymentFailureReasonZ() { + if (ptr != 0) { bindings.COption_PaymentFailureReasonZ_free(ptr); } + } + + internal static Option_PaymentFailureReasonZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PaymentFailureReasonZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PaymentFailureReasonZ_Some(ptr); + case 1: return new Option_PaymentFailureReasonZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PaymentFailureReasonZ of type Some */ + public class Option_PaymentFailureReasonZ_Some : Option_PaymentFailureReasonZ { + public PaymentFailureReason some; + internal Option_PaymentFailureReasonZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_PaymentFailureReasonZ_Some_get_some(ptr); + } + } + /** A Option_PaymentFailureReasonZ of type None */ + public class Option_PaymentFailureReasonZ_None : Option_PaymentFailureReasonZ { + internal Option_PaymentFailureReasonZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason + */ + public static Option_PaymentFailureReasonZ some(PaymentFailureReason o) { + long ret = bindings.COption_PaymentFailureReasonZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentFailureReasonZ ret_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PaymentFailureReasonZ containing nothing + */ + public static Option_PaymentFailureReasonZ none() { + long ret = bindings.COption_PaymentFailureReasonZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentFailureReasonZ ret_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PaymentFailureReasonZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PaymentFailureReasonZ clone() { + long ret = bindings.COption_PaymentFailureReasonZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentFailureReasonZ ret_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PaymentHashZ.cs b/c_sharp/src/org/ldk/structs/Option_PaymentHashZ.cs new file mode 100644 index 00000000..7fb2617e --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PaymentHashZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not + */ +public class Option_PaymentHashZ : CommonBase { + protected Option_PaymentHashZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PaymentHashZ() { + if (ptr != 0) { bindings.COption_PaymentHashZ_free(ptr); } + } + + internal static Option_PaymentHashZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PaymentHashZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PaymentHashZ_Some(ptr); + case 1: return new Option_PaymentHashZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PaymentHashZ of type Some */ + public class Option_PaymentHashZ_Some : Option_PaymentHashZ { + public byte[] some; + internal Option_PaymentHashZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_PaymentHashZ_Some_get_some(ptr); + } + } + /** A Option_PaymentHashZ of type None */ + public class Option_PaymentHashZ_None : Option_PaymentHashZ { + internal Option_PaymentHashZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PaymentHashZ containing a crate::c_types::ThirtyTwoBytes + */ + public static Option_PaymentHashZ some(byte[] o) { + long ret = bindings.COption_PaymentHashZ_some(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentHashZ ret_hu_conv = org.ldk.structs.Option_PaymentHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PaymentHashZ containing nothing + */ + public static Option_PaymentHashZ none() { + long ret = bindings.COption_PaymentHashZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentHashZ ret_hu_conv = org.ldk.structs.Option_PaymentHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PaymentHashZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PaymentHashZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PaymentHashZ clone() { + long ret = bindings.COption_PaymentHashZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentHashZ ret_hu_conv = org.ldk.structs.Option_PaymentHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PaymentIdZ.cs b/c_sharp/src/org/ldk/structs/Option_PaymentIdZ.cs new file mode 100644 index 00000000..56235db5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PaymentIdZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not + */ +public class Option_PaymentIdZ : CommonBase { + protected Option_PaymentIdZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PaymentIdZ() { + if (ptr != 0) { bindings.COption_PaymentIdZ_free(ptr); } + } + + internal static Option_PaymentIdZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PaymentIdZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PaymentIdZ_Some(ptr); + case 1: return new Option_PaymentIdZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PaymentIdZ of type Some */ + public class Option_PaymentIdZ_Some : Option_PaymentIdZ { + public byte[] some; + internal Option_PaymentIdZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_PaymentIdZ_Some_get_some(ptr); + } + } + /** A Option_PaymentIdZ of type None */ + public class Option_PaymentIdZ_None : Option_PaymentIdZ { + internal Option_PaymentIdZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PaymentIdZ containing a crate::c_types::ThirtyTwoBytes + */ + public static Option_PaymentIdZ some(byte[] o) { + long ret = bindings.COption_PaymentIdZ_some(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentIdZ ret_hu_conv = org.ldk.structs.Option_PaymentIdZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PaymentIdZ containing nothing + */ + public static Option_PaymentIdZ none() { + long ret = bindings.COption_PaymentIdZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentIdZ ret_hu_conv = org.ldk.structs.Option_PaymentIdZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PaymentIdZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PaymentIdZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PaymentIdZ clone() { + long ret = bindings.COption_PaymentIdZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentIdZ ret_hu_conv = org.ldk.structs.Option_PaymentIdZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PaymentPreimageZ.cs b/c_sharp/src/org/ldk/structs/Option_PaymentPreimageZ.cs new file mode 100644 index 00000000..350eb4c2 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PaymentPreimageZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not + */ +public class Option_PaymentPreimageZ : CommonBase { + protected Option_PaymentPreimageZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PaymentPreimageZ() { + if (ptr != 0) { bindings.COption_PaymentPreimageZ_free(ptr); } + } + + internal static Option_PaymentPreimageZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PaymentPreimageZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PaymentPreimageZ_Some(ptr); + case 1: return new Option_PaymentPreimageZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PaymentPreimageZ of type Some */ + public class Option_PaymentPreimageZ_Some : Option_PaymentPreimageZ { + public byte[] some; + internal Option_PaymentPreimageZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_PaymentPreimageZ_Some_get_some(ptr); + } + } + /** A Option_PaymentPreimageZ of type None */ + public class Option_PaymentPreimageZ_None : Option_PaymentPreimageZ { + internal Option_PaymentPreimageZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PaymentPreimageZ containing a crate::c_types::ThirtyTwoBytes + */ + public static Option_PaymentPreimageZ some(byte[] o) { + long ret = bindings.COption_PaymentPreimageZ_some(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentPreimageZ ret_hu_conv = org.ldk.structs.Option_PaymentPreimageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PaymentPreimageZ containing nothing + */ + public static Option_PaymentPreimageZ none() { + long ret = bindings.COption_PaymentPreimageZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentPreimageZ ret_hu_conv = org.ldk.structs.Option_PaymentPreimageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PaymentPreimageZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PaymentPreimageZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PaymentPreimageZ clone() { + long ret = bindings.COption_PaymentPreimageZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentPreimageZ ret_hu_conv = org.ldk.structs.Option_PaymentPreimageZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PaymentSecretZ.cs b/c_sharp/src/org/ldk/structs/Option_PaymentSecretZ.cs new file mode 100644 index 00000000..907b40d9 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PaymentSecretZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not + */ +public class Option_PaymentSecretZ : CommonBase { + protected Option_PaymentSecretZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PaymentSecretZ() { + if (ptr != 0) { bindings.COption_PaymentSecretZ_free(ptr); } + } + + internal static Option_PaymentSecretZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PaymentSecretZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PaymentSecretZ_Some(ptr); + case 1: return new Option_PaymentSecretZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PaymentSecretZ of type Some */ + public class Option_PaymentSecretZ_Some : Option_PaymentSecretZ { + public byte[] some; + internal Option_PaymentSecretZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_PaymentSecretZ_Some_get_some(ptr); + } + } + /** A Option_PaymentSecretZ of type None */ + public class Option_PaymentSecretZ_None : Option_PaymentSecretZ { + internal Option_PaymentSecretZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PaymentSecretZ containing a crate::c_types::ThirtyTwoBytes + */ + public static Option_PaymentSecretZ some(byte[] o) { + long ret = bindings.COption_PaymentSecretZ_some(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentSecretZ ret_hu_conv = org.ldk.structs.Option_PaymentSecretZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PaymentSecretZ containing nothing + */ + public static Option_PaymentSecretZ none() { + long ret = bindings.COption_PaymentSecretZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentSecretZ ret_hu_conv = org.ldk.structs.Option_PaymentSecretZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PaymentSecretZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PaymentSecretZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PaymentSecretZ clone() { + long ret = bindings.COption_PaymentSecretZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentSecretZ ret_hu_conv = org.ldk.structs.Option_PaymentSecretZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_ScalarZ.cs b/c_sharp/src/org/ldk/structs/Option_ScalarZ.cs index d5c98bb1..b3ef0179 100644 --- a/c_sharp/src/org/ldk/structs/Option_ScalarZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_ScalarZ.cs @@ -62,5 +62,24 @@ public class Option_ScalarZ : CommonBase { return ret_hu_conv; } + internal long clone_ptr() { + long ret = bindings.COption_ScalarZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_ScalarZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_ScalarZ clone() { + long ret = bindings.COption_ScalarZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScalarZ ret_hu_conv = org.ldk.structs.Option_ScalarZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Option_ScriptZ.cs b/c_sharp/src/org/ldk/structs/Option_ScriptZ.cs new file mode 100644 index 00000000..df9abd44 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_ScriptZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not + */ +public class Option_ScriptZ : CommonBase { + protected Option_ScriptZ(object _dummy, long ptr) : base(ptr) { } + ~Option_ScriptZ() { + if (ptr != 0) { bindings.COption_ScriptZ_free(ptr); } + } + + internal static Option_ScriptZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_ScriptZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_ScriptZ_Some(ptr); + case 1: return new Option_ScriptZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_ScriptZ of type Some */ + public class Option_ScriptZ_Some : Option_ScriptZ { + public byte[] some; + internal Option_ScriptZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_ScriptZ_Some_get_some(ptr); + } + } + /** A Option_ScriptZ of type None */ + public class Option_ScriptZ_None : Option_ScriptZ { + internal Option_ScriptZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_ScriptZ containing a crate::c_types::derived::CVec_u8Z + */ + public static Option_ScriptZ some(byte[] o) { + long ret = bindings.COption_ScriptZ_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScriptZ ret_hu_conv = org.ldk.structs.Option_ScriptZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_ScriptZ containing nothing + */ + public static Option_ScriptZ none() { + long ret = bindings.COption_ScriptZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScriptZ ret_hu_conv = org.ldk.structs.Option_ScriptZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_ScriptZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_ScriptZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_ScriptZ clone() { + long ret = bindings.COption_ScriptZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ScriptZ ret_hu_conv = org.ldk.structs.Option_ScriptZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_TxOutZ.cs b/c_sharp/src/org/ldk/structs/Option_TxOutZ.cs new file mode 100644 index 00000000..45b9a3be --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_TxOutZ.cs @@ -0,0 +1,84 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::TxOut or not + */ +public class Option_TxOutZ : CommonBase { + protected Option_TxOutZ(object _dummy, long ptr) : base(ptr) { } + ~Option_TxOutZ() { + if (ptr != 0) { bindings.COption_TxOutZ_free(ptr); } + } + + internal static Option_TxOutZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_TxOutZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_TxOutZ_Some(ptr); + case 1: return new Option_TxOutZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_TxOutZ of type Some */ + public class Option_TxOutZ_Some : Option_TxOutZ { + public TxOut some; + internal Option_TxOutZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_TxOutZ_Some_get_some(ptr); + TxOut some_conv = new TxOut(null, some); + this.some = some_conv; + } + } + /** A Option_TxOutZ of type None */ + public class Option_TxOutZ_None : Option_TxOutZ { + internal Option_TxOutZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut + */ + public static Option_TxOutZ some(org.ldk.structs.TxOut o) { + long ret = bindings.COption_TxOutZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxOutZ ret_hu_conv = org.ldk.structs.Option_TxOutZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_TxOutZ containing nothing + */ + public static Option_TxOutZ none() { + long ret = bindings.COption_TxOutZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxOutZ ret_hu_conv = org.ldk.structs.Option_TxOutZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_TxOutZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_TxOutZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_TxOutZ clone() { + long ret = bindings.COption_TxOutZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxOutZ ret_hu_conv = org.ldk.structs.Option_TxOutZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_TxidZ.cs b/c_sharp/src/org/ldk/structs/Option_TxidZ.cs new file mode 100644 index 00000000..06d31ec5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_TxidZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not + */ +public class Option_TxidZ : CommonBase { + protected Option_TxidZ(object _dummy, long ptr) : base(ptr) { } + ~Option_TxidZ() { + if (ptr != 0) { bindings.COption_TxidZ_free(ptr); } + } + + internal static Option_TxidZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_TxidZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_TxidZ_Some(ptr); + case 1: return new Option_TxidZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_TxidZ of type Some */ + public class Option_TxidZ_Some : Option_TxidZ { + public byte[] some; + internal Option_TxidZ_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_TxidZ_Some_get_some(ptr); + } + } + /** A Option_TxidZ of type None */ + public class Option_TxidZ_None : Option_TxidZ { + internal Option_TxidZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_TxidZ containing a crate::c_types::ThirtyTwoBytes + */ + public static Option_TxidZ some(byte[] o) { + long ret = bindings.COption_TxidZ_some(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxidZ ret_hu_conv = org.ldk.structs.Option_TxidZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_TxidZ containing nothing + */ + public static Option_TxidZ none() { + long ret = bindings.COption_TxidZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxidZ ret_hu_conv = org.ldk.structs.Option_TxidZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_TxidZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_TxidZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_TxidZ clone() { + long ret = bindings.COption_TxidZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_TxidZ ret_hu_conv = org.ldk.structs.Option_TxidZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_TypeZ.cs b/c_sharp/src/org/ldk/structs/Option_TypeZ.cs index 25f9e7dd..788a87bf 100644 --- a/c_sharp/src/org/ldk/structs/Option_TypeZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_TypeZ.cs @@ -43,7 +43,7 @@ public class Option_TypeZ : CommonBase { * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type */ public static Option_TypeZ some(org.ldk.structs.Type o) { - long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr); + long ret = bindings.COption_TypeZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_TypeZ ret_hu_conv = org.ldk.structs.Option_TypeZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_UtxoLookupZ.cs b/c_sharp/src/org/ldk/structs/Option_UtxoLookupZ.cs new file mode 100644 index 00000000..2f61e23c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_UtxoLookupZ.cs @@ -0,0 +1,67 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not + */ +public class Option_UtxoLookupZ : CommonBase { + protected Option_UtxoLookupZ(object _dummy, long ptr) : base(ptr) { } + ~Option_UtxoLookupZ() { + if (ptr != 0) { bindings.COption_UtxoLookupZ_free(ptr); } + } + + internal static Option_UtxoLookupZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_UtxoLookupZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_UtxoLookupZ_Some(ptr); + case 1: return new Option_UtxoLookupZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_UtxoLookupZ of type Some */ + public class Option_UtxoLookupZ_Some : Option_UtxoLookupZ { + public UtxoLookup some; + internal Option_UtxoLookupZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_UtxoLookupZ_Some_get_some(ptr); + UtxoLookup ret_hu_conv = new UtxoLookup(null, some); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + this.some = ret_hu_conv; + } + } + /** A Option_UtxoLookupZ of type None */ + public class Option_UtxoLookupZ_None : Option_UtxoLookupZ { + internal Option_UtxoLookupZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup + */ + public static Option_UtxoLookupZ some(org.ldk.structs.UtxoLookup o) { + long ret = bindings.COption_UtxoLookupZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_UtxoLookupZ ret_hu_conv = org.ldk.structs.Option_UtxoLookupZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_UtxoLookupZ containing nothing + */ + public static Option_UtxoLookupZ none() { + long ret = bindings.COption_UtxoLookupZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_UtxoLookupZ ret_hu_conv = org.ldk.structs.Option_UtxoLookupZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_WriteableScoreZ.cs b/c_sharp/src/org/ldk/structs/Option_WriteableScoreZ.cs index 51b5c721..24bdfeb8 100644 --- a/c_sharp/src/org/ldk/structs/Option_WriteableScoreZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_WriteableScoreZ.cs @@ -43,7 +43,7 @@ public class Option_WriteableScoreZ : CommonBase { * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore */ public static Option_WriteableScoreZ some(org.ldk.structs.WriteableScore o) { - long ret = bindings.COption_WriteableScoreZ_some(o == null ? 0 : o.ptr); + long ret = bindings.COption_WriteableScoreZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_WriteableScoreZ ret_hu_conv = org.ldk.structs.Option_WriteableScoreZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_i64Z.cs b/c_sharp/src/org/ldk/structs/Option_i64Z.cs new file mode 100644 index 00000000..b7b682ea --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_i64Z.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a i64 or not + */ +public class Option_i64Z : CommonBase { + protected Option_i64Z(object _dummy, long ptr) : base(ptr) { } + ~Option_i64Z() { + if (ptr != 0) { bindings.COption_i64Z_free(ptr); } + } + + internal static Option_i64Z constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_i64Z_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_i64Z_Some(ptr); + case 1: return new Option_i64Z_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_i64Z of type Some */ + public class Option_i64Z_Some : Option_i64Z { + public long some; + internal Option_i64Z_Some(long ptr) : base(null, ptr) { + this.some = bindings.LDKCOption_i64Z_Some_get_some(ptr); + } + } + /** A Option_i64Z of type None */ + public class Option_i64Z_None : Option_i64Z { + internal Option_i64Z_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_i64Z containing a i64 + */ + public static Option_i64Z some(long o) { + long ret = bindings.COption_i64Z_some(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_i64Z containing nothing + */ + public static Option_i64Z none() { + long ret = bindings.COption_i64Z_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_i64Z_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_i64Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_i64Z clone() { + long ret = bindings.COption_i64Z_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OutPoint.cs b/c_sharp/src/org/ldk/structs/OutPoint.cs index 02521101..c7187ff8 100644 --- a/c_sharp/src/org/ldk/structs/OutPoint.cs +++ b/c_sharp/src/org/ldk/structs/OutPoint.cs @@ -103,7 +103,7 @@ public class OutPoint : CommonBase { return this.eq((OutPoint)o); } /** - * Checks if two OutPoints contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the OutPoint. */ public long hash() { long ret = bindings.OutPoint_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/P2PGossipSync.cs b/c_sharp/src/org/ldk/structs/P2PGossipSync.cs index af08050a..8fc4eb5e 100644 --- a/c_sharp/src/org/ldk/structs/P2PGossipSync.cs +++ b/c_sharp/src/org/ldk/structs/P2PGossipSync.cs @@ -21,21 +21,20 @@ public class P2PGossipSync : CommonBase { /** * Creates a new tracker of the actual state of the network of channels and nodes, - * assuming an existing Network Graph. - * Chain monitor is used to make sure announced channels exist on-chain, - * channel data is correct, and that the announcement is signed with - * channel owners' keys. + * assuming an existing [`NetworkGraph`]. + * UTXO lookup is used to make sure announced channels exist on-chain, channel data is + * correct, and the announcement is signed with channel owners' keys. */ - public static P2PGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Option_AccessZ chain_access, org.ldk.structs.Logger logger) { - long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, chain_access.ptr, logger == null ? 0 : logger.ptr); + public static P2PGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Option_UtxoLookupZ utxo_lookup, org.ldk.structs.Logger logger) { + long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, utxo_lookup.ptr, logger.ptr); GC.KeepAlive(network_graph); - GC.KeepAlive(chain_access); + GC.KeepAlive(utxo_lookup); GC.KeepAlive(logger); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.P2PGossipSync ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.P2PGossipSync(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(chain_access); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(utxo_lookup); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; return ret_hu_conv; } @@ -45,11 +44,11 @@ public class P2PGossipSync : CommonBase { * existing announcements unless they are updated. * Add, update or remove the provider would replace the current one. */ - public void add_chain_access(org.ldk.structs.Option_AccessZ chain_access) { - bindings.P2PGossipSync_add_chain_access(this.ptr, chain_access.ptr); + public void add_utxo_lookup(org.ldk.structs.Option_UtxoLookupZ utxo_lookup) { + bindings.P2PGossipSync_add_utxo_lookup(this.ptr, utxo_lookup.ptr); GC.KeepAlive(this); - GC.KeepAlive(chain_access); - if (this != null) { this.ptrs_to.AddLast(chain_access); }; + GC.KeepAlive(utxo_lookup); + if (this != null) { this.ptrs_to.AddLast(utxo_lookup); }; } /** diff --git a/c_sharp/src/org/ldk/structs/ParseError.cs b/c_sharp/src/org/ldk/structs/ParseError.cs deleted file mode 100644 index 88df7206..00000000 --- a/c_sharp/src/org/ldk/structs/ParseError.cs +++ /dev/null @@ -1,397 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -/** - * Errors that indicate what is wrong with the invoice. They have some granularity for debug - * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user. - */ -public class ParseError : CommonBase { - protected ParseError(object _dummy, long ptr) : base(ptr) { } - ~ParseError() { - if (ptr != 0) { bindings.ParseError_free(ptr); } - } - - internal static ParseError constr_from_ptr(long ptr) { - long raw_ty = bindings.LDKParseError_ty_from_ptr(ptr); - switch (raw_ty) { - case 0: return new ParseError_Bech32Error(ptr); - case 1: return new ParseError_ParseAmountError(ptr); - case 2: return new ParseError_MalformedSignature(ptr); - case 3: return new ParseError_BadPrefix(ptr); - case 4: return new ParseError_UnknownCurrency(ptr); - case 5: return new ParseError_UnknownSiPrefix(ptr); - case 6: return new ParseError_MalformedHRP(ptr); - case 7: return new ParseError_TooShortDataPart(ptr); - case 8: return new ParseError_UnexpectedEndOfTaggedFields(ptr); - case 9: return new ParseError_DescriptionDecodeError(ptr); - case 10: return new ParseError_PaddingError(ptr); - case 11: return new ParseError_IntegerOverflowError(ptr); - case 12: return new ParseError_InvalidSegWitProgramLength(ptr); - case 13: return new ParseError_InvalidPubKeyHashLength(ptr); - case 14: return new ParseError_InvalidScriptHashLength(ptr); - case 15: return new ParseError_InvalidRecoveryId(ptr); - case 16: return new ParseError_InvalidSliceLength(ptr); - case 17: return new ParseError_Skip(ptr); - default: - throw new ArgumentException("Impossible enum variant"); - } - } - - /** A ParseError of type Bech32Error */ - public class ParseError_Bech32Error : ParseError { - public Bech32Error bech32_error; - internal ParseError_Bech32Error(long ptr) : base(null, ptr) { - long bech32_error = bindings.LDKParseError_Bech32Error_get_bech32_error(ptr); - org.ldk.structs.Bech32Error bech32_error_hu_conv = org.ldk.structs.Bech32Error.constr_from_ptr(bech32_error); - if (bech32_error_hu_conv != null) { bech32_error_hu_conv.ptrs_to.AddLast(this); }; - this.bech32_error = bech32_error_hu_conv; - } - } - /** A ParseError of type ParseAmountError */ - public class ParseError_ParseAmountError : ParseError { - public UnqualifiedError parse_amount_error; - internal ParseError_ParseAmountError(long ptr) : base(null, ptr) { - int parse_amount_error = bindings.LDKParseError_ParseAmountError_get_parse_amount_error(ptr); - UnqualifiedError parse_amount_error_conv = new UnqualifiedError(parse_amount_error); - this.parse_amount_error = parse_amount_error_conv; - } - } - /** A ParseError of type MalformedSignature */ - public class ParseError_MalformedSignature : ParseError { - public Secp256k1Error malformed_signature; - internal ParseError_MalformedSignature(long ptr) : base(null, ptr) { - this.malformed_signature = bindings.LDKParseError_MalformedSignature_get_malformed_signature(ptr); - } - } - /** A ParseError of type BadPrefix */ - public class ParseError_BadPrefix : ParseError { - internal ParseError_BadPrefix(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type UnknownCurrency */ - public class ParseError_UnknownCurrency : ParseError { - internal ParseError_UnknownCurrency(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type UnknownSiPrefix */ - public class ParseError_UnknownSiPrefix : ParseError { - internal ParseError_UnknownSiPrefix(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type MalformedHRP */ - public class ParseError_MalformedHRP : ParseError { - internal ParseError_MalformedHRP(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type TooShortDataPart */ - public class ParseError_TooShortDataPart : ParseError { - internal ParseError_TooShortDataPart(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type UnexpectedEndOfTaggedFields */ - public class ParseError_UnexpectedEndOfTaggedFields : ParseError { - internal ParseError_UnexpectedEndOfTaggedFields(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type DescriptionDecodeError */ - public class ParseError_DescriptionDecodeError : ParseError { - public UnqualifiedError description_decode_error; - internal ParseError_DescriptionDecodeError(long ptr) : base(null, ptr) { - int description_decode_error = bindings.LDKParseError_DescriptionDecodeError_get_description_decode_error(ptr); - UnqualifiedError description_decode_error_conv = new UnqualifiedError(description_decode_error); - this.description_decode_error = description_decode_error_conv; - } - } - /** A ParseError of type PaddingError */ - public class ParseError_PaddingError : ParseError { - internal ParseError_PaddingError(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type IntegerOverflowError */ - public class ParseError_IntegerOverflowError : ParseError { - internal ParseError_IntegerOverflowError(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type InvalidSegWitProgramLength */ - public class ParseError_InvalidSegWitProgramLength : ParseError { - internal ParseError_InvalidSegWitProgramLength(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type InvalidPubKeyHashLength */ - public class ParseError_InvalidPubKeyHashLength : ParseError { - internal ParseError_InvalidPubKeyHashLength(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type InvalidScriptHashLength */ - public class ParseError_InvalidScriptHashLength : ParseError { - internal ParseError_InvalidScriptHashLength(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type InvalidRecoveryId */ - public class ParseError_InvalidRecoveryId : ParseError { - internal ParseError_InvalidRecoveryId(long ptr) : base(null, ptr) { - } - } - /** A ParseError of type InvalidSliceLength */ - public class ParseError_InvalidSliceLength : ParseError { - public string invalid_slice_length; - internal ParseError_InvalidSliceLength(long ptr) : base(null, ptr) { - this.invalid_slice_length = bindings.LDKParseError_InvalidSliceLength_get_invalid_slice_length(ptr); - } - } - /** A ParseError of type Skip */ - public class ParseError_Skip : ParseError { - internal ParseError_Skip(long ptr) : base(null, ptr) { - } - } - internal long clone_ptr() { - long ret = bindings.ParseError_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the ParseError - */ - public ParseError clone() { - long ret = bindings.ParseError_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new Bech32Error-variant ParseError - */ - public static ParseError bech32_error(org.ldk.structs.Bech32Error a) { - long ret = bindings.ParseError_bech32_error(a.ptr); - GC.KeepAlive(a); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new ParseAmountError-variant ParseError - */ - public static ParseError parse_amount_error(org.ldk.util.UnqualifiedError a) { - long ret = bindings.ParseError_parse_amount_error(0); - GC.KeepAlive(a); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new MalformedSignature-variant ParseError - */ - public static ParseError malformed_signature(Secp256k1Error a) { - long ret = bindings.ParseError_malformed_signature(a); - GC.KeepAlive(a); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new BadPrefix-variant ParseError - */ - public static ParseError bad_prefix() { - long ret = bindings.ParseError_bad_prefix(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new UnknownCurrency-variant ParseError - */ - public static ParseError unknown_currency() { - long ret = bindings.ParseError_unknown_currency(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new UnknownSiPrefix-variant ParseError - */ - public static ParseError unknown_si_prefix() { - long ret = bindings.ParseError_unknown_si_prefix(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new MalformedHRP-variant ParseError - */ - public static ParseError malformed_hrp() { - long ret = bindings.ParseError_malformed_hrp(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new TooShortDataPart-variant ParseError - */ - public static ParseError too_short_data_part() { - long ret = bindings.ParseError_too_short_data_part(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError - */ - public static ParseError unexpected_end_of_tagged_fields() { - long ret = bindings.ParseError_unexpected_end_of_tagged_fields(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new DescriptionDecodeError-variant ParseError - */ - public static ParseError description_decode_error(org.ldk.util.UnqualifiedError a) { - long ret = bindings.ParseError_description_decode_error(0); - GC.KeepAlive(a); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new PaddingError-variant ParseError - */ - public static ParseError padding_error() { - long ret = bindings.ParseError_padding_error(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new IntegerOverflowError-variant ParseError - */ - public static ParseError integer_overflow_error() { - long ret = bindings.ParseError_integer_overflow_error(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError - */ - public static ParseError invalid_seg_wit_program_length() { - long ret = bindings.ParseError_invalid_seg_wit_program_length(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError - */ - public static ParseError invalid_pub_key_hash_length() { - long ret = bindings.ParseError_invalid_pub_key_hash_length(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidScriptHashLength-variant ParseError - */ - public static ParseError invalid_script_hash_length() { - long ret = bindings.ParseError_invalid_script_hash_length(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidRecoveryId-variant ParseError - */ - public static ParseError invalid_recovery_id() { - long ret = bindings.ParseError_invalid_recovery_id(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidSliceLength-variant ParseError - */ - public static ParseError invalid_slice_length(string a) { - long ret = bindings.ParseError_invalid_slice_length(a); - GC.KeepAlive(a); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new Skip-variant ParseError - */ - public static ParseError skip() { - long ret = bindings.ParseError_skip(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ParseError ret_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Checks if two ParseErrors contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - */ - public bool eq(org.ldk.structs.ParseError b) { - bool ret = bindings.ParseError_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - return ret; - } - - public override bool Equals(object o) { - if (!(o is ParseError)) return false; - return this.eq((ParseError)o); - } - /** - * Get the string representation of a ParseError object - */ - public string to_str() { - string ret = bindings.ParseError_to_str(this.ptr); - GC.KeepAlive(this); - return ret; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs b/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs index 509bd584..c534f890 100644 --- a/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs +++ b/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs @@ -28,17 +28,17 @@ public class ParseOrSemanticError : CommonBase { /** A ParseOrSemanticError of type ParseError */ public class ParseOrSemanticError_ParseError : ParseOrSemanticError { - public ParseError parse_error; + public Bolt11ParseError parse_error; internal ParseOrSemanticError_ParseError(long ptr) : base(null, ptr) { long parse_error = bindings.LDKParseOrSemanticError_ParseError_get_parse_error(ptr); - org.ldk.structs.ParseError parse_error_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(parse_error); + org.ldk.structs.Bolt11ParseError parse_error_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(parse_error); if (parse_error_hu_conv != null) { parse_error_hu_conv.ptrs_to.AddLast(this); }; this.parse_error = parse_error_hu_conv; } } /** A ParseOrSemanticError of type SemanticError */ public class ParseOrSemanticError_SemanticError : ParseOrSemanticError { - public SemanticError semantic_error; + public Bolt11SemanticError semantic_error; internal ParseOrSemanticError_SemanticError(long ptr) : base(null, ptr) { this.semantic_error = bindings.LDKParseOrSemanticError_SemanticError_get_semantic_error(ptr); } @@ -64,19 +64,20 @@ public class ParseOrSemanticError : CommonBase { /** * Utility method to constructs a new ParseError-variant ParseOrSemanticError */ - public static ParseOrSemanticError parse_error(org.ldk.structs.ParseError a) { + public static ParseOrSemanticError parse_error(org.ldk.structs.Bolt11ParseError a) { long ret = bindings.ParseOrSemanticError_parse_error(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ParseOrSemanticError ret_hu_conv = org.ldk.structs.ParseOrSemanticError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; return ret_hu_conv; } /** * Utility method to constructs a new SemanticError-variant ParseOrSemanticError */ - public static ParseOrSemanticError semantic_error(SemanticError a) { + public static ParseOrSemanticError semantic_error(Bolt11SemanticError a) { long ret = bindings.ParseOrSemanticError_semantic_error(a); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/Path.cs b/c_sharp/src/org/ldk/structs/Path.cs new file mode 100644 index 00000000..a48757dc --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Path.cs @@ -0,0 +1,165 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A path in a [`Route`] to the payment recipient. Must always be at least length one. + * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19. + */ +public class Path : CommonBase { + internal Path(object _dummy, long ptr) : base(ptr) { } + ~Path() { + if (ptr != 0) { bindings.Path_free(ptr); } + } + + /** + * The list of unblinded hops in this [`Path`]. Must be at least length one. + */ + public RouteHop[] get_hops() { + long[] ret = bindings.Path_get_hops(this.ptr); + GC.KeepAlive(this); + int ret_conv_10_len = ret.Length; + RouteHop[] ret_conv_10_arr = new RouteHop[ret_conv_10_len]; + for (int k = 0; k < ret_conv_10_len; k++) { + long ret_conv_10 = ret[k]; + org.ldk.structs.RouteHop ret_conv_10_hu_conv = null; if (ret_conv_10 < 0 || ret_conv_10 > 4096) { ret_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, ret_conv_10); } + if (ret_conv_10_hu_conv != null) { ret_conv_10_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_10_arr[k] = ret_conv_10_hu_conv; + } + return ret_conv_10_arr; + } + + /** + * The list of unblinded hops in this [`Path`]. Must be at least length one. + */ + public void set_hops(RouteHop[] val) { + bindings.Path_set_hops(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_10 => val_conv_10 == null ? 0 : val_conv_10.ptr) : null); + GC.KeepAlive(this); + GC.KeepAlive(val); + foreach (RouteHop val_conv_10 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_10); }; }; + } + + /** + * The blinded path at which this path terminates, if we're sending to one, and its metadata. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public BlindedTail get_blinded_tail() { + long ret = bindings.Path_get_blinded_tail(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedTail ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedTail(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The blinded path at which this path terminates, if we're sending to one, and its metadata. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_blinded_tail(org.ldk.structs.BlindedTail val) { + bindings.Path_set_blinded_tail(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new Path given each field + */ + public static Path of(RouteHop[] hops_arg, org.ldk.structs.BlindedTail blinded_tail_arg) { + long ret = bindings.Path_new(hops_arg != null ? InternalUtils.mapArray(hops_arg, hops_arg_conv_10 => hops_arg_conv_10 == null ? 0 : hops_arg_conv_10.ptr) : null, blinded_tail_arg == null ? 0 : blinded_tail_arg.ptr); + GC.KeepAlive(hops_arg); + GC.KeepAlive(blinded_tail_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Path ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Path(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (RouteHop hops_arg_conv_10 in hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(hops_arg_conv_10); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(blinded_tail_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.Path_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Path + */ + public Path clone() { + long ret = bindings.Path_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Path ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Path(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the Path. + */ + public long hash() { + long ret = bindings.Path_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two Paths contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Path b) { + bool ret = bindings.Path_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Path)) return false; + return this.eq((Path)o); + } + /** + * Gets the fees for a given path, excluding any excess paid to the recipient. + */ + public long fee_msat() { + long ret = bindings.Path_fee_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Gets the total amount paid on this [`Path`], excluding the fees. + */ + public long final_value_msat() { + long ret = bindings.Path_final_value_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Gets the final hop's CLTV expiry delta. + */ + public Option_u32Z final_cltv_expiry_delta() { + long ret = bindings.Path_final_cltv_expiry_delta(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/PathFailure.cs b/c_sharp/src/org/ldk/structs/PathFailure.cs new file mode 100644 index 00000000..c4c30685 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/PathFailure.cs @@ -0,0 +1,130 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may + * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`]. + * + * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate + * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph + */ +public class PathFailure : CommonBase { + protected PathFailure(object _dummy, long ptr) : base(ptr) { } + ~PathFailure() { + if (ptr != 0) { bindings.PathFailure_free(ptr); } + } + + internal static PathFailure constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKPathFailure_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new PathFailure_InitialSend(ptr); + case 1: return new PathFailure_OnPath(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A PathFailure of type InitialSend */ + public class PathFailure_InitialSend : PathFailure { + /** + * The error surfaced from initial send. + */ + public APIError err; + internal PathFailure_InitialSend(long ptr) : base(null, ptr) { + long err = bindings.LDKPathFailure_InitialSend_get_err(ptr); + org.ldk.structs.APIError err_hu_conv = org.ldk.structs.APIError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + /** A PathFailure of type OnPath */ + public class PathFailure_OnPath : PathFailure { + /** + * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing + * decisions can take into account the update. + * + * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate + * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph + */ + public Option_NetworkUpdateZ network_update; + internal PathFailure_OnPath(long ptr) : base(null, ptr) { + long network_update = bindings.LDKPathFailure_OnPath_get_network_update(ptr); + org.ldk.structs.Option_NetworkUpdateZ network_update_hu_conv = org.ldk.structs.Option_NetworkUpdateZ.constr_from_ptr(network_update); + if (network_update_hu_conv != null) { network_update_hu_conv.ptrs_to.AddLast(this); }; + this.network_update = network_update_hu_conv; + } + } + internal long clone_ptr() { + long ret = bindings.PathFailure_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the PathFailure + */ + public PathFailure clone() { + long ret = bindings.PathFailure_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PathFailure ret_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new InitialSend-variant PathFailure + */ + public static PathFailure initial_send(org.ldk.structs.APIError err) { + long ret = bindings.PathFailure_initial_send(err.ptr); + GC.KeepAlive(err); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PathFailure ret_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(err); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new OnPath-variant PathFailure + */ + public static PathFailure on_path(org.ldk.structs.Option_NetworkUpdateZ network_update) { + long ret = bindings.PathFailure_on_path(network_update.ptr); + GC.KeepAlive(network_update); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PathFailure ret_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_update); }; + return ret_hu_conv; + } + + /** + * Checks if two PathFailures contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.PathFailure b) { + bool ret = bindings.PathFailure_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is PathFailure)) return false; + return this.eq((PathFailure)o); + } + /** + * Serialize the PathFailure object into a byte array which can be read by PathFailure_read + */ + public byte[] write() { + byte[] ret = bindings.PathFailure_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Payee.cs b/c_sharp/src/org/ldk/structs/Payee.cs new file mode 100644 index 00000000..fd4f93d0 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Payee.cs @@ -0,0 +1,182 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * The recipient of a payment, differing based on whether they've hidden their identity with route + * blinding. + */ +public class Payee : CommonBase { + protected Payee(object _dummy, long ptr) : base(ptr) { } + ~Payee() { + if (ptr != 0) { bindings.Payee_free(ptr); } + } + + internal static Payee constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKPayee_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Payee_Blinded(ptr); + case 1: return new Payee_Clear(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Payee of type Blinded */ + public class Payee_Blinded : Payee { + /** + * Aggregated routing info and blinded paths, for routing to the payee without knowing their + * node id. + */ + public TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints; + /** + * Features supported by the payee. + * + * May be set from the payee's invoice. May be `None` if the invoice does not contain any + * features. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Bolt12InvoiceFeatures features; + internal Payee_Blinded(long ptr) : base(null, ptr) { + long[] route_hints = bindings.LDKPayee_Blinded_get_route_hints(ptr); + int route_hints_conv_37_len = route_hints.Length; + TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints_conv_37_arr = new TwoTuple_BlindedPayInfoBlindedPathZ[route_hints_conv_37_len]; + for (int l = 0; l < route_hints_conv_37_len; l++) { + long route_hints_conv_37 = route_hints[l]; + TwoTuple_BlindedPayInfoBlindedPathZ route_hints_conv_37_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, route_hints_conv_37); + if (route_hints_conv_37_hu_conv != null) { route_hints_conv_37_hu_conv.ptrs_to.AddLast(this); }; + route_hints_conv_37_arr[l] = route_hints_conv_37_hu_conv; + } + this.route_hints = route_hints_conv_37_arr; + long features = bindings.LDKPayee_Blinded_get_features(ptr); + org.ldk.structs.Bolt12InvoiceFeatures features_hu_conv = null; if (features < 0 || features > 4096) { features_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, features); } + if (features_hu_conv != null) { features_hu_conv.ptrs_to.AddLast(this); }; + this.features = features_hu_conv; + } + } + /** A Payee of type Clear */ + public class Payee_Clear : Payee { + /** + * The node id of the payee. + */ + public byte[] node_id; + /** + * Hints for routing to the payee, containing channels connecting the payee to public nodes. + */ + public RouteHint[] route_hints; + /** + * Features supported by the payee. + * + * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice + * does not contain any features. + * + * [`for_keysend`]: PaymentParameters::for_keysend + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Bolt11InvoiceFeatures features; + /** + * The minimum CLTV delta at the end of the route. This value must not be zero. + */ + public int final_cltv_expiry_delta; + internal Payee_Clear(long ptr) : base(null, ptr) { + this.node_id = bindings.LDKPayee_Clear_get_node_id(ptr); + long[] route_hints = bindings.LDKPayee_Clear_get_route_hints(ptr); + int route_hints_conv_11_len = route_hints.Length; + RouteHint[] route_hints_conv_11_arr = new RouteHint[route_hints_conv_11_len]; + for (int l = 0; l < route_hints_conv_11_len; l++) { + long route_hints_conv_11 = route_hints[l]; + org.ldk.structs.RouteHint route_hints_conv_11_hu_conv = null; if (route_hints_conv_11 < 0 || route_hints_conv_11 > 4096) { route_hints_conv_11_hu_conv = new org.ldk.structs.RouteHint(null, route_hints_conv_11); } + if (route_hints_conv_11_hu_conv != null) { route_hints_conv_11_hu_conv.ptrs_to.AddLast(this); }; + route_hints_conv_11_arr[l] = route_hints_conv_11_hu_conv; + } + this.route_hints = route_hints_conv_11_arr; + long features = bindings.LDKPayee_Clear_get_features(ptr); + org.ldk.structs.Bolt11InvoiceFeatures features_hu_conv = null; if (features < 0 || features > 4096) { features_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, features); } + if (features_hu_conv != null) { features_hu_conv.ptrs_to.AddLast(this); }; + this.features = features_hu_conv; + this.final_cltv_expiry_delta = bindings.LDKPayee_Clear_get_final_cltv_expiry_delta(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.Payee_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Payee + */ + public Payee clone() { + long ret = bindings.Payee_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Blinded-variant Payee + */ + public static Payee blinded(TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints, org.ldk.structs.Bolt12InvoiceFeatures features) { + long ret = bindings.Payee_blinded(route_hints != null ? InternalUtils.mapArray(route_hints, route_hints_conv_37 => route_hints_conv_37 != null ? route_hints_conv_37.ptr : 0) : null, features == null ? 0 : features.ptr); + GC.KeepAlive(route_hints); + GC.KeepAlive(features); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Clear-variant Payee + */ + public static Payee clear(byte[] node_id, RouteHint[] route_hints, org.ldk.structs.Bolt11InvoiceFeatures features, int final_cltv_expiry_delta) { + long ret = bindings.Payee_clear(InternalUtils.check_arr_len(node_id, 33), route_hints != null ? InternalUtils.mapArray(route_hints, route_hints_conv_11 => route_hints_conv_11 == null ? 0 : route_hints_conv_11.ptr) : null, features == null ? 0 : features.ptr, final_cltv_expiry_delta); + GC.KeepAlive(node_id); + GC.KeepAlive(route_hints); + GC.KeepAlive(features); + GC.KeepAlive(final_cltv_expiry_delta); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (RouteHint route_hints_conv_11 in route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_hints_conv_11); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the Payee. + */ + public long hash() { + long ret = bindings.Payee_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two Payees contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.Payee b) { + bool ret = bindings.Payee_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is Payee)) return false; + return this.eq((Payee)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/PayeePubKey.cs b/c_sharp/src/org/ldk/structs/PayeePubKey.cs index 85e1b2e4..f10ae64a 100644 --- a/c_sharp/src/org/ldk/structs/PayeePubKey.cs +++ b/c_sharp/src/org/ldk/structs/PayeePubKey.cs @@ -58,7 +58,7 @@ public class PayeePubKey : CommonBase { } /** - * Checks if two PayeePubKeys contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the PayeePubKey. */ public long hash() { long ret = bindings.PayeePubKey_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/Payer.cs b/c_sharp/src/org/ldk/structs/Payer.cs deleted file mode 100644 index cb305f88..00000000 --- a/c_sharp/src/org/ldk/structs/Payer.cs +++ /dev/null @@ -1,217 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -/** - * A trait defining behavior of an [`Invoice`] payer. - * - * While the behavior of [`InvoicePayer`] provides idempotency of duplicate `send_*payment` calls - * with the same [`PaymentHash`], it is up to the `Payer` to provide idempotency across restarts. - * - * [`ChannelManager`] provides idempotency for duplicate payments with the same [`PaymentId`]. - * - * In order to trivially ensure idempotency for payments, the default `Payer` implementation - * reuses the [`PaymentHash`] bytes as the [`PaymentId`]. Custom implementations wishing to - * provide payment idempotency with a different idempotency key (i.e. [`PaymentId`]) should map - * the [`Invoice`] or spontaneous payment target pubkey to their own idempotency key. - * - * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager - */ -public class Payer : CommonBase { - internal readonly bindings.LDKPayer bindings_instance; - internal Payer(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } - private Payer(bindings.LDKPayer arg) : base(bindings.LDKPayer_new(arg)) { - this.ptrs_to.AddLast(arg); - this.bindings_instance = arg; - } - ~Payer() { - if (ptr != 0) { bindings.Payer_free(ptr); } - } - - public interface PayerInterface { - /** - * Returns the payer's node id. - */ - byte[] node_id(); - /** - * Returns the payer's channels. - */ - ChannelDetails[] first_hops(); - /** - * Sends a payment over the Lightning Network using the given [`Route`]. - * - * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - Result_NonePaymentSendFailureZ send_payment(Route _route, byte[] _payment_hash, byte[] _payment_secret, byte[] _payment_id); - /** - * Sends a spontaneous payment over the Lightning Network using the given [`Route`]. - */ - Result_NonePaymentSendFailureZ send_spontaneous_payment(Route _route, byte[] _payment_preimage, byte[] _payment_id); - /** - * Retries a failed payment path for the [`PaymentId`] using the given [`Route`]. - */ - Result_NonePaymentSendFailureZ retry_payment(Route _route, byte[] _payment_id); - /** - * Signals that no further retries for the given payment will occur. - */ - void abandon_payment(byte[] _payment_id); - /** - * Construct an [`InFlightHtlcs`] containing information about currently used up liquidity - * across payments. - */ - InFlightHtlcs inflight_htlcs(); - } - private class LDKPayerHolder { internal Payer held; } - private class LDKPayerImpl : bindings.LDKPayer { - internal LDKPayerImpl(PayerInterface arg, LDKPayerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } - private PayerInterface arg; - private LDKPayerHolder impl_holder; - public byte[] node_id() { - byte[] ret = arg.node_id(); - GC.KeepAlive(arg); - byte[] result = InternalUtils.check_arr_len(ret, 33); - return result; - } - public long[] first_hops() { - ChannelDetails[] ret = arg.first_hops(); - GC.KeepAlive(arg); - long[] result = ret != null ? InternalUtils.mapArray(ret, ret_conv_16 => ret_conv_16 == null ? 0 : ret_conv_16.clone_ptr()) : null; - return result; - } - public long send_payment(long _route, byte[] _payment_hash, byte[] _payment_secret, byte[] _payment_id) { - org.ldk.structs.Route _route_hu_conv = null; if (_route < 0 || _route > 4096) { _route_hu_conv = new org.ldk.structs.Route(null, _route); } - Result_NonePaymentSendFailureZ ret = arg.send_payment(_route_hu_conv, _payment_hash, _payment_secret, _payment_id); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long send_spontaneous_payment(long _route, byte[] _payment_preimage, byte[] _payment_id) { - org.ldk.structs.Route _route_hu_conv = null; if (_route < 0 || _route > 4096) { _route_hu_conv = new org.ldk.structs.Route(null, _route); } - Result_NonePaymentSendFailureZ ret = arg.send_spontaneous_payment(_route_hu_conv, _payment_preimage, _payment_id); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public long retry_payment(long _route, byte[] _payment_id) { - org.ldk.structs.Route _route_hu_conv = null; if (_route < 0 || _route > 4096) { _route_hu_conv = new org.ldk.structs.Route(null, _route); } - Result_NonePaymentSendFailureZ ret = arg.retry_payment(_route_hu_conv, _payment_id); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - public void abandon_payment(byte[] _payment_id) { - arg.abandon_payment(_payment_id); - GC.KeepAlive(arg); - } - public long inflight_htlcs() { - InFlightHtlcs ret = arg.inflight_htlcs(); - GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); - return result; - } - } - public static Payer new_impl(PayerInterface arg) { - LDKPayerHolder impl_holder = new LDKPayerHolder(); - impl_holder.held = new Payer(new LDKPayerImpl(arg, impl_holder)); - return impl_holder.held; - } - /** - * Returns the payer's node id. - */ - public byte[] node_id() { - byte[] ret = bindings.Payer_node_id(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Returns the payer's channels. - */ - public ChannelDetails[] first_hops() { - long[] ret = bindings.Payer_first_hops(this.ptr); - GC.KeepAlive(this); - int ret_conv_16_len = ret.Length; - ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret_conv_16_len]; - for (int q = 0; q < ret_conv_16_len; q++) { - long ret_conv_16 = ret[q]; - org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } - if (ret_conv_16_hu_conv != null) { ret_conv_16_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_16_arr[q] = ret_conv_16_hu_conv; - } - return ret_conv_16_arr; - } - - /** - * Sends a payment over the Lightning Network using the given [`Route`]. - * - * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public Result_NonePaymentSendFailureZ send_payment(org.ldk.structs.Route route, byte[] payment_hash, byte[] payment_secret, byte[] payment_id) { - long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32), InternalUtils.check_arr_len(payment_id, 32)); - GC.KeepAlive(this); - GC.KeepAlive(route); - GC.KeepAlive(payment_hash); - GC.KeepAlive(payment_secret); - GC.KeepAlive(payment_id); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(route); }; - return ret_hu_conv; - } - - /** - * Sends a spontaneous payment over the Lightning Network using the given [`Route`]. - */ - public Result_NonePaymentSendFailureZ send_spontaneous_payment(org.ldk.structs.Route route, byte[] payment_preimage, byte[] payment_id) { - long ret = bindings.Payer_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_id, 32)); - GC.KeepAlive(this); - GC.KeepAlive(route); - GC.KeepAlive(payment_preimage); - GC.KeepAlive(payment_id); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(route); }; - return ret_hu_conv; - } - - /** - * Retries a failed payment path for the [`PaymentId`] using the given [`Route`]. - */ - public Result_NonePaymentSendFailureZ retry_payment(org.ldk.structs.Route route, byte[] payment_id) { - long ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_id, 32)); - GC.KeepAlive(this); - GC.KeepAlive(route); - GC.KeepAlive(payment_id); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.AddLast(route); }; - return ret_hu_conv; - } - - /** - * Signals that no further retries for the given payment will occur. - */ - public void abandon_payment(byte[] payment_id) { - bindings.Payer_abandon_payment(this.ptr, InternalUtils.check_arr_len(payment_id, 32)); - GC.KeepAlive(this); - GC.KeepAlive(payment_id); - } - - /** - * Construct an [`InFlightHtlcs`] containing information about currently used up liquidity - * across payments. - */ - public InFlightHtlcs inflight_htlcs() { - long ret = bindings.Payer_inflight_htlcs(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InFlightHtlcs(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/PaymentError.cs b/c_sharp/src/org/ldk/structs/PaymentError.cs index 8a196a29..1e0597a5 100644 --- a/c_sharp/src/org/ldk/structs/PaymentError.cs +++ b/c_sharp/src/org/ldk/structs/PaymentError.cs @@ -18,8 +18,7 @@ public class PaymentError : CommonBase { long raw_ty = bindings.LDKPaymentError_ty_from_ptr(ptr); switch (raw_ty) { case 0: return new PaymentError_Invoice(ptr); - case 1: return new PaymentError_Routing(ptr); - case 2: return new PaymentError_Sending(ptr); + case 1: return new PaymentError_Sending(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -32,24 +31,11 @@ public class PaymentError : CommonBase { this.invoice = bindings.LDKPaymentError_Invoice_get_invoice(ptr); } } - /** A PaymentError of type Routing */ - public class PaymentError_Routing : PaymentError { - public LightningError routing; - internal PaymentError_Routing(long ptr) : base(null, ptr) { - long routing = bindings.LDKPaymentError_Routing_get_routing(ptr); - org.ldk.structs.LightningError routing_hu_conv = null; if (routing < 0 || routing > 4096) { routing_hu_conv = new org.ldk.structs.LightningError(null, routing); } - if (routing_hu_conv != null) { routing_hu_conv.ptrs_to.AddLast(this); }; - this.routing = routing_hu_conv; - } - } /** A PaymentError of type Sending */ public class PaymentError_Sending : PaymentError { - public PaymentSendFailure sending; + public RetryableSendFailure sending; internal PaymentError_Sending(long ptr) : base(null, ptr) { - long sending = bindings.LDKPaymentError_Sending_get_sending(ptr); - org.ldk.structs.PaymentSendFailure sending_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(sending); - if (sending_hu_conv != null) { sending_hu_conv.ptrs_to.AddLast(this); }; - this.sending = sending_hu_conv; + this.sending = bindings.LDKPaymentError_Sending_get_sending(ptr); } } internal long clone_ptr() { @@ -83,29 +69,31 @@ public class PaymentError : CommonBase { } /** - * Utility method to constructs a new Routing-variant PaymentError + * Utility method to constructs a new Sending-variant PaymentError */ - public static PaymentError routing(org.ldk.structs.LightningError a) { - long ret = bindings.PaymentError_routing(a == null ? 0 : a.ptr); + public static PaymentError sending(RetryableSendFailure a) { + long ret = bindings.PaymentError_sending(a); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentError ret_hu_conv = org.ldk.structs.PaymentError.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; return ret_hu_conv; } /** - * Utility method to constructs a new Sending-variant PaymentError + * Checks if two PaymentErrors contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. */ - public static PaymentError sending(org.ldk.structs.PaymentSendFailure a) { - long ret = bindings.PaymentError_sending(a.ptr); - GC.KeepAlive(a); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.PaymentError ret_hu_conv = org.ldk.structs.PaymentError.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; + public bool eq(org.ldk.structs.PaymentError b) { + bool ret = bindings.PaymentError_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; } + public override bool Equals(object o) { + if (!(o is PaymentError)) return false; + return this.eq((PaymentError)o); + } } } } } diff --git a/c_sharp/src/org/ldk/structs/PaymentParameters.cs b/c_sharp/src/org/ldk/structs/PaymentParameters.cs index 24583021..0cd24e8a 100644 --- a/c_sharp/src/org/ldk/structs/PaymentParameters.cs +++ b/c_sharp/src/org/ldk/structs/PaymentParameters.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * The recipient of a payment. + * Information used to route a payment. */ public class PaymentParameters : CommonBase { internal PaymentParameters(object _dummy, long ptr) : base(ptr) { } @@ -16,86 +16,27 @@ public class PaymentParameters : CommonBase { } /** - * The node id of the payee. + * Information about the payee, such as their features and route hints for their channels. */ - public byte[] get_payee_pubkey() { - byte[] ret = bindings.PaymentParameters_get_payee_pubkey(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The node id of the payee. - */ - public void set_payee_pubkey(byte[] val) { - bindings.PaymentParameters_set_payee_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Features supported by the payee. - * - * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice - * does not contain any features. - * - * [`for_keysend`]: Self::for_keysend - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public InvoiceFeatures get_features() { - long ret = bindings.PaymentParameters_get_features(this.ptr); + public Payee get_payee() { + long ret = bindings.PaymentParameters_get_payee(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } + org.ldk.structs.Payee ret_hu_conv = org.ldk.structs.Payee.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** - * Features supported by the payee. - * - * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice - * does not contain any features. - * - * [`for_keysend`]: Self::for_keysend - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + * Information about the payee, such as their features and route hints for their channels. */ - public void set_features(org.ldk.structs.InvoiceFeatures val) { - bindings.PaymentParameters_set_features(this.ptr, val == null ? 0 : val.ptr); + public void set_payee(org.ldk.structs.Payee val) { + bindings.PaymentParameters_set_payee(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; } - /** - * Hints for routing to the payee, containing channels connecting the payee to public nodes. - */ - public RouteHint[] get_route_hints() { - long[] ret = bindings.PaymentParameters_get_route_hints(this.ptr); - GC.KeepAlive(this); - int ret_conv_11_len = ret.Length; - RouteHint[] ret_conv_11_arr = new RouteHint[ret_conv_11_len]; - for (int l = 0; l < ret_conv_11_len; l++) { - long ret_conv_11 = ret[l]; - org.ldk.structs.RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new org.ldk.structs.RouteHint(null, ret_conv_11); } - if (ret_conv_11_hu_conv != null) { ret_conv_11_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_11_arr[l] = ret_conv_11_hu_conv; - } - return ret_conv_11_arr; - } - - /** - * Hints for routing to the payee, containing channels connecting the payee to public nodes. - */ - public void set_route_hints(RouteHint[] val) { - bindings.PaymentParameters_set_route_hints(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_11 => val_conv_11 == null ? 0 : val_conv_11.ptr) : null); - GC.KeepAlive(this); - GC.KeepAlive(val); - foreach (RouteHint val_conv_11 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_11); }; }; - } - /** * Expiration of a payment to the payee, in seconds relative to the UNIX epoch. */ @@ -115,6 +56,7 @@ public class PaymentParameters : CommonBase { bindings.PaymentParameters_set_expiry_time(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -226,11 +168,9 @@ public class PaymentParameters : CommonBase { /** * Constructs a new PaymentParameters given each field */ - public static PaymentParameters of(byte[] payee_pubkey_arg, org.ldk.structs.InvoiceFeatures features_arg, RouteHint[] route_hints_arg, org.ldk.structs.Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg) { - long ret = bindings.PaymentParameters_new(InternalUtils.check_arr_len(payee_pubkey_arg, 33), features_arg == null ? 0 : features_arg.ptr, route_hints_arg != null ? InternalUtils.mapArray(route_hints_arg, route_hints_arg_conv_11 => route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr) : null, expiry_time_arg.ptr, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg); - GC.KeepAlive(payee_pubkey_arg); - GC.KeepAlive(features_arg); - GC.KeepAlive(route_hints_arg); + public static PaymentParameters of(org.ldk.structs.Payee payee_arg, org.ldk.structs.Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg) { + long ret = bindings.PaymentParameters_new(payee_arg.ptr, expiry_time_arg.ptr, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg); + GC.KeepAlive(payee_arg); GC.KeepAlive(expiry_time_arg); GC.KeepAlive(max_total_cltv_expiry_delta_arg); GC.KeepAlive(max_path_count_arg); @@ -239,8 +179,8 @@ public class PaymentParameters : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features_arg); }; - foreach (RouteHint route_hints_arg_conv_11 in route_hints_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(route_hints_arg_conv_11); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payee_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(expiry_time_arg); }; return ret_hu_conv; } @@ -263,7 +203,7 @@ public class PaymentParameters : CommonBase { } /** - * Checks if two PaymentParameterss contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the PaymentParameters. */ public long hash() { long ret = bindings.PaymentParameters_hash(this.ptr); @@ -303,9 +243,10 @@ public class PaymentParameters : CommonBase { /** * Read a PaymentParameters from a byte array, created by PaymentParameters_write */ - public static Result_PaymentParametersDecodeErrorZ read(byte[] ser) { - long ret = bindings.PaymentParameters_read(ser); + public static Result_PaymentParametersDecodeErrorZ read(byte[] ser, int arg) { + long ret = bindings.PaymentParameters_read(ser, arg); GC.KeepAlive(ser); + GC.KeepAlive(arg); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -313,10 +254,14 @@ public class PaymentParameters : CommonBase { /** * Creates a payee with the node id of the given `pubkey`. + * + * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has + * provided. */ - public static PaymentParameters from_node_id(byte[] payee_pubkey) { - long ret = bindings.PaymentParameters_from_node_id(InternalUtils.check_arr_len(payee_pubkey, 33)); + public static PaymentParameters from_node_id(byte[] payee_pubkey, int final_cltv_expiry_delta) { + long ret = bindings.PaymentParameters_from_node_id(InternalUtils.check_arr_len(payee_pubkey, 33), final_cltv_expiry_delta); GC.KeepAlive(payee_pubkey); + GC.KeepAlive(final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -325,13 +270,40 @@ public class PaymentParameters : CommonBase { /** * Creates a payee with the node id of the given `pubkey` to use for keysend payments. + * + * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has + * provided. + * + * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose + * whether your router will be allowed to find a multi-part route for this payment. If you + * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via + * [`RecipientOnionFields::secret_only`]. + * + * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only */ - public static PaymentParameters for_keysend(byte[] payee_pubkey) { - long ret = bindings.PaymentParameters_for_keysend(InternalUtils.check_arr_len(payee_pubkey, 33)); + public static PaymentParameters for_keysend(byte[] payee_pubkey, int final_cltv_expiry_delta, bool allow_mpp) { + long ret = bindings.PaymentParameters_for_keysend(InternalUtils.check_arr_len(payee_pubkey, 33), final_cltv_expiry_delta, allow_mpp); GC.KeepAlive(payee_pubkey); + GC.KeepAlive(final_cltv_expiry_delta); + GC.KeepAlive(allow_mpp); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Creates parameters for paying to a blinded payee from the provided invoice. Sets + * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and + * [`PaymentParameters::expiry_time`]. + */ + public static PaymentParameters from_bolt12_invoice(org.ldk.structs.Bolt12Invoice invoice) { + long ret = bindings.PaymentParameters_from_bolt12_invoice(invoice == null ? 0 : invoice.ptr); + GC.KeepAlive(invoice); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(invoice); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/PaymentPurpose.cs b/c_sharp/src/org/ldk/structs/PaymentPurpose.cs index bf8752be..535e7526 100644 --- a/c_sharp/src/org/ldk/structs/PaymentPurpose.cs +++ b/c_sharp/src/org/ldk/structs/PaymentPurpose.cs @@ -34,10 +34,8 @@ public class PaymentPurpose : CommonBase { * * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds - * - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public byte[] payment_preimage; + public Option_PaymentPreimageZ payment_preimage; /** * The \"payment secret\". This authenticates the sender to the recipient, preventing a * number of deanonymization attacks during the routing process. @@ -52,7 +50,10 @@ public class PaymentPurpose : CommonBase { */ public byte[] payment_secret; internal PaymentPurpose_InvoicePayment(long ptr) : base(null, ptr) { - this.payment_preimage = bindings.LDKPaymentPurpose_InvoicePayment_get_payment_preimage(ptr); + long payment_preimage = bindings.LDKPaymentPurpose_InvoicePayment_get_payment_preimage(ptr); + org.ldk.structs.Option_PaymentPreimageZ payment_preimage_hu_conv = org.ldk.structs.Option_PaymentPreimageZ.constr_from_ptr(payment_preimage); + if (payment_preimage_hu_conv != null) { payment_preimage_hu_conv.ptrs_to.AddLast(this); }; + this.payment_preimage = payment_preimage_hu_conv; this.payment_secret = bindings.LDKPaymentPurpose_InvoicePayment_get_payment_secret(ptr); } } @@ -84,13 +85,14 @@ public class PaymentPurpose : CommonBase { /** * Utility method to constructs a new InvoicePayment-variant PaymentPurpose */ - public static PaymentPurpose invoice_payment(byte[] payment_preimage, byte[] payment_secret) { - long ret = bindings.PaymentPurpose_invoice_payment(InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_secret, 32)); + public static PaymentPurpose invoice_payment(org.ldk.structs.Option_PaymentPreimageZ payment_preimage, byte[] payment_secret) { + long ret = bindings.PaymentPurpose_invoice_payment(payment_preimage.ptr, InternalUtils.check_arr_len(payment_secret, 32)); GC.KeepAlive(payment_preimage); GC.KeepAlive(payment_secret); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentPurpose ret_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_preimage); }; return ret_hu_conv; } @@ -106,6 +108,21 @@ public class PaymentPurpose : CommonBase { return ret_hu_conv; } + /** + * Checks if two PaymentPurposes contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.PaymentPurpose b) { + bool ret = bindings.PaymentPurpose_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is PaymentPurpose)) return false; + return this.eq((PaymentPurpose)o); + } /** * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read */ diff --git a/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs b/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs index 567d9b65..3d161fae 100644 --- a/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs +++ b/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs @@ -6,9 +6,11 @@ using System; namespace org { namespace ldk { namespace structs { /** - * If a payment fails to send, it can be in one of several states. This enum is returned as the - * Err() type describing which state the payment is in, see the description of individual enum - * states for more. + * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one + * of several states. This enum is returned as the Err() type describing which state the payment + * is in, see the description of individual enum states for more. + * + * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route */ public class PaymentSendFailure : CommonBase { protected PaymentSendFailure(object _dummy, long ptr) : base(ptr) { } @@ -78,13 +80,12 @@ public class PaymentSendFailure : CommonBase { /** A PaymentSendFailure of type PartialFailure */ public class PaymentSendFailure_PartialFailure : PaymentSendFailure { /** - * The errors themselves, in the same order as the route hops. + * The errors themselves, in the same order as the paths from the route. */ public Result_NoneAPIErrorZ[] results; /** * If some paths failed without irrevocably committing to the new HTLC(s), this will - * contain a [`RouteParameters`] object which can be used to calculate a new route that - * will pay all remaining unpaid balance. + * contain a [`RouteParameters`] object for the failing paths. * * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -137,6 +138,7 @@ public class PaymentSendFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; return ret_hu_conv; } @@ -161,6 +163,7 @@ public class PaymentSendFailure : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (APIError a_conv_10 in a) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a_conv_10); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/PeerHandleError.cs b/c_sharp/src/org/ldk/structs/PeerHandleError.cs index ad19b4d9..3085dee7 100644 --- a/c_sharp/src/org/ldk/structs/PeerHandleError.cs +++ b/c_sharp/src/org/ldk/structs/PeerHandleError.cs @@ -17,42 +17,11 @@ public class PeerHandleError : CommonBase { if (ptr != 0) { bindings.PeerHandleError_free(ptr); } } - /** - * Used to indicate that we probably can't make any future connections to this peer (e.g. - * because we required features that our peer was missing, or vice versa). - * - * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close - * any channels with this peer or check for new versions of LDK. - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - */ - public bool get_no_connection_possible() { - bool ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Used to indicate that we probably can't make any future connections to this peer (e.g. - * because we required features that our peer was missing, or vice versa). - * - * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close - * any channels with this peer or check for new versions of LDK. - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - */ - public void set_no_connection_possible(bool val) { - bindings.PeerHandleError_set_no_connection_possible(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * Constructs a new PeerHandleError given each field */ - public static PeerHandleError of(bool no_connection_possible_arg) { - long ret = bindings.PeerHandleError_new(no_connection_possible_arg); - GC.KeepAlive(no_connection_possible_arg); + public static PeerHandleError of() { + long ret = bindings.PeerHandleError_new(); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerHandleError(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; diff --git a/c_sharp/src/org/ldk/structs/PeerManager.cs b/c_sharp/src/org/ldk/structs/PeerManager.cs index 65648af7..4760b660 100644 --- a/c_sharp/src/org/ldk/structs/PeerManager.cs +++ b/c_sharp/src/org/ldk/structs/PeerManager.cs @@ -19,10 +19,10 @@ namespace org { namespace ldk { namespace structs { * [`PeerManager`] functions related to the same connection must occur only in serial, making new * calls only after previous ones have returned. * - * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager - * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but - * essentially you should default to using a SimpleRefPeerManager, and use a - * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when + * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`] + * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but + * essentially you should default to using a [`SimpleRefPeerManager`], and use a + * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when * you're using lightning-net-tokio. * * [`read_event`]: PeerManager::read_event @@ -34,8 +34,9 @@ public class PeerManager : CommonBase { } /** - * Constructs a new PeerManager with the given message handlers and node_id secret key - * ephemeral_random_data is used to derive per-connection ephemeral keys and must be + * Constructs a new `PeerManager` with the given message handlers. + * + * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be * cryptographically secure random bytes. * * `current_time` is used as an always-increasing counter that survives across restarts and is @@ -43,42 +44,56 @@ public class PeerManager : CommonBase { * timestamp, however if it is not available a persistent counter that increases once per * minute should suffice. */ - public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, OnionMessageHandler message_handler_onion_message_handler_arg, byte[] our_node_secret, int current_time, byte[] ephemeral_random_data, org.ldk.structs.Logger logger, org.ldk.structs.CustomMessageHandler custom_message_handler) { - long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr, message_handler_onion_message_handler_arg == null ? 0 : message_handler_onion_message_handler_arg.ptr), InternalUtils.check_arr_len(our_node_secret, 32), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr); + public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, OnionMessageHandler message_handler_onion_message_handler_arg, CustomMessageHandler message_handler_custom_message_handler_arg, int current_time, byte[] ephemeral_random_data, org.ldk.structs.Logger logger, org.ldk.structs.NodeSigner node_signer) { + long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg.ptr, message_handler_onion_message_handler_arg.ptr, message_handler_custom_message_handler_arg.ptr), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger.ptr, node_signer.ptr); GC.KeepAlive(message_handler_chan_handler_arg); GC.KeepAlive(message_handler_route_handler_arg); GC.KeepAlive(message_handler_onion_message_handler_arg); - GC.KeepAlive(our_node_secret); + GC.KeepAlive(message_handler_custom_message_handler_arg); GC.KeepAlive(current_time); GC.KeepAlive(ephemeral_random_data); GC.KeepAlive(logger); - GC.KeepAlive(custom_message_handler); + GC.KeepAlive(node_signer); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PeerManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerManager(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_handler_chan_handler_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_handler_route_handler_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_handler_onion_message_handler_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_handler_custom_message_handler_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(custom_message_handler); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; return ret_hu_conv; } /** - * Get the list of node ids for peers which have completed the initial handshake. + * Get a list of tuples mapping from node id to network addresses for peers which have + * completed the initial handshake. + * + * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter + * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial + * handshake has completed and we are sure the remote peer has the private key for the given + * [`PublicKey`]. * - * For outbound connections, this will be the same as the their_node_id parameter passed in to - * new_outbound_connection, however entries will only appear once the initial handshake has - * completed and we are sure the remote peer has the private key for the given node_id. + * The returned `Option`s will only be `Some` if an address had been previously given via + * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`]. */ - public byte[][] get_peer_node_ids() { - byte[][] ret = bindings.PeerManager_get_peer_node_ids(this.ptr); + public TwoTuple_PublicKeyCOption_NetAddressZZ[] get_peer_node_ids() { + long[] ret = bindings.PeerManager_get_peer_node_ids(this.ptr); GC.KeepAlive(this); - return ret; + int ret_conv_40_len = ret.Length; + TwoTuple_PublicKeyCOption_NetAddressZZ[] ret_conv_40_arr = new TwoTuple_PublicKeyCOption_NetAddressZZ[ret_conv_40_len]; + for (int o = 0; o < ret_conv_40_len; o++) { + long ret_conv_40 = ret[o]; + TwoTuple_PublicKeyCOption_NetAddressZZ ret_conv_40_hu_conv = new TwoTuple_PublicKeyCOption_NetAddressZZ(null, ret_conv_40); + if (ret_conv_40_hu_conv != null) { ret_conv_40_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_40_arr[o] = ret_conv_40_hu_conv; + } + return ret_conv_40_arr; } /** - * Indicates a new outbound connection has been established to a node with the given node_id + * Indicates a new outbound connection has been established to a node with the given `node_id` * and an optional remote network address. * * The remote network address adds the option to report a remote IP address back to a connecting @@ -90,12 +105,12 @@ public class PeerManager : CommonBase { * Returns a small number of bytes to send to the remote node (currently always 50). * * Panics if descriptor is duplicative with some other descriptor which has not yet been - * [`socket_disconnected()`]. + * [`socket_disconnected`]. * - * [`socket_disconnected()`]: PeerManager::socket_disconnected + * [`socket_disconnected`]: PeerManager::socket_disconnected */ public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) { - long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr); + long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor.ptr, remote_network_address.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(descriptor); @@ -103,6 +118,7 @@ public class PeerManager : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(descriptor); }; + if (this != null) { this.ptrs_to.AddLast(remote_network_address); }; return ret_hu_conv; } @@ -119,18 +135,19 @@ public class PeerManager : CommonBase { * the connection immediately. * * Panics if descriptor is duplicative with some other descriptor which has not yet been - * [`socket_disconnected()`]. + * [`socket_disconnected`]. * - * [`socket_disconnected()`]: PeerManager::socket_disconnected + * [`socket_disconnected`]: PeerManager::socket_disconnected */ public Result_NonePeerHandleErrorZ new_inbound_connection(org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) { - long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr); + long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor.ptr, remote_network_address.ptr); GC.KeepAlive(this); GC.KeepAlive(descriptor); GC.KeepAlive(remote_network_address); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(descriptor); }; + if (this != null) { this.ptrs_to.AddLast(remote_network_address); }; return ret_hu_conv; } @@ -142,14 +159,14 @@ public class PeerManager : CommonBase { * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before * returning. Thus, be very careful with reentrancy issues! The invariants around calling * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be - * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't + * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't * sufficient! * * [`send_data`]: SocketDescriptor::send_data * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail */ public Result_NonePeerHandleErrorZ write_buffer_space_avail(org.ldk.structs.SocketDescriptor descriptor) { - long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr); + long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor.ptr); GC.KeepAlive(this); GC.KeepAlive(descriptor); if (ret >= 0 && ret <= 4096) { return null; } @@ -170,11 +187,14 @@ public class PeerManager : CommonBase { * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the * send buffer). * + * In order to avoid processing too many messages at once per peer, `data` should be on the + * order of 4KiB. + * * [`send_data`]: SocketDescriptor::send_data * [`process_events`]: PeerManager::process_events */ public Result_boolPeerHandleErrorZ read_event(org.ldk.structs.SocketDescriptor peer_descriptor, byte[] data) { - long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data); + long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor.ptr, data); GC.KeepAlive(this); GC.KeepAlive(peer_descriptor); GC.KeepAlive(data); @@ -211,7 +231,7 @@ public class PeerManager : CommonBase { * Indicates that the given socket descriptor's connection is now closed. */ public void socket_disconnected(org.ldk.structs.SocketDescriptor descriptor) { - bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : descriptor.ptr); + bindings.PeerManager_socket_disconnected(this.ptr, descriptor.ptr); GC.KeepAlive(this); GC.KeepAlive(descriptor); } @@ -219,19 +239,15 @@ public class PeerManager : CommonBase { /** * Disconnect a peer given its node id. * - * Set `no_connection_possible` to true to prevent any further connection with this peer, - * force-closing any channels we have with it. - * * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the * peer. Thus, be very careful about reentrancy issues. * * [`disconnect_socket`]: SocketDescriptor::disconnect_socket */ - public void disconnect_by_node_id(byte[] node_id, bool no_connection_possible) { - bindings.PeerManager_disconnect_by_node_id(this.ptr, InternalUtils.check_arr_len(node_id, 33), no_connection_possible); + public void disconnect_by_node_id(byte[] node_id) { + bindings.PeerManager_disconnect_by_node_id(this.ptr, InternalUtils.check_arr_len(node_id, 33)); GC.KeepAlive(this); GC.KeepAlive(node_id); - GC.KeepAlive(no_connection_possible); } /** @@ -285,6 +301,7 @@ public class PeerManager : CommonBase { GC.KeepAlive(rgb); GC.KeepAlive(alias); GC.KeepAlive(addresses); + foreach (NetAddress addresses_conv_12 in addresses) { if (this != null) { this.ptrs_to.AddLast(addresses_conv_12); }; }; } } diff --git a/c_sharp/src/org/ldk/structs/Persist.cs b/c_sharp/src/org/ldk/structs/Persist.cs index e1a9d54d..9a44bba3 100644 --- a/c_sharp/src/org/ldk/structs/Persist.cs +++ b/c_sharp/src/org/ldk/structs/Persist.cs @@ -115,6 +115,7 @@ public class Persist : CommonBase { org.ldk.structs.OutPoint _channel_id_hu_conv = null; if (_channel_id < 0 || _channel_id > 4096) { _channel_id_hu_conv = new org.ldk.structs.OutPoint(null, _channel_id); } if (_channel_id_hu_conv != null) { _channel_id_hu_conv.ptrs_to.AddLast(this); }; org.ldk.structs.ChannelMonitorUpdate _update_hu_conv = null; if (_update < 0 || _update > 4096) { _update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, _update); } + if (_update_hu_conv != null) { _update_hu_conv.ptrs_to.AddLast(this); }; org.ldk.structs.ChannelMonitor _data_hu_conv = null; if (_data < 0 || _data > 4096) { _data_hu_conv = new org.ldk.structs.ChannelMonitor(null, _data); } org.ldk.structs.MonitorUpdateId _update_id_hu_conv = null; if (_update_id < 0 || _update_id > 4096) { _update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, _update_id); } if (_update_id_hu_conv != null) { _update_id_hu_conv.ptrs_to.AddLast(this); }; diff --git a/c_sharp/src/org/ldk/structs/Persister.cs b/c_sharp/src/org/ldk/structs/Persister.cs index 1550d8e9..0f9bbe37 100644 --- a/c_sharp/src/org/ldk/structs/Persister.cs +++ b/c_sharp/src/org/ldk/structs/Persister.cs @@ -96,7 +96,7 @@ public class Persister : CommonBase { * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed. */ public Result_NoneErrorZ persist_scorer(org.ldk.structs.WriteableScore scorer) { - long ret = bindings.Persister_persist_scorer(this.ptr, scorer == null ? 0 : scorer.ptr); + long ret = bindings.Persister_persist_scorer(this.ptr, scorer.ptr); GC.KeepAlive(this); GC.KeepAlive(scorer); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs b/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs index 246b5de4..6b4183d7 100644 --- a/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs +++ b/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs @@ -30,14 +30,40 @@ public class PhantomKeysManager : CommonBase { } /** - * Constructs a new KeysInterface which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is + * Constructs a new EntropySource which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is */ - public KeysInterface as_KeysInterface() { - long ret = bindings.PhantomKeysManager_as_KeysInterface(this.ptr); + public EntropySource as_EntropySource() { + long ret = bindings.PhantomKeysManager_as_EntropySource(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - KeysInterface ret_hu_conv = new KeysInterface(null, ret); + EntropySource ret_hu_conv = new EntropySource(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new NodeSigner which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is + */ + public NodeSigner as_NodeSigner() { + long ret = bindings.PhantomKeysManager_as_NodeSigner(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + NodeSigner ret_hu_conv = new NodeSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new SignerProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is + */ + public SignerProvider as_SignerProvider() { + long ret = bindings.PhantomKeysManager_as_SignerProvider(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + SignerProvider ret_hu_conv = new SignerProvider(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -70,15 +96,18 @@ public class PhantomKeysManager : CommonBase { /** * See [`KeysManager::spend_spendable_outputs`] for documentation on this method. */ - public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight) { - long ret = bindings.PhantomKeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr) : null, outputs != null ? InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr) : null, change_destination_script, feerate_sat_per_1000_weight); + public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_PackedLockTimeZ locktime) { + long ret = bindings.PhantomKeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr) : null, outputs != null ? InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr) : null, change_destination_script, feerate_sat_per_1000_weight, locktime.ptr); GC.KeepAlive(this); GC.KeepAlive(descriptors); GC.KeepAlive(outputs); GC.KeepAlive(change_destination_script); GC.KeepAlive(feerate_sat_per_1000_weight); + GC.KeepAlive(locktime); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (this != null) { this.ptrs_to.AddLast(descriptors_conv_27); }; }; + if (this != null) { this.ptrs_to.AddLast(locktime); }; return ret_hu_conv; } @@ -96,5 +125,24 @@ public class PhantomKeysManager : CommonBase { return ret_hu_conv; } + /** + * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc. + */ + public byte[] get_node_secret_key() { + byte[] ret = bindings.PhantomKeysManager_get_node_secret_key(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the + * last-hop onion data, etc. + */ + public byte[] get_phantom_node_secret_key() { + byte[] ret = bindings.PhantomKeysManager_get_phantom_node_secret_key(this.ptr); + GC.KeepAlive(this); + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs b/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs index 785acaea..b20941e2 100644 --- a/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs +++ b/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs @@ -9,7 +9,7 @@ namespace org { namespace ldk { namespace structs { /** * Route hints used in constructing invoices for [phantom node payents]. * - * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + * [phantom node payments]: crate::sign::PhantomKeysManager */ public class PhantomRouteHints : CommonBase { internal PhantomRouteHints(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/Ping.cs b/c_sharp/src/org/ldk/structs/Ping.cs index fb20d617..9ca8849c 100644 --- a/c_sharp/src/org/ldk/structs/Ping.cs +++ b/c_sharp/src/org/ldk/structs/Ping.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A ping message to be sent or received from a peer + * A [`ping`] message to be sent to or received from a peer. + * + * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages */ public class Ping : CommonBase { internal Ping(object _dummy, long ptr) : base(ptr) { } @@ -16,7 +18,7 @@ public class Ping : CommonBase { } /** - * The desired response length + * The desired response length. */ public short get_ponglen() { short ret = bindings.Ping_get_ponglen(this.ptr); @@ -25,7 +27,7 @@ public class Ping : CommonBase { } /** - * The desired response length + * The desired response length. */ public void set_ponglen(short val) { bindings.Ping_set_ponglen(this.ptr, val); @@ -35,6 +37,7 @@ public class Ping : CommonBase { /** * The ping packet size. + * * This field is not sent on the wire. byteslen zeros are sent. */ public short get_byteslen() { @@ -45,6 +48,7 @@ public class Ping : CommonBase { /** * The ping packet size. + * * This field is not sent on the wire. byteslen zeros are sent. */ public void set_byteslen(short val) { diff --git a/c_sharp/src/org/ldk/structs/Pong.cs b/c_sharp/src/org/ldk/structs/Pong.cs index 2962c545..2163b350 100644 --- a/c_sharp/src/org/ldk/structs/Pong.cs +++ b/c_sharp/src/org/ldk/structs/Pong.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A pong message to be sent or received from a peer + * A [`pong`] message to be sent to or received from a peer. + * + * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages */ public class Pong : CommonBase { internal Pong(object _dummy, long ptr) : base(ptr) { } @@ -17,6 +19,7 @@ public class Pong : CommonBase { /** * The pong packet size. + * * This field is not sent on the wire. byteslen zeros are sent. */ public short get_byteslen() { @@ -27,6 +30,7 @@ public class Pong : CommonBase { /** * The pong packet size. + * * This field is not sent on the wire. byteslen zeros are sent. */ public void set_byteslen(short val) { diff --git a/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs b/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs index b885dbd4..ad36693d 100644 --- a/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs +++ b/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs @@ -56,7 +56,7 @@ public class PositiveTimestamp : CommonBase { } /** - * Checks if two PositiveTimestamps contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp. */ public long hash() { long ret = bindings.PositiveTimestamp_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/PrivateRoute.cs b/c_sharp/src/org/ldk/structs/PrivateRoute.cs index 538a8441..96e69604 100644 --- a/c_sharp/src/org/ldk/structs/PrivateRoute.cs +++ b/c_sharp/src/org/ldk/structs/PrivateRoute.cs @@ -37,7 +37,7 @@ public class PrivateRoute : CommonBase { } /** - * Checks if two PrivateRoutes contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the PrivateRoute. */ public long hash() { long ret = bindings.PrivateRoute_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs index 841e7569..c14395ee 100644 --- a/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs +++ b/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs @@ -38,11 +38,11 @@ namespace org { namespace ldk { namespace structs { * behavior. * * [1]: https://arxiv.org/abs/2107.05322 - * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_multiplier_msat - * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_amount_multiplier_msat - * [`liquidity_offset_half_life`]: ProbabilisticScoringParameters::liquidity_offset_half_life - * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_multiplier_msat - * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_amount_multiplier_msat + * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat + * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat + * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life + * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat + * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat */ public class ProbabilisticScorer : CommonBase { internal ProbabilisticScorer(object _dummy, long ptr) : base(ptr) { } @@ -54,15 +54,15 @@ public class ProbabilisticScorer : CommonBase { * Creates a new scorer using the given scoring parameters for sending payments from a node * through a network graph. */ - public static ProbabilisticScorer of(org.ldk.structs.ProbabilisticScoringParameters _params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) { - long ret = bindings.ProbabilisticScorer_new(_params == null ? 0 : _params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr); - GC.KeepAlive(_params); + public static ProbabilisticScorer of(org.ldk.structs.ProbabilisticScoringDecayParameters decay_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) { + long ret = bindings.ProbabilisticScorer_new(decay_params == null ? 0 : decay_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr); + GC.KeepAlive(decay_params); GC.KeepAlive(network_graph); GC.KeepAlive(logger); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ProbabilisticScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScorer(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(_params); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(decay_params); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; return ret_hu_conv; @@ -96,53 +96,38 @@ public class ProbabilisticScorer : CommonBase { } /** - * Marks the node with the given `node_id` as banned, i.e., - * it will be avoided during path finding. - */ - public void add_banned(org.ldk.structs.NodeId node_id) { - bindings.ProbabilisticScorer_add_banned(this.ptr, node_id == null ? 0 : node_id.ptr); - GC.KeepAlive(this); - GC.KeepAlive(node_id); - if (this != null) { this.ptrs_to.AddLast(node_id); }; - } - - /** - * Removes the node with the given `node_id` from the list of nodes to avoid. - */ - public void remove_banned(org.ldk.structs.NodeId node_id) { - bindings.ProbabilisticScorer_remove_banned(this.ptr, node_id == null ? 0 : node_id.ptr); - GC.KeepAlive(this); - GC.KeepAlive(node_id); - if (this != null) { this.ptrs_to.AddLast(node_id); }; - } - - /** - * Sets a manual penalty for the given node. - */ - public void set_manual_penalty(org.ldk.structs.NodeId node_id, long penalty) { - bindings.ProbabilisticScorer_set_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr, penalty); - GC.KeepAlive(this); - GC.KeepAlive(node_id); - GC.KeepAlive(penalty); - if (this != null) { this.ptrs_to.AddLast(node_id); }; - } - - /** - * Removes the node with the given `node_id` from the list of manual penalties. - */ - public void remove_manual_penalty(org.ldk.structs.NodeId node_id) { - bindings.ProbabilisticScorer_remove_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr); - GC.KeepAlive(this); - GC.KeepAlive(node_id); - if (this != null) { this.ptrs_to.AddLast(node_id); }; - } - - /** - * Clears the list of manual penalties that are applied during path finding. + * Query the historical estimated minimum and maximum liquidity available for sending a + * payment over the channel with `scid` towards the given `target` node. + * + * Returns two sets of 8 buckets. The first set describes the octiles for lower-bound + * liquidity estimates, the second set describes the octiles for upper-bound liquidity + * estimates. Each bucket describes the relative frequency at which we've seen a liquidity + * bound in the octile relative to the channel's total capacity, on an arbitrary scale. + * Because the values are slowly decayed, more recent data points are weighted more heavily + * than older datapoints. + * + * When scoring, the estimated probability that an upper-/lower-bound lies in a given octile + * relative to the channel's total capacity is calculated by dividing that bucket's value with + * the total of all buckets for the given bound. + * + * For example, a value of `[0, 0, 0, 0, 0, 0, 32]` indicates that we believe the probability + * of a bound being in the top octile to be 100%, and have never (recently) seen it in any + * other octiles. A value of `[31, 0, 0, 0, 0, 0, 0, 32]` indicates we've seen the bound being + * both in the top and bottom octile, and roughly with similar (recent) frequency. + * + * Because the datapoints are decayed slowly over time, values will eventually return to + * `Some(([0; 8], [0; 8]))`. */ - public void clear_manual_penalties() { - bindings.ProbabilisticScorer_clear_manual_penalties(this.ptr); + public Option_C2Tuple_EightU16sEightU16sZZ historical_estimated_channel_liquidity_probabilities(long scid, org.ldk.structs.NodeId target) { + long ret = bindings.ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(this.ptr, scid, target == null ? 0 : target.ptr); GC.KeepAlive(this); + GC.KeepAlive(scid); + GC.KeepAlive(target); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_EightU16sEightU16sZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(target); }; + return ret_hu_conv; } /** @@ -170,8 +155,8 @@ public class ProbabilisticScorer : CommonBase { /** * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write */ - public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, org.ldk.structs.ProbabilisticScoringParameters arg_a, org.ldk.structs.NetworkGraph arg_b, org.ldk.structs.Logger arg_c) { - long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c == null ? 0 : arg_c.ptr); + public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, org.ldk.structs.ProbabilisticScoringDecayParameters arg_a, org.ldk.structs.NetworkGraph arg_b, org.ldk.structs.Logger arg_c) { + long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c.ptr); GC.KeepAlive(ser); GC.KeepAlive(arg_a); GC.KeepAlive(arg_b); diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScoringDecayParameters.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScoringDecayParameters.cs new file mode 100644 index 00000000..79d2a6ce --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ProbabilisticScoringDecayParameters.cs @@ -0,0 +1,157 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Parameters for configuring [`ProbabilisticScorer`]. + * + * Used to configure decay parameters that are static throughout the lifetime of the scorer. + * these decay parameters affect the score of the channel penalty and are not changed on a + * per-route penalty cost call. + */ +public class ProbabilisticScoringDecayParameters : CommonBase { + internal ProbabilisticScoringDecayParameters(object _dummy, long ptr) : base(ptr) { } + ~ProbabilisticScoringDecayParameters() { + if (ptr != 0) { bindings.ProbabilisticScoringDecayParameters_free(ptr); } + } + + /** + * If we aren't learning any new datapoints for a channel, the historical liquidity bounds + * tracking can simply live on with increasingly stale data. Instead, when a channel has not + * seen a liquidity estimate update for this amount of time, the historical datapoints are + * decayed by half. + * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`] + * + * Note that after 16 or more half lives all historical data will be completely gone. + * + * Default value: 14 days + * + * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities + */ + public long get_historical_no_updates_half_life() { + long ret = bindings.ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * If we aren't learning any new datapoints for a channel, the historical liquidity bounds + * tracking can simply live on with increasingly stale data. Instead, when a channel has not + * seen a liquidity estimate update for this amount of time, the historical datapoints are + * decayed by half. + * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`] + * + * Note that after 16 or more half lives all historical data will be completely gone. + * + * Default value: 14 days + * + * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities + */ + public void set_historical_no_updates_half_life(long val) { + bindings.ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Whenever this amount of time elapses since the last update to a channel's liquidity bounds, + * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on + * the available liquidity is halved and the upper-bound moves half-way to the channel's total + * capacity. + * + * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity, + * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`] + * struct documentation for more info on the way the liquidity bounds are used. + * + * For example, if the channel's capacity is 1 million sats, and the current upper and lower + * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper + * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats. + * + * Default value: 6 hours + * + * # Note + * + * When built with the `no-std` feature, time will never elapse. Therefore, the channel + * liquidity knowledge will never decay except when the bounds cross. + */ + public long get_liquidity_offset_half_life() { + long ret = bindings.ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Whenever this amount of time elapses since the last update to a channel's liquidity bounds, + * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on + * the available liquidity is halved and the upper-bound moves half-way to the channel's total + * capacity. + * + * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity, + * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`] + * struct documentation for more info on the way the liquidity bounds are used. + * + * For example, if the channel's capacity is 1 million sats, and the current upper and lower + * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper + * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats. + * + * Default value: 6 hours + * + * # Note + * + * When built with the `no-std` feature, time will never elapse. Therefore, the channel + * liquidity knowledge will never decay except when the bounds cross. + */ + public void set_liquidity_offset_half_life(long val) { + bindings.ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new ProbabilisticScoringDecayParameters given each field + */ + public static ProbabilisticScoringDecayParameters of(long historical_no_updates_half_life_arg, long liquidity_offset_half_life_arg) { + long ret = bindings.ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_arg); + GC.KeepAlive(historical_no_updates_half_life_arg); + GC.KeepAlive(liquidity_offset_half_life_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ProbabilisticScoringDecayParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringDecayParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.ProbabilisticScoringDecayParameters_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ProbabilisticScoringDecayParameters + */ + public ProbabilisticScoringDecayParameters clone() { + long ret = bindings.ProbabilisticScoringDecayParameters_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ProbabilisticScoringDecayParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringDecayParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used. + */ + public static ProbabilisticScoringDecayParameters with_default() { + long ret = bindings.ProbabilisticScoringDecayParameters_default(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ProbabilisticScoringDecayParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringDecayParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs new file mode 100644 index 00000000..b3528ffa --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs @@ -0,0 +1,453 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Parameters for configuring [`ProbabilisticScorer`]. + * + * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel + * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel). + * + * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the + * parameters here. + */ +public class ProbabilisticScoringFeeParameters : CommonBase { + internal ProbabilisticScoringFeeParameters(object _dummy, long ptr) : base(ptr) { } + ~ProbabilisticScoringFeeParameters() { + if (ptr != 0) { bindings.ProbabilisticScoringFeeParameters_free(ptr); } + } + + /** + * A fixed penalty in msats to apply to each channel. + * + * Default value: 500 msat + */ + public long get_base_penalty_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_base_penalty_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A fixed penalty in msats to apply to each channel. + * + * Default value: 500 msat + */ + public void set_base_penalty_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_base_penalty_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A multiplier used with the payment amount to calculate a fixed penalty applied to each + * channel, in excess of the [`base_penalty_msat`]. + * + * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., + * fees plus penalty) for large payments. The penalty is computed as the product of this + * multiplier and `2^30`ths of the payment amount. + * + * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30` + * + * Default value: 8,192 msat + * + * [`base_penalty_msat`]: Self::base_penalty_msat + */ + public long get_base_penalty_amount_multiplier_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A multiplier used with the payment amount to calculate a fixed penalty applied to each + * channel, in excess of the [`base_penalty_msat`]. + * + * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., + * fees plus penalty) for large payments. The penalty is computed as the product of this + * multiplier and `2^30`ths of the payment amount. + * + * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30` + * + * Default value: 8,192 msat + * + * [`base_penalty_msat`]: Self::base_penalty_msat + */ + public void set_base_penalty_amount_multiplier_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A multiplier used in conjunction with the negative `log10` of the channel's success + * probability for a payment, as determined by our latest estimates of the channel's + * liquidity, to determine the liquidity penalty. + * + * The penalty is based in part on the knowledge learned from prior successful and unsuccessful + * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The + * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to + * lower bounding the success probability to `0.01`) when the amount falls within the + * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will + * result in a `u64::max_value` penalty, however. + * + * `-log10(success_probability) * liquidity_penalty_multiplier_msat` + * + * Default value: 30,000 msat + * + * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life + */ + public long get_liquidity_penalty_multiplier_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A multiplier used in conjunction with the negative `log10` of the channel's success + * probability for a payment, as determined by our latest estimates of the channel's + * liquidity, to determine the liquidity penalty. + * + * The penalty is based in part on the knowledge learned from prior successful and unsuccessful + * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The + * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to + * lower bounding the success probability to `0.01`) when the amount falls within the + * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will + * result in a `u64::max_value` penalty, however. + * + * `-log10(success_probability) * liquidity_penalty_multiplier_msat` + * + * Default value: 30,000 msat + * + * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life + */ + public void set_liquidity_penalty_multiplier_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A multiplier used in conjunction with a payment amount and the negative `log10` of the + * channel's success probability for the payment, as determined by our latest estimates of the + * channel's liquidity, to determine the amount penalty. + * + * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., + * fees plus penalty) for large payments. The penalty is computed as the product of this + * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the + * success probability. + * + * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20` + * + * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of + * the amount will result in a penalty of the multiplier. And, as the success probability + * decreases, the negative `log10` weighting will increase dramatically. For higher success + * probabilities, the multiplier will have a decreasing effect as the negative `log10` will + * fall below `1`. + * + * Default value: 192 msat + */ + public long get_liquidity_penalty_amount_multiplier_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A multiplier used in conjunction with a payment amount and the negative `log10` of the + * channel's success probability for the payment, as determined by our latest estimates of the + * channel's liquidity, to determine the amount penalty. + * + * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., + * fees plus penalty) for large payments. The penalty is computed as the product of this + * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the + * success probability. + * + * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20` + * + * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of + * the amount will result in a penalty of the multiplier. And, as the success probability + * decreases, the negative `log10` weighting will increase dramatically. For higher success + * probabilities, the multiplier will have a decreasing effect as the negative `log10` will + * fall below `1`. + * + * Default value: 192 msat + */ + public void set_liquidity_penalty_amount_multiplier_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A multiplier used in conjunction with the negative `log10` of the channel's success + * probability for the payment, as determined based on the history of our estimates of the + * channel's available liquidity, to determine a penalty. + * + * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using + * only our latest estimate for the current liquidity available in the channel, it estimates + * success probability based on the estimated liquidity available in the channel through + * history. Specifically, every time we update our liquidity bounds on a given channel, we + * track which of several buckets those bounds fall into, exponentially decaying the + * probability of each bucket as new samples are added. + * + * Default value: 10,000 msat + * + * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat + */ + public long get_historical_liquidity_penalty_multiplier_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A multiplier used in conjunction with the negative `log10` of the channel's success + * probability for the payment, as determined based on the history of our estimates of the + * channel's available liquidity, to determine a penalty. + * + * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using + * only our latest estimate for the current liquidity available in the channel, it estimates + * success probability based on the estimated liquidity available in the channel through + * history. Specifically, every time we update our liquidity bounds on a given channel, we + * track which of several buckets those bounds fall into, exponentially decaying the + * probability of each bucket as new samples are added. + * + * Default value: 10,000 msat + * + * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat + */ + public void set_historical_liquidity_penalty_multiplier_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A multiplier used in conjunction with the payment amount and the negative `log10` of the + * channel's success probability for the payment, as determined based on the history of our + * estimates of the channel's available liquidity, to determine a penalty. + * + * The purpose of the amount penalty is to avoid having fees dominate the channel cost for + * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths + * of the payment amount, weighted by the negative `log10` of the success probability. + * + * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead + * of using only our latest estimate for the current liquidity available in the channel, it + * estimates success probability based on the estimated liquidity available in the channel + * through history. Specifically, every time we update our liquidity bounds on a given + * channel, we track which of several buckets those bounds fall into, exponentially decaying + * the probability of each bucket as new samples are added. + * + * Default value: 64 msat + * + * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat + */ + public long get_historical_liquidity_penalty_amount_multiplier_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A multiplier used in conjunction with the payment amount and the negative `log10` of the + * channel's success probability for the payment, as determined based on the history of our + * estimates of the channel's available liquidity, to determine a penalty. + * + * The purpose of the amount penalty is to avoid having fees dominate the channel cost for + * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths + * of the payment amount, weighted by the negative `log10` of the success probability. + * + * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead + * of using only our latest estimate for the current liquidity available in the channel, it + * estimates success probability based on the estimated liquidity available in the channel + * through history. Specifically, every time we update our liquidity bounds on a given + * channel, we track which of several buckets those bounds fall into, exponentially decaying + * the probability of each bucket as new samples are added. + * + * Default value: 64 msat + * + * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat + */ + public void set_historical_liquidity_penalty_amount_multiplier_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the + * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us + * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially + * as this makes balance discovery attacks harder to execute, thereby creating an incentive + * to restrict `htlc_maximum_msat` and improve privacy. + * + * Default value: 250 msat + */ + public long get_anti_probing_penalty_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the + * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us + * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially + * as this makes balance discovery attacks harder to execute, thereby creating an incentive + * to restrict `htlc_maximum_msat` and improve privacy. + * + * Default value: 250 msat + */ + public void set_anti_probing_penalty_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * This penalty is applied when the amount we're attempting to send over a channel exceeds our + * current estimate of the channel's available liquidity. + * + * Note that in this case all other penalties, including the + * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based + * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if + * applicable, are still included in the overall penalty. + * + * If you wish to avoid creating paths with such channels entirely, setting this to a value of + * `u64::max_value()` will guarantee that. + * + * Default value: 1_0000_0000_000 msat (1 Bitcoin) + * + * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat + * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat + * [`base_penalty_msat`]: Self::base_penalty_msat + * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat + */ + public long get_considered_impossible_penalty_msat() { + long ret = bindings.ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * This penalty is applied when the amount we're attempting to send over a channel exceeds our + * current estimate of the channel's available liquidity. + * + * Note that in this case all other penalties, including the + * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based + * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if + * applicable, are still included in the overall penalty. + * + * If you wish to avoid creating paths with such channels entirely, setting this to a value of + * `u64::max_value()` will guarantee that. + * + * Default value: 1_0000_0000_000 msat (1 Bitcoin) + * + * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat + * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat + * [`base_penalty_msat`]: Self::base_penalty_msat + * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat + */ + public void set_considered_impossible_penalty_msat(long val) { + bindings.ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + internal long clone_ptr() { + long ret = bindings.ProbabilisticScoringFeeParameters_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ProbabilisticScoringFeeParameters + */ + public ProbabilisticScoringFeeParameters clone() { + long ret = bindings.ProbabilisticScoringFeeParameters_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ProbabilisticScoringFeeParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringFeeParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used. + */ + public static ProbabilisticScoringFeeParameters with_default() { + long ret = bindings.ProbabilisticScoringFeeParameters_default(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ProbabilisticScoringFeeParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringFeeParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Marks the node with the given `node_id` as banned, + * i.e it will be avoided during path finding. + */ + public void add_banned(org.ldk.structs.NodeId node_id) { + bindings.ProbabilisticScoringFeeParameters_add_banned(this.ptr, node_id == null ? 0 : node_id.ptr); + GC.KeepAlive(this); + GC.KeepAlive(node_id); + if (this != null) { this.ptrs_to.AddLast(node_id); }; + } + + /** + * Marks all nodes in the given list as banned, i.e., + * they will be avoided during path finding. + */ + public void add_banned_from_list(NodeId[] node_ids) { + bindings.ProbabilisticScoringFeeParameters_add_banned_from_list(this.ptr, node_ids != null ? InternalUtils.mapArray(node_ids, node_ids_conv_8 => node_ids_conv_8 == null ? 0 : node_ids_conv_8.ptr) : null); + GC.KeepAlive(this); + GC.KeepAlive(node_ids); + foreach (NodeId node_ids_conv_8 in node_ids) { if (this != null) { this.ptrs_to.AddLast(node_ids_conv_8); }; }; + } + + /** + * Removes the node with the given `node_id` from the list of nodes to avoid. + */ + public void remove_banned(org.ldk.structs.NodeId node_id) { + bindings.ProbabilisticScoringFeeParameters_remove_banned(this.ptr, node_id == null ? 0 : node_id.ptr); + GC.KeepAlive(this); + GC.KeepAlive(node_id); + if (this != null) { this.ptrs_to.AddLast(node_id); }; + } + + /** + * Sets a manual penalty for the given node. + */ + public void set_manual_penalty(org.ldk.structs.NodeId node_id, long penalty) { + bindings.ProbabilisticScoringFeeParameters_set_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr, penalty); + GC.KeepAlive(this); + GC.KeepAlive(node_id); + GC.KeepAlive(penalty); + if (this != null) { this.ptrs_to.AddLast(node_id); }; + } + + /** + * Removes the node with the given `node_id` from the list of manual penalties. + */ + public void remove_manual_penalty(org.ldk.structs.NodeId node_id) { + bindings.ProbabilisticScoringFeeParameters_remove_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr); + GC.KeepAlive(this); + GC.KeepAlive(node_id); + if (this != null) { this.ptrs_to.AddLast(node_id); }; + } + + /** + * Clears the list of manual penalties that are applied during path finding. + */ + public void clear_manual_penalties() { + bindings.ProbabilisticScoringFeeParameters_clear_manual_penalties(this.ptr); + GC.KeepAlive(this); + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScoringParameters.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScoringParameters.cs deleted file mode 100644 index cd8bebf1..00000000 --- a/c_sharp/src/org/ldk/structs/ProbabilisticScoringParameters.cs +++ /dev/null @@ -1,487 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Parameters for configuring [`ProbabilisticScorer`]. - * - * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel - * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel). - * - * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the - * parameters here. - */ -public class ProbabilisticScoringParameters : CommonBase { - internal ProbabilisticScoringParameters(object _dummy, long ptr) : base(ptr) { } - ~ProbabilisticScoringParameters() { - if (ptr != 0) { bindings.ProbabilisticScoringParameters_free(ptr); } - } - - /** - * A fixed penalty in msats to apply to each channel. - * - * Default value: 500 msat - */ - public long get_base_penalty_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_base_penalty_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * A fixed penalty in msats to apply to each channel. - * - * Default value: 500 msat - */ - public void set_base_penalty_msat(long val) { - bindings.ProbabilisticScoringParameters_set_base_penalty_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A multiplier used with the payment amount to calculate a fixed penalty applied to each - * channel, in excess of the [`base_penalty_msat`]. - * - * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., - * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^30`ths of the payment amount. - * - * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30` - * - * Default value: 8,192 msat - * - * [`base_penalty_msat`]: Self::base_penalty_msat - */ - public long get_base_penalty_amount_multiplier_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * A multiplier used with the payment amount to calculate a fixed penalty applied to each - * channel, in excess of the [`base_penalty_msat`]. - * - * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., - * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^30`ths of the payment amount. - * - * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30` - * - * Default value: 8,192 msat - * - * [`base_penalty_msat`]: Self::base_penalty_msat - */ - public void set_base_penalty_amount_multiplier_msat(long val) { - bindings.ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A multiplier used in conjunction with the negative `log10` of the channel's success - * probability for a payment, as determined by our latest estimates of the channel's - * liquidity, to determine the liquidity penalty. - * - * The penalty is based in part on the knowledge learned from prior successful and unsuccessful - * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The - * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to - * lower bounding the success probability to `0.01`) when the amount falls within the - * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will - * result in a `u64::max_value` penalty, however. - * - * `-log10(success_probability) * liquidity_penalty_multiplier_msat` - * - * Default value: 30,000 msat - * - * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life - */ - public long get_liquidity_penalty_multiplier_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * A multiplier used in conjunction with the negative `log10` of the channel's success - * probability for a payment, as determined by our latest estimates of the channel's - * liquidity, to determine the liquidity penalty. - * - * The penalty is based in part on the knowledge learned from prior successful and unsuccessful - * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The - * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to - * lower bounding the success probability to `0.01`) when the amount falls within the - * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will - * result in a `u64::max_value` penalty, however. - * - * `-log10(success_probability) * liquidity_penalty_multiplier_msat` - * - * Default value: 30,000 msat - * - * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life - */ - public void set_liquidity_penalty_multiplier_msat(long val) { - bindings.ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Whenever this amount of time elapses since the last update to a channel's liquidity bounds, - * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on - * the available liquidity is halved and the upper-bound moves half-way to the channel's total - * capacity. - * - * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity, - * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`] - * struct documentation for more info on the way the liquidity bounds are used. - * - * For example, if the channel's capacity is 1 million sats, and the current upper and lower - * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper - * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats. - * - * Default value: 6 hours - * - * # Note - * - * When built with the `no-std` feature, time will never elapse. Therefore, the channel - * liquidity knowledge will never decay except when the bounds cross. - */ - public long get_liquidity_offset_half_life() { - long ret = bindings.ProbabilisticScoringParameters_get_liquidity_offset_half_life(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Whenever this amount of time elapses since the last update to a channel's liquidity bounds, - * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on - * the available liquidity is halved and the upper-bound moves half-way to the channel's total - * capacity. - * - * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity, - * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`] - * struct documentation for more info on the way the liquidity bounds are used. - * - * For example, if the channel's capacity is 1 million sats, and the current upper and lower - * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper - * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats. - * - * Default value: 6 hours - * - * # Note - * - * When built with the `no-std` feature, time will never elapse. Therefore, the channel - * liquidity knowledge will never decay except when the bounds cross. - */ - public void set_liquidity_offset_half_life(long val) { - bindings.ProbabilisticScoringParameters_set_liquidity_offset_half_life(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A multiplier used in conjunction with a payment amount and the negative `log10` of the - * channel's success probability for the payment, as determined by our latest estimates of the - * channel's liquidity, to determine the amount penalty. - * - * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., - * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the - * success probability. - * - * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20` - * - * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of - * the amount will result in a penalty of the multiplier. And, as the success probability - * decreases, the negative `log10` weighting will increase dramatically. For higher success - * probabilities, the multiplier will have a decreasing effect as the negative `log10` will - * fall below `1`. - * - * Default value: 192 msat - */ - public long get_liquidity_penalty_amount_multiplier_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * A multiplier used in conjunction with a payment amount and the negative `log10` of the - * channel's success probability for the payment, as determined by our latest estimates of the - * channel's liquidity, to determine the amount penalty. - * - * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., - * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the - * success probability. - * - * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20` - * - * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of - * the amount will result in a penalty of the multiplier. And, as the success probability - * decreases, the negative `log10` weighting will increase dramatically. For higher success - * probabilities, the multiplier will have a decreasing effect as the negative `log10` will - * fall below `1`. - * - * Default value: 192 msat - */ - public void set_liquidity_penalty_amount_multiplier_msat(long val) { - bindings.ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A multiplier used in conjunction with the negative `log10` of the channel's success - * probability for the payment, as determined based on the history of our estimates of the - * channel's available liquidity, to determine a penalty. - * - * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using - * only our latest estimate for the current liquidity available in the channel, it estimates - * success probability based on the estimated liquidity available in the channel through - * history. Specifically, every time we update our liquidity bounds on a given channel, we - * track which of several buckets those bounds fall into, exponentially decaying the - * probability of each bucket as new samples are added. - * - * Default value: 10,000 msat - * - * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat - */ - public long get_historical_liquidity_penalty_multiplier_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * A multiplier used in conjunction with the negative `log10` of the channel's success - * probability for the payment, as determined based on the history of our estimates of the - * channel's available liquidity, to determine a penalty. - * - * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using - * only our latest estimate for the current liquidity available in the channel, it estimates - * success probability based on the estimated liquidity available in the channel through - * history. Specifically, every time we update our liquidity bounds on a given channel, we - * track which of several buckets those bounds fall into, exponentially decaying the - * probability of each bucket as new samples are added. - * - * Default value: 10,000 msat - * - * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat - */ - public void set_historical_liquidity_penalty_multiplier_msat(long val) { - bindings.ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A multiplier used in conjunction with the payment amount and the negative `log10` of the - * channel's success probability for the payment, as determined based on the history of our - * estimates of the channel's available liquidity, to determine a penalty. - * - * The purpose of the amount penalty is to avoid having fees dominate the channel cost for - * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths - * of the payment amount, weighted by the negative `log10` of the success probability. - * - * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead - * of using only our latest estimate for the current liquidity available in the channel, it - * estimates success probability based on the estimated liquidity available in the channel - * through history. Specifically, every time we update our liquidity bounds on a given - * channel, we track which of several buckets those bounds fall into, exponentially decaying - * the probability of each bucket as new samples are added. - * - * Default value: 64 msat - * - * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat - */ - public long get_historical_liquidity_penalty_amount_multiplier_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * A multiplier used in conjunction with the payment amount and the negative `log10` of the - * channel's success probability for the payment, as determined based on the history of our - * estimates of the channel's available liquidity, to determine a penalty. - * - * The purpose of the amount penalty is to avoid having fees dominate the channel cost for - * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths - * of the payment amount, weighted by the negative `log10` of the success probability. - * - * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead - * of using only our latest estimate for the current liquidity available in the channel, it - * estimates success probability based on the estimated liquidity available in the channel - * through history. Specifically, every time we update our liquidity bounds on a given - * channel, we track which of several buckets those bounds fall into, exponentially decaying - * the probability of each bucket as new samples are added. - * - * Default value: 64 msat - * - * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat - */ - public void set_historical_liquidity_penalty_amount_multiplier_msat(long val) { - bindings.ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * If we aren't learning any new datapoints for a channel, the historical liquidity bounds - * tracking can simply live on with increasingly stale data. Instead, when a channel has not - * seen a liquidity estimate update for this amount of time, the historical datapoints are - * decayed by half. - * - * Note that after 16 or more half lives all historical data will be completely gone. - * - * Default value: 14 days - */ - public long get_historical_no_updates_half_life() { - long ret = bindings.ProbabilisticScoringParameters_get_historical_no_updates_half_life(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * If we aren't learning any new datapoints for a channel, the historical liquidity bounds - * tracking can simply live on with increasingly stale data. Instead, when a channel has not - * seen a liquidity estimate update for this amount of time, the historical datapoints are - * decayed by half. - * - * Note that after 16 or more half lives all historical data will be completely gone. - * - * Default value: 14 days - */ - public void set_historical_no_updates_half_life(long val) { - bindings.ProbabilisticScoringParameters_set_historical_no_updates_half_life(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the - * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We - * treat such nodes preferentially as this makes balance discovery attacks harder to execute, - * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy. - * - * Default value: 250 msat - */ - public long get_anti_probing_penalty_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_anti_probing_penalty_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the - * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We - * treat such nodes preferentially as this makes balance discovery attacks harder to execute, - * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy. - * - * Default value: 250 msat - */ - public void set_anti_probing_penalty_msat(long val) { - bindings.ProbabilisticScoringParameters_set_anti_probing_penalty_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * This penalty is applied when the amount we're attempting to send over a channel exceeds our - * current estimate of the channel's available liquidity. - * - * Note that in this case all other penalties, including the - * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based - * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if - * applicable, are still included in the overall penalty. - * - * If you wish to avoid creating paths with such channels entirely, setting this to a value of - * `u64::max_value()` will guarantee that. - * - * Default value: 1_0000_0000_000 msat (1 Bitcoin) - * - * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat - * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat - * [`base_penalty_msat`]: Self::base_penalty_msat - * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat - */ - public long get_considered_impossible_penalty_msat() { - long ret = bindings.ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * This penalty is applied when the amount we're attempting to send over a channel exceeds our - * current estimate of the channel's available liquidity. - * - * Note that in this case all other penalties, including the - * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based - * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if - * applicable, are still included in the overall penalty. - * - * If you wish to avoid creating paths with such channels entirely, setting this to a value of - * `u64::max_value()` will guarantee that. - * - * Default value: 1_0000_0000_000 msat (1 Bitcoin) - * - * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat - * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat - * [`base_penalty_msat`]: Self::base_penalty_msat - * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat - */ - public void set_considered_impossible_penalty_msat(long val) { - bindings.ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - internal long clone_ptr() { - long ret = bindings.ProbabilisticScoringParameters_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the ProbabilisticScoringParameters - */ - public ProbabilisticScoringParameters clone() { - long ret = bindings.ProbabilisticScoringParameters_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringParameters(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Marks all nodes in the given list as banned, i.e., - * they will be avoided during path finding. - */ - public void add_banned_from_list(NodeId[] node_ids) { - bindings.ProbabilisticScoringParameters_add_banned_from_list(this.ptr, node_ids != null ? InternalUtils.mapArray(node_ids, node_ids_conv_8 => node_ids_conv_8 == null ? 0 : node_ids_conv_8.ptr) : null); - GC.KeepAlive(this); - GC.KeepAlive(node_ids); - foreach (NodeId node_ids_conv_8 in node_ids) { if (this != null) { this.ptrs_to.AddLast(node_ids_conv_8); }; }; - } - - /** - * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used. - */ - public static ProbabilisticScoringParameters with_default() { - long ret = bindings.ProbabilisticScoringParameters_default(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringParameters(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Quantity.cs b/c_sharp/src/org/ldk/structs/Quantity.cs new file mode 100644 index 00000000..4cda4d9b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Quantity.cs @@ -0,0 +1,37 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Quantity of items supported by an [`Offer`]. + */ +public class Quantity : CommonBase { + internal Quantity(object _dummy, long ptr) : base(ptr) { } + ~Quantity() { + if (ptr != 0) { bindings.Quantity_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Quantity_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Quantity + */ + public Quantity clone() { + long ret = bindings.Quantity_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/QueryChannelRange.cs b/c_sharp/src/org/ldk/structs/QueryChannelRange.cs index 83917ee1..998b7bf3 100644 --- a/c_sharp/src/org/ldk/structs/QueryChannelRange.cs +++ b/c_sharp/src/org/ldk/structs/QueryChannelRange.cs @@ -7,10 +7,12 @@ namespace org { namespace ldk { namespace structs { /** - * A query_channel_range message is used to query a peer for channel + * A [`query_channel_range`] message is used to query a peer for channel * UTXOs in a range of blocks. The recipient of a query makes a best - * effort to reply to the query using one or more reply_channel_range + * effort to reply to the query using one or more [`ReplyChannelRange`] * messages. + * + * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages */ public class QueryChannelRange : CommonBase { internal QueryChannelRange(object _dummy, long ptr) : base(ptr) { } @@ -122,7 +124,9 @@ public class QueryChannelRange : CommonBase { return this.eq((QueryChannelRange)o); } /** - * \n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t + * Calculates the overflow safe ending block height for the query. + * + * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`. */ public int end_blocknum() { int ret = bindings.QueryChannelRange_end_blocknum(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs b/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs index 25ea1879..f374fd26 100644 --- a/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs +++ b/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs @@ -7,14 +7,17 @@ namespace org { namespace ldk { namespace structs { /** - * A query_short_channel_ids message is used to query a peer for - * routing gossip messages related to one or more short_channel_ids. + * A [`query_short_channel_ids`] message is used to query a peer for + * routing gossip messages related to one or more `short_channel_id`s. + * * The query recipient will reply with the latest, if available, - * channel_announcement, channel_update and node_announcement messages - * it maintains for the requested short_channel_ids followed by a - * reply_short_channel_ids_end message. The short_channel_ids sent in - * this query are encoded. We only support encoding_type=0 uncompressed - * serialization and do not support encoding_type=1 zlib serialization. + * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages + * it maintains for the requested `short_channel_id`s followed by a + * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in + * this query are encoded. We only support `encoding_type=0` uncompressed + * serialization and do not support `encoding_type=1` zlib serialization. + * + * [`query_short_channel_ids`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages */ public class QueryShortChannelIds : CommonBase { internal QueryShortChannelIds(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs index 19aed373..6a727b5a 100644 --- a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs +++ b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs @@ -22,21 +22,38 @@ public class RapidGossipSync : CommonBase { /** * Instantiate a new [`RapidGossipSync`] instance. */ - public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph) { - long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr); + public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) { + long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr); GC.KeepAlive(network_graph); + GC.KeepAlive(logger); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RapidGossipSync ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RapidGossipSync(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; return ret_hu_conv; } /** - * Update network graph from binary data. + * Sync gossip data from a file. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * - * `network_graph`: network graph to be updated + * `network_graph`: The network graph to apply the updates to + * + * `sync_path`: Path to the file where the gossip update data is located + */ + public Result_u32GraphSyncErrorZ sync_network_graph_with_file_path(string sync_path) { + long ret = bindings.RapidGossipSync_sync_network_graph_with_file_path(this.ptr, sync_path); + GC.KeepAlive(this); + GC.KeepAlive(sync_path); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Update network graph from binary data. + * Returns the last sync timestamp to be used the next time rapid sync data is queried. * * `update_data`: `&[u8]` binary stream that comprises the update data */ @@ -49,6 +66,24 @@ public class RapidGossipSync : CommonBase { return ret_hu_conv; } + /** + * Update network graph from binary data. + * Returns the last sync timestamp to be used the next time rapid sync data is queried. + * + * `update_data`: `&[u8]` binary stream that comprises the update data + * `current_time_unix`: `Option` optional current timestamp to verify data age + */ + public Result_u32GraphSyncErrorZ update_network_graph_no_std(byte[] update_data, org.ldk.structs.Option_u64Z current_time_unix) { + long ret = bindings.RapidGossipSync_update_network_graph_no_std(this.ptr, update_data, current_time_unix.ptr); + GC.KeepAlive(this); + GC.KeepAlive(update_data); + GC.KeepAlive(current_time_unix); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(current_time_unix); }; + return ret_hu_conv; + } + /** * Returns whether a rapid gossip sync has completed at least once. */ diff --git a/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs b/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs new file mode 100644 index 00000000..a4f7c66c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs @@ -0,0 +1,232 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network, + * but without the signature information. + * Decoding and encoding should not lead to information loss but may lead to different hashes. + * + * For methods without docs see the corresponding methods in [`Bolt11Invoice`]. + */ +public class RawBolt11Invoice : CommonBase { + internal RawBolt11Invoice(object _dummy, long ptr) : base(ptr) { } + ~RawBolt11Invoice() { + if (ptr != 0) { bindings.RawBolt11Invoice_free(ptr); } + } + + /** + * data part + */ + public RawDataPart get_data() { + long ret = bindings.RawBolt11Invoice_get_data(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawDataPart(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * data part + */ + public void set_data(org.ldk.structs.RawDataPart val) { + bindings.RawBolt11Invoice_set_data(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Checks if two RawBolt11Invoices contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.RawBolt11Invoice b) { + bool ret = bindings.RawBolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is RawBolt11Invoice)) return false; + return this.eq((RawBolt11Invoice)o); + } + internal long clone_ptr() { + long ret = bindings.RawBolt11Invoice_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the RawBolt11Invoice + */ + public RawBolt11Invoice clone() { + long ret = bindings.RawBolt11Invoice_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawBolt11Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice. + */ + public long hash() { + long ret = bindings.RawBolt11Invoice_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed. + */ + public byte[] signable_hash() { + byte[] ret = bindings.RawBolt11Invoice_signable_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Sha256 payment_hash() { + long ret = bindings.RawBolt11Invoice_payment_hash(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Description description() { + long ret = bindings.RawBolt11Invoice_description(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Description(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public PayeePubKey payee_pub_key() { + long ret = bindings.RawBolt11Invoice_payee_pub_key(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Sha256 description_hash() { + long ret = bindings.RawBolt11Invoice_description_hash(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ExpiryTime expiry_time() { + long ret = bindings.RawBolt11Invoice_expiry_time(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public MinFinalCltvExpiryDelta min_final_cltv_expiry_delta() { + long ret = bindings.RawBolt11Invoice_min_final_cltv_expiry_delta(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MinFinalCltvExpiryDelta ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiryDelta(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public Option_PaymentSecretZ payment_secret() { + long ret = bindings.RawBolt11Invoice_payment_secret(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentSecretZ ret_hu_conv = org.ldk.structs.Option_PaymentSecretZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public Option_CVec_u8ZZ payment_metadata() { + long ret = bindings.RawBolt11Invoice_payment_metadata(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Bolt11InvoiceFeatures features() { + long ret = bindings.RawBolt11Invoice_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public PrivateRoute[] private_routes() { + long[] ret = bindings.RawBolt11Invoice_private_routes(this.ptr); + GC.KeepAlive(this); + int ret_conv_14_len = ret.Length; + PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret_conv_14_len]; + for (int o = 0; o < ret_conv_14_len; o++) { + long ret_conv_14 = ret[o]; + org.ldk.structs.PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.PrivateRoute(null, ret_conv_14); } + if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_14_arr[o] = ret_conv_14_hu_conv; + } + return ret_conv_14_arr; + } + + public Option_u64Z amount_pico_btc() { + long ret = bindings.RawBolt11Invoice_amount_pico_btc(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + public Currency currency() { + Currency ret = bindings.RawBolt11Invoice_currency(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/RawDataPart.cs b/c_sharp/src/org/ldk/structs/RawDataPart.cs index ce0130b9..681dde88 100644 --- a/c_sharp/src/org/ldk/structs/RawDataPart.cs +++ b/c_sharp/src/org/ldk/structs/RawDataPart.cs @@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs { /** - * Data of the `RawInvoice` that is encoded in the data part + * Data of the [`RawBolt11Invoice`] that is encoded in the data part */ public class RawDataPart : CommonBase { internal RawDataPart(object _dummy, long ptr) : base(ptr) { } @@ -73,7 +73,7 @@ public class RawDataPart : CommonBase { } /** - * Checks if two RawDataParts contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the RawDataPart. */ public long hash() { long ret = bindings.RawDataPart_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/RawInvoice.cs b/c_sharp/src/org/ldk/structs/RawInvoice.cs deleted file mode 100644 index 84fa7be5..00000000 --- a/c_sharp/src/org/ldk/structs/RawInvoice.cs +++ /dev/null @@ -1,223 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Represents an syntactically correct Invoice for a payment on the lightning network, - * but without the signature information. - * De- and encoding should not lead to information loss but may lead to different hashes. - * - * For methods without docs see the corresponding methods in `Invoice`. - */ -public class RawInvoice : CommonBase { - internal RawInvoice(object _dummy, long ptr) : base(ptr) { } - ~RawInvoice() { - if (ptr != 0) { bindings.RawInvoice_free(ptr); } - } - - /** - * data part - */ - public RawDataPart get_data() { - long ret = bindings.RawInvoice_get_data(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawDataPart(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * data part - */ - public void set_data(org.ldk.structs.RawDataPart val) { - bindings.RawInvoice_set_data(this.ptr, val == null ? 0 : val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - - /** - * Checks if two RawInvoices contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public bool eq(org.ldk.structs.RawInvoice b) { - bool ret = bindings.RawInvoice_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - if (this != null) { this.ptrs_to.AddLast(b); }; - return ret; - } - - public override bool Equals(object o) { - if (!(o is RawInvoice)) return false; - return this.eq((RawInvoice)o); - } - internal long clone_ptr() { - long ret = bindings.RawInvoice_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the RawInvoice - */ - public RawInvoice clone() { - long ret = bindings.RawInvoice_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawInvoice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Checks if two RawInvoices contain equal inner contents. - */ - public long hash() { - long ret = bindings.RawInvoice_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public override int GetHashCode() { - return (int)this.hash(); - } - /** - * Calculate the hash of the encoded `RawInvoice` which should be signed. - */ - public byte[] signable_hash() { - byte[] ret = bindings.RawInvoice_signable_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public Sha256 payment_hash() { - long ret = bindings.RawInvoice_payment_hash(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public Description description() { - long ret = bindings.RawInvoice_description(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Description(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public PayeePubKey payee_pub_key() { - long ret = bindings.RawInvoice_payee_pub_key(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public Sha256 description_hash() { - long ret = bindings.RawInvoice_description_hash(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public ExpiryTime expiry_time() { - long ret = bindings.RawInvoice_expiry_time(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public MinFinalCltvExpiry min_final_cltv_expiry() { - long ret = bindings.RawInvoice_min_final_cltv_expiry(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiry(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public byte[] payment_secret() { - byte[] ret = bindings.RawInvoice_payment_secret(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public InvoiceFeatures features() { - long ret = bindings.RawInvoice_features(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - public PrivateRoute[] private_routes() { - long[] ret = bindings.RawInvoice_private_routes(this.ptr); - GC.KeepAlive(this); - int ret_conv_14_len = ret.Length; - PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret_conv_14_len]; - for (int o = 0; o < ret_conv_14_len; o++) { - long ret_conv_14 = ret[o]; - org.ldk.structs.PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.PrivateRoute(null, ret_conv_14); } - if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_14_arr[o] = ret_conv_14_hu_conv; - } - return ret_conv_14_arr; - } - - public Option_u64Z amount_pico_btc() { - long ret = bindings.RawInvoice_amount_pico_btc(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - public Currency currency() { - Currency ret = bindings.RawInvoice_currency(this.ptr); - GC.KeepAlive(this); - return ret; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/RecentPaymentDetails.cs b/c_sharp/src/org/ldk/structs/RecentPaymentDetails.cs new file mode 100644 index 00000000..b52df119 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/RecentPaymentDetails.cs @@ -0,0 +1,127 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments. + * These include payments that have yet to find a successful path, or have unresolved HTLCs. + */ +public class RecentPaymentDetails : CommonBase { + protected RecentPaymentDetails(object _dummy, long ptr) : base(ptr) { } + ~RecentPaymentDetails() { + if (ptr != 0) { bindings.RecentPaymentDetails_free(ptr); } + } + + internal static RecentPaymentDetails constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKRecentPaymentDetails_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new RecentPaymentDetails_Pending(ptr); + case 1: return new RecentPaymentDetails_Fulfilled(ptr); + case 2: return new RecentPaymentDetails_Abandoned(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A RecentPaymentDetails of type Pending */ + public class RecentPaymentDetails_Pending : RecentPaymentDetails { + /** + * Hash of the payment that is currently being sent but has yet to be fulfilled or + * abandoned. + */ + public byte[] payment_hash; + /** + * Total amount (in msat, excluding fees) across all paths for this payment, + * not just the amount currently inflight. + */ + public long total_msat; + internal RecentPaymentDetails_Pending(long ptr) : base(null, ptr) { + this.payment_hash = bindings.LDKRecentPaymentDetails_Pending_get_payment_hash(ptr); + this.total_msat = bindings.LDKRecentPaymentDetails_Pending_get_total_msat(ptr); + } + } + /** A RecentPaymentDetails of type Fulfilled */ + public class RecentPaymentDetails_Fulfilled : RecentPaymentDetails { + /** + * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`] + * made before LDK version 0.0.104. + */ + public Option_PaymentHashZ payment_hash; + internal RecentPaymentDetails_Fulfilled(long ptr) : base(null, ptr) { + long payment_hash = bindings.LDKRecentPaymentDetails_Fulfilled_get_payment_hash(ptr); + org.ldk.structs.Option_PaymentHashZ payment_hash_hu_conv = org.ldk.structs.Option_PaymentHashZ.constr_from_ptr(payment_hash); + if (payment_hash_hu_conv != null) { payment_hash_hu_conv.ptrs_to.AddLast(this); }; + this.payment_hash = payment_hash_hu_conv; + } + } + /** A RecentPaymentDetails of type Abandoned */ + public class RecentPaymentDetails_Abandoned : RecentPaymentDetails { + /** + * Hash of the payment that we have given up trying to send. + */ + public byte[] payment_hash; + internal RecentPaymentDetails_Abandoned(long ptr) : base(null, ptr) { + this.payment_hash = bindings.LDKRecentPaymentDetails_Abandoned_get_payment_hash(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.RecentPaymentDetails_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the RecentPaymentDetails + */ + public RecentPaymentDetails clone() { + long ret = bindings.RecentPaymentDetails_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecentPaymentDetails ret_hu_conv = org.ldk.structs.RecentPaymentDetails.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Pending-variant RecentPaymentDetails + */ + public static RecentPaymentDetails pending(byte[] payment_hash, long total_msat) { + long ret = bindings.RecentPaymentDetails_pending(InternalUtils.check_arr_len(payment_hash, 32), total_msat); + GC.KeepAlive(payment_hash); + GC.KeepAlive(total_msat); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecentPaymentDetails ret_hu_conv = org.ldk.structs.RecentPaymentDetails.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails + */ + public static RecentPaymentDetails fulfilled(org.ldk.structs.Option_PaymentHashZ payment_hash) { + long ret = bindings.RecentPaymentDetails_fulfilled(payment_hash.ptr); + GC.KeepAlive(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecentPaymentDetails ret_hu_conv = org.ldk.structs.RecentPaymentDetails.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_hash); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Abandoned-variant RecentPaymentDetails + */ + public static RecentPaymentDetails abandoned(byte[] payment_hash) { + long ret = bindings.RecentPaymentDetails_abandoned(InternalUtils.check_arr_len(payment_hash, 32)); + GC.KeepAlive(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecentPaymentDetails ret_hu_conv = org.ldk.structs.RecentPaymentDetails.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs b/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs new file mode 100644 index 00000000..62b5ca60 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs @@ -0,0 +1,212 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Information which is provided, encrypted, to the payment recipient when sending HTLCs. + * + * This should generally be constructed with data communicated to us from the recipient (via a + * BOLT11 or BOLT12 invoice). + */ +public class RecipientOnionFields : CommonBase { + internal RecipientOnionFields(object _dummy, long ptr) : base(ptr) { } + ~RecipientOnionFields() { + if (ptr != 0) { bindings.RecipientOnionFields_free(ptr); } + } + + /** + * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat + * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to + * authenticate the sender to the recipient and prevent payment-probing (deanonymization) + * attacks. + * + * If you do not have one, the [`Route`] you pay over must not contain multiple paths as + * multi-path payments require a recipient-provided secret. + * + * Some implementations may reject spontaneous payments with payment secrets, so you may only + * want to provide a secret for a spontaneous payment if MPP is needed and you know your + * recipient will not reject it. + */ + public Option_PaymentSecretZ get_payment_secret() { + long ret = bindings.RecipientOnionFields_get_payment_secret(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentSecretZ ret_hu_conv = org.ldk.structs.Option_PaymentSecretZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat + * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to + * authenticate the sender to the recipient and prevent payment-probing (deanonymization) + * attacks. + * + * If you do not have one, the [`Route`] you pay over must not contain multiple paths as + * multi-path payments require a recipient-provided secret. + * + * Some implementations may reject spontaneous payments with payment secrets, so you may only + * want to provide a secret for a spontaneous payment if MPP is needed and you know your + * recipient will not reject it. + */ + public void set_payment_secret(org.ldk.structs.Option_PaymentSecretZ val) { + bindings.RecipientOnionFields_set_payment_secret(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of + * arbitrary length. This gives recipients substantially more flexibility to receive + * additional data. + * + * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication + * scheme to authenticate received payments against expected payments and invoices, this field + * is not used in LDK for received payments, and can be used to store arbitrary data in + * invoices which will be received with the payment. + * + * Note that this field was added to the lightning specification more recently than + * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata + * may not be supported as universally. + * + * Returns a copy of the field. + */ + public Option_CVec_u8ZZ get_payment_metadata() { + long ret = bindings.RecipientOnionFields_get_payment_metadata(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of + * arbitrary length. This gives recipients substantially more flexibility to receive + * additional data. + * + * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication + * scheme to authenticate received payments against expected payments and invoices, this field + * is not used in LDK for received payments, and can be used to store arbitrary data in + * invoices which will be received with the payment. + * + * Note that this field was added to the lightning specification more recently than + * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata + * may not be supported as universally. + */ + public void set_payment_metadata(org.ldk.structs.Option_CVec_u8ZZ val) { + bindings.RecipientOnionFields_set_payment_metadata(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new RecipientOnionFields given each field + */ + public static RecipientOnionFields of(org.ldk.structs.Option_PaymentSecretZ payment_secret_arg, org.ldk.structs.Option_CVec_u8ZZ payment_metadata_arg) { + long ret = bindings.RecipientOnionFields_new(payment_secret_arg.ptr, payment_metadata_arg.ptr); + GC.KeepAlive(payment_secret_arg); + GC.KeepAlive(payment_metadata_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecipientOnionFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RecipientOnionFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_secret_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_metadata_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.RecipientOnionFields_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the RecipientOnionFields + */ + public RecipientOnionFields clone() { + long ret = bindings.RecipientOnionFields_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecipientOnionFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RecipientOnionFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two RecipientOnionFieldss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.RecipientOnionFields b) { + bool ret = bindings.RecipientOnionFields_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is RecipientOnionFields)) return false; + return this.eq((RecipientOnionFields)o); + } + /** + * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read + */ + public byte[] write() { + byte[] ret = bindings.RecipientOnionFields_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write + */ + public static Result_RecipientOnionFieldsDecodeErrorZ read(byte[] ser) { + long ret = bindings.RecipientOnionFields_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common + * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`] + * but do not require or provide any further data. + */ + public static RecipientOnionFields secret_only(byte[] payment_secret) { + long ret = bindings.RecipientOnionFields_secret_only(InternalUtils.check_arr_len(payment_secret, 32)); + GC.KeepAlive(payment_secret); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecipientOnionFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RecipientOnionFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create + * payable HTLCs except for single-path spontaneous payments, i.e. this should generally + * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending + * a spontaneous MPP this will not work as all MPP require payment secrets; you may + * instead want to use [`RecipientOnionFields::secret_only`]. + * + * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment + * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only + */ + public static RecipientOnionFields spontaneous_empty() { + long ret = bindings.RecipientOnionFields_spontaneous_empty(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RecipientOnionFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RecipientOnionFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Refund.cs b/c_sharp/src/org/ldk/structs/Refund.cs new file mode 100644 index 00000000..8ae3f582 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Refund.cs @@ -0,0 +1,215 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`]. + * + * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to + * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a + * bitcoin ATM. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Offer`]: crate::offers::offer::Offer + */ +public class Refund : CommonBase { + internal Refund(object _dummy, long ptr) : base(ptr) { } + ~Refund() { + if (ptr != 0) { bindings.Refund_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.Refund_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Refund + */ + public Refund clone() { + long ret = bindings.Refund_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Refund ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Refund(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A complete description of the purpose of the refund. Intended to be displayed to the user + * but with the caveat that it has not been verified in any way. + */ + public PrintableString description() { + long ret = bindings.Refund_description(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Duration since the Unix epoch when an invoice should no longer be sent. + * + * If `None`, the refund does not expire. + */ + public Option_DurationZ absolute_expiry() { + long ret = bindings.Refund_absolute_expiry(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Whether the refund has expired. + */ + public bool is_expired() { + bool ret = bindings.Refund_is_expired(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be + * displayed to the user but with the caveat that it has not been verified in any way. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public PrintableString issuer() { + long ret = bindings.Refund_issuer(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender + * privacy by obfuscating its node id. + */ + public BlindedPath[] paths() { + long[] ret = bindings.Refund_paths(this.ptr); + GC.KeepAlive(this); + int ret_conv_13_len = ret.Length; + BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len]; + for (int n = 0; n < ret_conv_13_len; n++) { + long ret_conv_13 = ret[n]; + org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); } + if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_13_arr[n] = ret_conv_13_hu_conv; + } + return ret_conv_13_arr; + } + + /** + * An unpredictable series of bytes, typically containing information about the derivation of + * [`payer_id`]. + * + * [`payer_id`]: Self::payer_id + */ + public byte[] metadata() { + byte[] ret = bindings.Refund_metadata(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A chain that the refund is valid for. + */ + public byte[] chain() { + byte[] ret = bindings.Refund_chain(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]). + * + * [`chain`]: Self::chain + */ + public long amount_msats() { + long ret = bindings.Refund_amount_msats(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Features pertaining to requesting an invoice. + */ + public InvoiceRequestFeatures features() { + long ret = bindings.Refund_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The quantity of an item that refund is for. + */ + public Option_u64Z quantity() { + long ret = bindings.Refund_quantity(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly + * transient pubkey. + * + * [`paths`]: Self::paths + */ + public byte[] payer_id() { + byte[] ret = bindings.Refund_payer_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Payer provided note to include in the invoice. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public PrintableString payer_note() { + long ret = bindings.Refund_payer_note(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Serialize the Refund object into a byte array which can be read by Refund_read + */ + public byte[] write() { + byte[] ret = bindings.Refund_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a Refund object from a string + */ + public static Result_RefundBolt12ParseErrorZ from_str(string s) { + long ret = bindings.Refund_from_str(s); + GC.KeepAlive(s); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs b/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs index e4f97698..dc2b9073 100644 --- a/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs +++ b/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs @@ -7,13 +7,17 @@ namespace org { namespace ldk { namespace structs { /** - * A reply_channel_range message is a reply to a query_channel_range - * message. Multiple reply_channel_range messages can be sent in reply - * to a single query_channel_range message. The query recipient makes a + * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`] + * message. + * + * Multiple `reply_channel_range` messages can be sent in reply + * to a single [`QueryChannelRange`] message. The query recipient makes a * best effort to respond based on their local network view which may - * not be a perfect view of the network. The short_channel_ids in the - * reply are encoded. We only support encoding_type=0 uncompressed - * serialization and do not support encoding_type=1 zlib serialization. + * not be a perfect view of the network. The `short_channel_id`s in the + * reply are encoded. We only support `encoding_type=0` uncompressed + * serialization and do not support `encoding_type=1` zlib serialization. + * + * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages */ public class ReplyChannelRange : CommonBase { internal ReplyChannelRange(object _dummy, long ptr) : base(ptr) { } @@ -94,7 +98,7 @@ public class ReplyChannelRange : CommonBase { } /** - * The short_channel_ids in the channel range + * The `short_channel_id`s in the channel range * * Returns a copy of the field. */ @@ -105,7 +109,7 @@ public class ReplyChannelRange : CommonBase { } /** - * The short_channel_ids in the channel range + * The `short_channel_id`s in the channel range */ public void set_short_channel_ids(long[] val) { bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val); diff --git a/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs b/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs index f0ecf97a..4fb74ed5 100644 --- a/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs +++ b/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs @@ -7,10 +7,12 @@ namespace org { namespace ldk { namespace structs { /** - * A reply_short_channel_ids_end message is sent as a reply to a - * query_short_channel_ids message. The query recipient makes a best + * A [`reply_short_channel_ids_end`] message is sent as a reply to a + * message. The query recipient makes a best * effort to respond based on their local network view which may not be * a perfect view of the network. + * + * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages */ public class ReplyShortChannelIdsEnd : CommonBase { internal ReplyShortChannelIdsEnd(object _dummy, long ptr) : base(ptr) { } @@ -38,7 +40,7 @@ public class ReplyShortChannelIdsEnd : CommonBase { /** * Indicates if the query recipient maintains up-to-date channel - * information for the chain_hash + * information for the `chain_hash` */ public bool get_full_information() { bool ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr); @@ -48,7 +50,7 @@ public class ReplyShortChannelIdsEnd : CommonBase { /** * Indicates if the query recipient maintains up-to-date channel - * information for the chain_hash + * information for the `chain_hash` */ public void set_full_information(bool val) { bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val); diff --git a/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs index bd1f6ad2..bc5f7f1c 100644 --- a/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_AcceptChannelDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs new file mode 100644 index 00000000..eed4788c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_AcceptChannelV2DecodeErrorZ : CommonBase { + Result_AcceptChannelV2DecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_AcceptChannelV2DecodeErrorZ() { + if (ptr != 0) { bindings.CResult_AcceptChannelV2DecodeErrorZ_free(ptr); } + } + + internal static Result_AcceptChannelV2DecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_AcceptChannelV2DecodeErrorZ_is_ok(ptr)) { + return new Result_AcceptChannelV2DecodeErrorZ_OK(null, ptr); + } else { + return new Result_AcceptChannelV2DecodeErrorZ_Err(null, ptr); + } + } + public class Result_AcceptChannelV2DecodeErrorZ_OK : Result_AcceptChannelV2DecodeErrorZ { + public readonly AcceptChannelV2 res; + internal Result_AcceptChannelV2DecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_AcceptChannelV2DecodeErrorZ_get_ok(ptr); + org.ldk.structs.AcceptChannelV2 res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.AcceptChannelV2(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_AcceptChannelV2DecodeErrorZ_Err : Result_AcceptChannelV2DecodeErrorZ { + public readonly DecodeError err; + internal Result_AcceptChannelV2DecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_AcceptChannelV2DecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state. + */ + public static Result_AcceptChannelV2DecodeErrorZ ok(org.ldk.structs.AcceptChannelV2 o) { + long ret = bindings.CResult_AcceptChannelV2DecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state. + */ + public static Result_AcceptChannelV2DecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_AcceptChannelV2DecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_AcceptChannelV2DecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_AcceptChannelV2DecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_AcceptChannelV2DecodeErrorZ clone() { + long ret = bindings.CResult_AcceptChannelV2DecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs index 6ce8a79d..0f4f932f 100644 --- a/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs new file mode 100644 index 00000000..1955fdae --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_BigSizeDecodeErrorZ : CommonBase { + Result_BigSizeDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BigSizeDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_BigSizeDecodeErrorZ_free(ptr); } + } + + internal static Result_BigSizeDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BigSizeDecodeErrorZ_is_ok(ptr)) { + return new Result_BigSizeDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BigSizeDecodeErrorZ_Err(null, ptr); + } + } + public class Result_BigSizeDecodeErrorZ_OK : Result_BigSizeDecodeErrorZ { + public readonly BigSize res; + internal Result_BigSizeDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BigSizeDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BigSize res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BigSize(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BigSizeDecodeErrorZ_Err : Result_BigSizeDecodeErrorZ { + public readonly DecodeError err; + internal Result_BigSizeDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_BigSizeDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_BigSizeDecodeErrorZ in the success state. + */ + public static Result_BigSizeDecodeErrorZ ok(org.ldk.structs.BigSize o) { + long ret = bindings.CResult_BigSizeDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_BigSizeDecodeErrorZ in the error state. + */ + public static Result_BigSizeDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BigSizeDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_BigSizeDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BigSizeDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BigSizeDecodeErrorZ clone() { + long ret = bindings.CResult_BigSizeDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs index 5266f746..ca6011dc 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_BlindedHopDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs new file mode 100644 index 00000000..e64b1bd8 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_BlindedHopFeaturesDecodeErrorZ : CommonBase { + Result_BlindedHopFeaturesDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BlindedHopFeaturesDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_BlindedHopFeaturesDecodeErrorZ_free(ptr); } + } + + internal static Result_BlindedHopFeaturesDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(ptr)) { + return new Result_BlindedHopFeaturesDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BlindedHopFeaturesDecodeErrorZ_Err(null, ptr); + } + } + public class Result_BlindedHopFeaturesDecodeErrorZ_OK : Result_BlindedHopFeaturesDecodeErrorZ { + public readonly BlindedHopFeatures res; + internal Result_BlindedHopFeaturesDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BlindedHopFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedHopFeatures(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BlindedHopFeaturesDecodeErrorZ_Err : Result_BlindedHopFeaturesDecodeErrorZ { + public readonly DecodeError err; + internal Result_BlindedHopFeaturesDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state. + */ + public static Result_BlindedHopFeaturesDecodeErrorZ ok(org.ldk.structs.BlindedHopFeatures o) { + long ret = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state. + */ + public static Result_BlindedHopFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedHopFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs index 80173d2b..2c7e344d 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_BlindedPathDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs new file mode 100644 index 00000000..c0f05658 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_BlindedPayInfoDecodeErrorZ : CommonBase { + Result_BlindedPayInfoDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BlindedPayInfoDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_BlindedPayInfoDecodeErrorZ_free(ptr); } + } + + internal static Result_BlindedPayInfoDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedPayInfoDecodeErrorZ_is_ok(ptr)) { + return new Result_BlindedPayInfoDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BlindedPayInfoDecodeErrorZ_Err(null, ptr); + } + } + public class Result_BlindedPayInfoDecodeErrorZ_OK : Result_BlindedPayInfoDecodeErrorZ { + public readonly BlindedPayInfo res; + internal Result_BlindedPayInfoDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BlindedPayInfoDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BlindedPayInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPayInfo(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BlindedPayInfoDecodeErrorZ_Err : Result_BlindedPayInfoDecodeErrorZ { + public readonly DecodeError err; + internal Result_BlindedPayInfoDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_BlindedPayInfoDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state. + */ + public static Result_BlindedPayInfoDecodeErrorZ ok(org.ldk.structs.BlindedPayInfo o) { + long ret = bindings.CResult_BlindedPayInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state. + */ + public static Result_BlindedPayInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BlindedPayInfoDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_BlindedPayInfoDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedPayInfoDecodeErrorZ clone() { + long ret = bindings.CResult_BlindedPayInfoDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs new file mode 100644 index 00000000..9fbe083c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_BlindedTailDecodeErrorZ : CommonBase { + Result_BlindedTailDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BlindedTailDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_BlindedTailDecodeErrorZ_free(ptr); } + } + + internal static Result_BlindedTailDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedTailDecodeErrorZ_is_ok(ptr)) { + return new Result_BlindedTailDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BlindedTailDecodeErrorZ_Err(null, ptr); + } + } + public class Result_BlindedTailDecodeErrorZ_OK : Result_BlindedTailDecodeErrorZ { + public readonly BlindedTail res; + internal Result_BlindedTailDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BlindedTailDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BlindedTail res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedTail(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BlindedTailDecodeErrorZ_Err : Result_BlindedTailDecodeErrorZ { + public readonly DecodeError err; + internal Result_BlindedTailDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_BlindedTailDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_BlindedTailDecodeErrorZ in the success state. + */ + public static Result_BlindedTailDecodeErrorZ ok(org.ldk.structs.BlindedTail o) { + long ret = bindings.CResult_BlindedTailDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedTailDecodeErrorZ in the error state. + */ + public static Result_BlindedTailDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BlindedTailDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_BlindedTailDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BlindedTailDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedTailDecodeErrorZ clone() { + long ret = bindings.CResult_BlindedTailDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs new file mode 100644 index 00000000..8f5176ff --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt11InvoiceBolt11SemanticErrorZ : CommonBase { + Result_Bolt11InvoiceBolt11SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt11InvoiceBolt11SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(ptr); } + } + + internal static Result_Bolt11InvoiceBolt11SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(ptr)) { + return new Result_Bolt11InvoiceBolt11SemanticErrorZ_OK(null, ptr); + } else { + return new Result_Bolt11InvoiceBolt11SemanticErrorZ_Err(null, ptr); + } + } + public class Result_Bolt11InvoiceBolt11SemanticErrorZ_OK : Result_Bolt11InvoiceBolt11SemanticErrorZ { + public readonly Bolt11Invoice res; + internal Result_Bolt11InvoiceBolt11SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_ok(ptr); + org.ldk.structs.Bolt11Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt11Invoice(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt11InvoiceBolt11SemanticErrorZ_Err : Result_Bolt11InvoiceBolt11SemanticErrorZ { + public readonly Bolt11SemanticError err; + internal Result_Bolt11InvoiceBolt11SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state. + */ + public static Result_Bolt11InvoiceBolt11SemanticErrorZ ok(org.ldk.structs.Bolt11Invoice o) { + long ret = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state. + */ + public static Result_Bolt11InvoiceBolt11SemanticErrorZ err(Bolt11SemanticError e) { + long ret = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt11InvoiceBolt11SemanticErrorZ clone() { + long ret = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs new file mode 100644 index 00000000..2a126e37 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt11InvoiceFeaturesDecodeErrorZ : CommonBase { + Result_Bolt11InvoiceFeaturesDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt11InvoiceFeaturesDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(ptr); } + } + + internal static Result_Bolt11InvoiceFeaturesDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(ptr)) { + return new Result_Bolt11InvoiceFeaturesDecodeErrorZ_OK(null, ptr); + } else { + return new Result_Bolt11InvoiceFeaturesDecodeErrorZ_Err(null, ptr); + } + } + public class Result_Bolt11InvoiceFeaturesDecodeErrorZ_OK : Result_Bolt11InvoiceFeaturesDecodeErrorZ { + public readonly Bolt11InvoiceFeatures res; + internal Result_Bolt11InvoiceFeaturesDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Bolt11InvoiceFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt11InvoiceFeaturesDecodeErrorZ_Err : Result_Bolt11InvoiceFeaturesDecodeErrorZ { + public readonly DecodeError err; + internal Result_Bolt11InvoiceFeaturesDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state. + */ + public static Result_Bolt11InvoiceFeaturesDecodeErrorZ ok(org.ldk.structs.Bolt11InvoiceFeatures o) { + long ret = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state. + */ + public static Result_Bolt11InvoiceFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt11InvoiceFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs new file mode 100644 index 00000000..b365f857 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt11InvoiceParseOrSemanticErrorZ : CommonBase { + Result_Bolt11InvoiceParseOrSemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt11InvoiceParseOrSemanticErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(ptr); } + } + + internal static Result_Bolt11InvoiceParseOrSemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(ptr)) { + return new Result_Bolt11InvoiceParseOrSemanticErrorZ_OK(null, ptr); + } else { + return new Result_Bolt11InvoiceParseOrSemanticErrorZ_Err(null, ptr); + } + } + public class Result_Bolt11InvoiceParseOrSemanticErrorZ_OK : Result_Bolt11InvoiceParseOrSemanticErrorZ { + public readonly Bolt11Invoice res; + internal Result_Bolt11InvoiceParseOrSemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_ok(ptr); + org.ldk.structs.Bolt11Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt11Invoice(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt11InvoiceParseOrSemanticErrorZ_Err : Result_Bolt11InvoiceParseOrSemanticErrorZ { + public readonly ParseOrSemanticError err; + internal Result_Bolt11InvoiceParseOrSemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_get_err(ptr); + org.ldk.structs.ParseOrSemanticError err_hu_conv = org.ldk.structs.ParseOrSemanticError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state. + */ + public static Result_Bolt11InvoiceParseOrSemanticErrorZ ok(org.ldk.structs.Bolt11Invoice o) { + long ret = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state. + */ + public static Result_Bolt11InvoiceParseOrSemanticErrorZ err(org.ldk.structs.ParseOrSemanticError e) { + long ret = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt11InvoiceParseOrSemanticErrorZ clone() { + long ret = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs new file mode 100644 index 00000000..23615193 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt11InvoiceSignOrCreationErrorZ : CommonBase { + Result_Bolt11InvoiceSignOrCreationErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt11InvoiceSignOrCreationErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_free(ptr); } + } + + internal static Result_Bolt11InvoiceSignOrCreationErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(ptr)) { + return new Result_Bolt11InvoiceSignOrCreationErrorZ_OK(null, ptr); + } else { + return new Result_Bolt11InvoiceSignOrCreationErrorZ_Err(null, ptr); + } + } + public class Result_Bolt11InvoiceSignOrCreationErrorZ_OK : Result_Bolt11InvoiceSignOrCreationErrorZ { + public readonly Bolt11Invoice res; + internal Result_Bolt11InvoiceSignOrCreationErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_get_ok(ptr); + org.ldk.structs.Bolt11Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt11Invoice(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt11InvoiceSignOrCreationErrorZ_Err : Result_Bolt11InvoiceSignOrCreationErrorZ { + public readonly SignOrCreationError err; + internal Result_Bolt11InvoiceSignOrCreationErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(ptr); + org.ldk.structs.SignOrCreationError err_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state. + */ + public static Result_Bolt11InvoiceSignOrCreationErrorZ ok(org.ldk.structs.Bolt11Invoice o) { + long ret = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state. + */ + public static Result_Bolt11InvoiceSignOrCreationErrorZ err(org.ldk.structs.SignOrCreationError e) { + long ret = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt11InvoiceSignOrCreationErrorZ clone() { + long ret = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs new file mode 100644 index 00000000..a0fdddd8 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt12InvoiceFeaturesDecodeErrorZ : CommonBase { + Result_Bolt12InvoiceFeaturesDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt12InvoiceFeaturesDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(ptr); } + } + + internal static Result_Bolt12InvoiceFeaturesDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(ptr)) { + return new Result_Bolt12InvoiceFeaturesDecodeErrorZ_OK(null, ptr); + } else { + return new Result_Bolt12InvoiceFeaturesDecodeErrorZ_Err(null, ptr); + } + } + public class Result_Bolt12InvoiceFeaturesDecodeErrorZ_OK : Result_Bolt12InvoiceFeaturesDecodeErrorZ { + public readonly Bolt12InvoiceFeatures res; + internal Result_Bolt12InvoiceFeaturesDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Bolt12InvoiceFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt12InvoiceFeatures(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt12InvoiceFeaturesDecodeErrorZ_Err : Result_Bolt12InvoiceFeaturesDecodeErrorZ { + public readonly DecodeError err; + internal Result_Bolt12InvoiceFeaturesDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state. + */ + public static Result_Bolt12InvoiceFeaturesDecodeErrorZ ok(org.ldk.structs.Bolt12InvoiceFeatures o) { + long ret = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state. + */ + public static Result_Bolt12InvoiceFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt12InvoiceFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs index 009f58c8..e5682750 100644 --- a/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.cs index ddf4469b..117c2c3f 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.cs @@ -57,6 +57,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.cs index 4c26c491..e18c9fc3 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.cs @@ -57,6 +57,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.cs new file mode 100644 index 00000000..9a327b40 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.cs @@ -0,0 +1,85 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ : CommonBase { + Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ() { + if (ptr != 0) { bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_free(ptr); } + } + + internal static Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_is_ok(ptr)) { + return new Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ_OK(null, ptr); + } else { + return new Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ_Err(null, ptr); + } + } + public class Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ_OK : Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ { + public readonly TwoTuple_PartiallySignedTransactionusizeZ res; + internal Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_get_ok(ptr); + TwoTuple_PartiallySignedTransactionusizeZ res_hu_conv = new TwoTuple_PartiallySignedTransactionusizeZ(null, res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ_Err : Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ { + internal Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ in the success state. + */ + public static Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ ok(org.ldk.structs.TwoTuple_PartiallySignedTransactionusizeZ o) { + long ret = bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_ok(o != null ? o.ptr : 0); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ ret_hu_conv = Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ in the error state. + */ + public static Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ err() { + long ret = bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ ret_hu_conv = Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ clone() { + long ret = bindings.CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ ret_hu_conv = Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.cs index 1951ecc1..4a3f2daa 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.cs @@ -57,6 +57,7 @@ public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ : CommonBas GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.cs deleted file mode 100644 index d1cfb645..00000000 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.cs +++ /dev/null @@ -1,91 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ : CommonBase { - Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ() { - if (ptr != 0) { bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(ptr); } - } - - internal static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(ptr)) { - return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(null, ptr); - } else { - return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(null, ptr); - } - } - public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK : Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ { - public readonly TwoTuple_PaymentHashPaymentSecretZ res; - internal Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(ptr); - TwoTuple_PaymentHashPaymentSecretZ res_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, res); - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err : Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ { - public readonly APIError err; - internal Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(ptr); - org.ldk.structs.APIError err_hu_conv = org.ldk.structs.APIError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state. - */ - public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ok(org.ldk.structs.TwoTuple_PaymentHashPaymentSecretZ o) { - long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o != null ? o.ptr : 0); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state. - */ - public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ err(org.ldk.structs.APIError e) { - long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ clone() { - long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_SignatureSignatureZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_SignatureSignatureZNoneZ.cs deleted file mode 100644 index 18744311..00000000 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_SignatureSignatureZNoneZ.cs +++ /dev/null @@ -1,85 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_C2Tuple_SignatureSignatureZNoneZ : CommonBase { - Result_C2Tuple_SignatureSignatureZNoneZ(object _dummy, long ptr) : base(ptr) { } - ~Result_C2Tuple_SignatureSignatureZNoneZ() { - if (ptr != 0) { bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_free(ptr); } - } - - internal static Result_C2Tuple_SignatureSignatureZNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(ptr)) { - return new Result_C2Tuple_SignatureSignatureZNoneZ_OK(null, ptr); - } else { - return new Result_C2Tuple_SignatureSignatureZNoneZ_Err(null, ptr); - } - } - public class Result_C2Tuple_SignatureSignatureZNoneZ_OK : Result_C2Tuple_SignatureSignatureZNoneZ { - public readonly TwoTuple_SignatureSignatureZ res; - internal Result_C2Tuple_SignatureSignatureZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(ptr); - TwoTuple_SignatureSignatureZ res_hu_conv = new TwoTuple_SignatureSignatureZ(null, res); - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_C2Tuple_SignatureSignatureZNoneZ_Err : Result_C2Tuple_SignatureSignatureZNoneZ { - internal Result_C2Tuple_SignatureSignatureZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - } - } - - /** - * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state. - */ - public static Result_C2Tuple_SignatureSignatureZNoneZ ok(org.ldk.structs.TwoTuple_SignatureSignatureZ o) { - long ret = bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o != null ? o.ptr : 0); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_SignatureSignatureZNoneZ ret_hu_conv = Result_C2Tuple_SignatureSignatureZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state. - */ - public static Result_C2Tuple_SignatureSignatureZNoneZ err() { - long ret = bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_SignatureSignatureZNoneZ ret_hu_conv = Result_C2Tuple_SignatureSignatureZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_C2Tuple_SignatureSignatureZNoneZ clone() { - long ret = bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_SignatureSignatureZNoneZ ret_hu_conv = Result_C2Tuple_SignatureSignatureZNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.cs new file mode 100644 index 00000000..c3ef6037 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_COption_APIErrorZDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_COption_APIErrorZDecodeErrorZ : CommonBase { + Result_COption_APIErrorZDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_COption_APIErrorZDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_COption_APIErrorZDecodeErrorZ_free(ptr); } + } + + internal static Result_COption_APIErrorZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_APIErrorZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_APIErrorZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_APIErrorZDecodeErrorZ_Err(null, ptr); + } + } + public class Result_COption_APIErrorZDecodeErrorZ_OK : Result_COption_APIErrorZDecodeErrorZ { + public readonly Option_APIErrorZ res; + internal Result_COption_APIErrorZDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_COption_APIErrorZDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Option_APIErrorZ res_hu_conv = org.ldk.structs.Option_APIErrorZ.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_COption_APIErrorZDecodeErrorZ_Err : Result_COption_APIErrorZDecodeErrorZ { + public readonly DecodeError err; + internal Result_COption_APIErrorZDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_COption_APIErrorZDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state. + */ + public static Result_COption_APIErrorZDecodeErrorZ ok(org.ldk.structs.Option_APIErrorZ o) { + long ret = bindings.CResult_COption_APIErrorZDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state. + */ + public static Result_COption_APIErrorZDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_COption_APIErrorZDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_COption_APIErrorZDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_APIErrorZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_APIErrorZDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs index 2471d6ee..258edbe7 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_COption_ClosureReasonZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_COption_ClosureReasonZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.cs index f39764ba..c78bc7c2 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_COption_CustomOnionMessageContentsZDecodeErrorZ : CommonBase GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_CustomOnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_COption_CustomOnionMessageContentsZDecodeErrorZ : CommonBase GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_CustomOnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs index 16982439..02d7c7f9 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_EventZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_COption_EventZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_COption_EventZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs index 5b392a4d..7d92a7f1 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_KeyPairZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_KeyPairZNoneZ.cs new file mode 100644 index 00000000..32a34801 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_COption_KeyPairZNoneZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_COption_KeyPairZNoneZ : CommonBase { + Result_COption_KeyPairZNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_COption_KeyPairZNoneZ() { + if (ptr != 0) { bindings.CResult_COption_KeyPairZNoneZ_free(ptr); } + } + + internal static Result_COption_KeyPairZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_KeyPairZNoneZ_is_ok(ptr)) { + return new Result_COption_KeyPairZNoneZ_OK(null, ptr); + } else { + return new Result_COption_KeyPairZNoneZ_Err(null, ptr); + } + } + public class Result_COption_KeyPairZNoneZ_OK : Result_COption_KeyPairZNoneZ { + public readonly Option_KeyPairZ res; + internal Result_COption_KeyPairZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_COption_KeyPairZNoneZ_get_ok(ptr); + org.ldk.structs.Option_KeyPairZ res_hu_conv = org.ldk.structs.Option_KeyPairZ.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_COption_KeyPairZNoneZ_Err : Result_COption_KeyPairZNoneZ { + internal Result_COption_KeyPairZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_COption_KeyPairZNoneZ in the success state. + */ + public static Result_COption_KeyPairZNoneZ ok(org.ldk.structs.Option_KeyPairZ o) { + long ret = bindings.CResult_COption_KeyPairZNoneZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_KeyPairZNoneZ ret_hu_conv = Result_COption_KeyPairZNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_KeyPairZNoneZ in the error state. + */ + public static Result_COption_KeyPairZNoneZ err() { + long ret = bindings.CResult_COption_KeyPairZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_KeyPairZNoneZ ret_hu_conv = Result_COption_KeyPairZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_COption_KeyPairZNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_COption_KeyPairZNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_COption_KeyPairZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_KeyPairZNoneZ clone() { + long ret = bindings.CResult_COption_KeyPairZNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_KeyPairZNoneZ ret_hu_conv = Result_COption_KeyPairZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs index 2f75f616..02395f8d 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_COption_MonitorEventZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_COption_MonitorEventZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs index bb5228aa..2dad04a9 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.cs new file mode 100644 index 00000000..52b19168 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_COption_PathFailureZDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_COption_PathFailureZDecodeErrorZ : CommonBase { + Result_COption_PathFailureZDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_COption_PathFailureZDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_COption_PathFailureZDecodeErrorZ_free(ptr); } + } + + internal static Result_COption_PathFailureZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_PathFailureZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_PathFailureZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_PathFailureZDecodeErrorZ_Err(null, ptr); + } + } + public class Result_COption_PathFailureZDecodeErrorZ_OK : Result_COption_PathFailureZDecodeErrorZ { + public readonly Option_PathFailureZ res; + internal Result_COption_PathFailureZDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_COption_PathFailureZDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Option_PathFailureZ res_hu_conv = org.ldk.structs.Option_PathFailureZ.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_COption_PathFailureZDecodeErrorZ_Err : Result_COption_PathFailureZDecodeErrorZ { + public readonly DecodeError err; + internal Result_COption_PathFailureZDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_COption_PathFailureZDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state. + */ + public static Result_COption_PathFailureZDecodeErrorZ ok(org.ldk.structs.Option_PathFailureZ o) { + long ret = bindings.CResult_COption_PathFailureZDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state. + */ + public static Result_COption_PathFailureZDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_COption_PathFailureZDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_COption_PathFailureZDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_PathFailureZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_PathFailureZDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs index 3c2f0d9d..483e59d4 100644 --- a/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_COption_TypeZDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_COption_TypeZDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs new file mode 100644 index 00000000..8a2a3b7c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs @@ -0,0 +1,92 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_CVec_UtxoZNoneZ : CommonBase { + Result_CVec_UtxoZNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_CVec_UtxoZNoneZ() { + if (ptr != 0) { bindings.CResult_CVec_UtxoZNoneZ_free(ptr); } + } + + internal static Result_CVec_UtxoZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_CVec_UtxoZNoneZ_is_ok(ptr)) { + return new Result_CVec_UtxoZNoneZ_OK(null, ptr); + } else { + return new Result_CVec_UtxoZNoneZ_Err(null, ptr); + } + } + public class Result_CVec_UtxoZNoneZ_OK : Result_CVec_UtxoZNoneZ { + public readonly Utxo[] res; + internal Result_CVec_UtxoZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long[] res = bindings.CResult_CVec_UtxoZNoneZ_get_ok(ptr); + int res_conv_6_len = res.Length; + Utxo[] res_conv_6_arr = new Utxo[res_conv_6_len]; + for (int g = 0; g < res_conv_6_len; g++) { + long res_conv_6 = res[g]; + org.ldk.structs.Utxo res_conv_6_hu_conv = null; if (res_conv_6 < 0 || res_conv_6 > 4096) { res_conv_6_hu_conv = new org.ldk.structs.Utxo(null, res_conv_6); } + if (res_conv_6_hu_conv != null) { res_conv_6_hu_conv.ptrs_to.AddLast(this); }; + res_conv_6_arr[g] = res_conv_6_hu_conv; + } + this.res = res_conv_6_arr; + } + } + + public class Result_CVec_UtxoZNoneZ_Err : Result_CVec_UtxoZNoneZ { + internal Result_CVec_UtxoZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_CVec_UtxoZNoneZ in the success state. + */ + public static Result_CVec_UtxoZNoneZ ok(Utxo[] o) { + long ret = bindings.CResult_CVec_UtxoZNoneZ_ok(o != null ? InternalUtils.mapArray(o, o_conv_6 => o_conv_6 == null ? 0 : o_conv_6.ptr) : null); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret); + foreach (Utxo o_conv_6 in o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_conv_6); }; }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_UtxoZNoneZ in the error state. + */ + public static Result_CVec_UtxoZNoneZ err() { + long ret = bindings.CResult_CVec_UtxoZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_CVec_UtxoZNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_CVec_UtxoZNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_UtxoZNoneZ clone() { + long ret = bindings.CResult_CVec_UtxoZNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs index 136ece1b..56a10918 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs index 0390aacf..7db5fcb0 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelConfigDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs index ccb3ca29..c9ef9b72 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelCounterpartyDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelCounterpartyDecodeErrorZ ret_hu_conv = Result_ChannelCounterpartyDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs index 5dba3a60..0ef33832 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelDetailsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs index ba5fa668..38d56078 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs index 28e56858..ae5a6f5a 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs index 8bfd46a8..5aa6567e 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs index d46e8439..fca2aeaa 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs index b7a084d5..7161b609 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelReadyDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs index f3f6d007..8483f19a 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelReestablishDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.cs new file mode 100644 index 00000000..eaf104c5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_ChannelShutdownStateDecodeErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_ChannelShutdownStateDecodeErrorZ : CommonBase { + Result_ChannelShutdownStateDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_ChannelShutdownStateDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_ChannelShutdownStateDecodeErrorZ_free(ptr); } + } + + internal static Result_ChannelShutdownStateDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ChannelShutdownStateDecodeErrorZ_is_ok(ptr)) { + return new Result_ChannelShutdownStateDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ChannelShutdownStateDecodeErrorZ_Err(null, ptr); + } + } + public class Result_ChannelShutdownStateDecodeErrorZ_OK : Result_ChannelShutdownStateDecodeErrorZ { + public readonly ChannelShutdownState res; + internal Result_ChannelShutdownStateDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + this.res = bindings.CResult_ChannelShutdownStateDecodeErrorZ_get_ok(ptr); + } + } + + public class Result_ChannelShutdownStateDecodeErrorZ_Err : Result_ChannelShutdownStateDecodeErrorZ { + public readonly DecodeError err; + internal Result_ChannelShutdownStateDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_ChannelShutdownStateDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state. + */ + public static Result_ChannelShutdownStateDecodeErrorZ ok(ChannelShutdownState o) { + long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_ok(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state. + */ + public static Result_ChannelShutdownStateDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelShutdownStateDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs index 94c4bea1..742f0805 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs index 503d01db..ee3b53fa 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs index 59c424a7..61c6400c 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs index 6460aa30..e7af0a52 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ChannelUpdateInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateInfoDecodeErrorZ ret_hu_conv = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs index 1fba55a5..79c19a57 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ClosingSignedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs index 33bd3016..5c7d6b5f 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs new file mode 100644 index 00000000..63b813a1 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_CoinSelectionNoneZ : CommonBase { + Result_CoinSelectionNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_CoinSelectionNoneZ() { + if (ptr != 0) { bindings.CResult_CoinSelectionNoneZ_free(ptr); } + } + + internal static Result_CoinSelectionNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_CoinSelectionNoneZ_is_ok(ptr)) { + return new Result_CoinSelectionNoneZ_OK(null, ptr); + } else { + return new Result_CoinSelectionNoneZ_Err(null, ptr); + } + } + public class Result_CoinSelectionNoneZ_OK : Result_CoinSelectionNoneZ { + public readonly CoinSelection res; + internal Result_CoinSelectionNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_CoinSelectionNoneZ_get_ok(ptr); + org.ldk.structs.CoinSelection res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CoinSelection(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_CoinSelectionNoneZ_Err : Result_CoinSelectionNoneZ { + internal Result_CoinSelectionNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_CoinSelectionNoneZ in the success state. + */ + public static Result_CoinSelectionNoneZ ok(org.ldk.structs.CoinSelection o) { + long ret = bindings.CResult_CoinSelectionNoneZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_CoinSelectionNoneZ in the error state. + */ + public static Result_CoinSelectionNoneZ err() { + long ret = bindings.CResult_CoinSelectionNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_CoinSelectionNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_CoinSelectionNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CoinSelectionNoneZ clone() { + long ret = bindings.CResult_CoinSelectionNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs index 8aa21430..2f8920ae 100644 --- a/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_CommitmentSignedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs index f61be718..fa414c48 100644 --- a/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_CommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs index 2bba6c17..9116a4d4 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ : Commo GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs index cf8cecd4..117c31ee 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyCommitmentSecretsDecodeErrorZ ret_hu_conv = Result_CounterpartyCommitmentSecretsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs index 57c51bf0..b3c3b723 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs index 73fa59cf..005af440 100644 --- a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs index a19a87d4..51bbe928 100644 --- a/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ErrorMessageDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs index 47668460..6cd6b40f 100644 --- a/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_FixedPenaltyScorerDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs index 5abfb85e..787006aa 100644 --- a/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_FundingCreatedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs index 851ece04..55ceac75 100644 --- a/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_FundingSignedDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs index ccf645b1..9682ff58 100644 --- a/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs index 34b23821..369191e0 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs index 23a1f2c7..94fac24e 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_HTLCUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs index 43874f0c..13cbf083 100644 --- a/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs new file mode 100644 index 00000000..2fd97360 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_HostnameDecodeErrorZ : CommonBase { + Result_HostnameDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_HostnameDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_HostnameDecodeErrorZ_free(ptr); } + } + + internal static Result_HostnameDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_HostnameDecodeErrorZ_is_ok(ptr)) { + return new Result_HostnameDecodeErrorZ_OK(null, ptr); + } else { + return new Result_HostnameDecodeErrorZ_Err(null, ptr); + } + } + public class Result_HostnameDecodeErrorZ_OK : Result_HostnameDecodeErrorZ { + public readonly Hostname res; + internal Result_HostnameDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_HostnameDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Hostname res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Hostname(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_HostnameDecodeErrorZ_Err : Result_HostnameDecodeErrorZ { + public readonly DecodeError err; + internal Result_HostnameDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_HostnameDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_HostnameDecodeErrorZ in the success state. + */ + public static Result_HostnameDecodeErrorZ ok(org.ldk.structs.Hostname o) { + long ret = bindings.CResult_HostnameDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_HostnameDecodeErrorZ in the error state. + */ + public static Result_HostnameDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_HostnameDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_HostnameDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_HostnameDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HostnameDecodeErrorZ clone() { + long ret = bindings.CResult_HostnameDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs index f0c6a11a..76e0dc10 100644 --- a/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_InFlightHtlcsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs index 9577932f..ce2ae5f0 100644 --- a/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_InMemorySignerDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs index 62937ed7..d35f26d2 100644 --- a/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_InitDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs index 7d1e3735..ae3e3eeb 100644 --- a/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_InitFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs new file mode 100644 index 00000000..8b967f0e --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InvoiceErrorDecodeErrorZ : CommonBase { + Result_InvoiceErrorDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InvoiceErrorDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_InvoiceErrorDecodeErrorZ_free(ptr); } + } + + internal static Result_InvoiceErrorDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceErrorDecodeErrorZ_is_ok(ptr)) { + return new Result_InvoiceErrorDecodeErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceErrorDecodeErrorZ_Err(null, ptr); + } + } + public class Result_InvoiceErrorDecodeErrorZ_OK : Result_InvoiceErrorDecodeErrorZ { + public readonly InvoiceError res; + internal Result_InvoiceErrorDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InvoiceErrorDecodeErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceError res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceError(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InvoiceErrorDecodeErrorZ_Err : Result_InvoiceErrorDecodeErrorZ { + public readonly DecodeError err; + internal Result_InvoiceErrorDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_InvoiceErrorDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state. + */ + public static Result_InvoiceErrorDecodeErrorZ ok(org.ldk.structs.InvoiceError o) { + long ret = bindings.CResult_InvoiceErrorDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state. + */ + public static Result_InvoiceErrorDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_InvoiceErrorDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InvoiceErrorDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_InvoiceErrorDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InvoiceErrorDecodeErrorZ clone() { + long ret = bindings.CResult_InvoiceErrorDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.cs deleted file mode 100644 index 2642b382..00000000 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_InvoiceFeaturesDecodeErrorZ : CommonBase { - Result_InvoiceFeaturesDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_InvoiceFeaturesDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_InvoiceFeaturesDecodeErrorZ_free(ptr); } - } - - internal static Result_InvoiceFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(ptr)) { - return new Result_InvoiceFeaturesDecodeErrorZ_OK(null, ptr); - } else { - return new Result_InvoiceFeaturesDecodeErrorZ_Err(null, ptr); - } - } - public class Result_InvoiceFeaturesDecodeErrorZ_OK : Result_InvoiceFeaturesDecodeErrorZ { - public readonly InvoiceFeatures res; - internal Result_InvoiceFeaturesDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_InvoiceFeaturesDecodeErrorZ_get_ok(ptr); - org.ldk.structs.InvoiceFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceFeatures(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_InvoiceFeaturesDecodeErrorZ_Err : Result_InvoiceFeaturesDecodeErrorZ { - public readonly DecodeError err; - internal Result_InvoiceFeaturesDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_InvoiceFeaturesDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state. - */ - public static Result_InvoiceFeaturesDecodeErrorZ ok(org.ldk.structs.InvoiceFeatures o) { - long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state. - */ - public static Result_InvoiceFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_InvoiceFeaturesDecodeErrorZ clone() { - long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.cs deleted file mode 100644 index 93e516c6..00000000 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_InvoiceParseOrSemanticErrorZ : CommonBase { - Result_InvoiceParseOrSemanticErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_InvoiceParseOrSemanticErrorZ() { - if (ptr != 0) { bindings.CResult_InvoiceParseOrSemanticErrorZ_free(ptr); } - } - - internal static Result_InvoiceParseOrSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_InvoiceParseOrSemanticErrorZ_is_ok(ptr)) { - return new Result_InvoiceParseOrSemanticErrorZ_OK(null, ptr); - } else { - return new Result_InvoiceParseOrSemanticErrorZ_Err(null, ptr); - } - } - public class Result_InvoiceParseOrSemanticErrorZ_OK : Result_InvoiceParseOrSemanticErrorZ { - public readonly Invoice res; - internal Result_InvoiceParseOrSemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_InvoiceParseOrSemanticErrorZ_get_ok(ptr); - org.ldk.structs.Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Invoice(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_InvoiceParseOrSemanticErrorZ_Err : Result_InvoiceParseOrSemanticErrorZ { - public readonly ParseOrSemanticError err; - internal Result_InvoiceParseOrSemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_InvoiceParseOrSemanticErrorZ_get_err(ptr); - org.ldk.structs.ParseOrSemanticError err_hu_conv = org.ldk.structs.ParseOrSemanticError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state. - */ - public static Result_InvoiceParseOrSemanticErrorZ ok(org.ldk.structs.Invoice o) { - long ret = bindings.CResult_InvoiceParseOrSemanticErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state. - */ - public static Result_InvoiceParseOrSemanticErrorZ err(org.ldk.structs.ParseOrSemanticError e) { - long ret = bindings.CResult_InvoiceParseOrSemanticErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_InvoiceParseOrSemanticErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_InvoiceParseOrSemanticErrorZ clone() { - long ret = bindings.CResult_InvoiceParseOrSemanticErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFeaturesDecodeErrorZ.cs deleted file mode 100644 index b1c5b773..00000000 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFeaturesDecodeErrorZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_InvoiceRequestFeaturesDecodeErrorZ : CommonBase { - Result_InvoiceRequestFeaturesDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_InvoiceRequestFeaturesDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_free(ptr); } - } - - internal static Result_InvoiceRequestFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(ptr)) { - return new Result_InvoiceRequestFeaturesDecodeErrorZ_OK(null, ptr); - } else { - return new Result_InvoiceRequestFeaturesDecodeErrorZ_Err(null, ptr); - } - } - public class Result_InvoiceRequestFeaturesDecodeErrorZ_OK : Result_InvoiceRequestFeaturesDecodeErrorZ { - public readonly InvoiceRequestFeatures res; - internal Result_InvoiceRequestFeaturesDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(ptr); - org.ldk.structs.InvoiceRequestFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_InvoiceRequestFeaturesDecodeErrorZ_Err : Result_InvoiceRequestFeaturesDecodeErrorZ { - public readonly DecodeError err; - internal Result_InvoiceRequestFeaturesDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ in the success state. - */ - public static Result_InvoiceRequestFeaturesDecodeErrorZ ok(org.ldk.structs.InvoiceRequestFeatures o) { - long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ in the error state. - */ - public static Result_InvoiceRequestFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_InvoiceRequestFeaturesDecodeErrorZ clone() { - long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceSemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceSemanticErrorZ.cs deleted file mode 100644 index 280d1580..00000000 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceSemanticErrorZ.cs +++ /dev/null @@ -1,89 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_InvoiceSemanticErrorZ : CommonBase { - Result_InvoiceSemanticErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_InvoiceSemanticErrorZ() { - if (ptr != 0) { bindings.CResult_InvoiceSemanticErrorZ_free(ptr); } - } - - internal static Result_InvoiceSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_InvoiceSemanticErrorZ_is_ok(ptr)) { - return new Result_InvoiceSemanticErrorZ_OK(null, ptr); - } else { - return new Result_InvoiceSemanticErrorZ_Err(null, ptr); - } - } - public class Result_InvoiceSemanticErrorZ_OK : Result_InvoiceSemanticErrorZ { - public readonly Invoice res; - internal Result_InvoiceSemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_InvoiceSemanticErrorZ_get_ok(ptr); - org.ldk.structs.Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Invoice(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_InvoiceSemanticErrorZ_Err : Result_InvoiceSemanticErrorZ { - public readonly SemanticError err; - internal Result_InvoiceSemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - this.err = bindings.CResult_InvoiceSemanticErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_InvoiceSemanticErrorZ in the success state. - */ - public static Result_InvoiceSemanticErrorZ ok(org.ldk.structs.Invoice o) { - long ret = bindings.CResult_InvoiceSemanticErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_InvoiceSemanticErrorZ in the error state. - */ - public static Result_InvoiceSemanticErrorZ err(SemanticError e) { - long ret = bindings.CResult_InvoiceSemanticErrorZ_err(e); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_InvoiceSemanticErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_InvoiceSemanticErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_InvoiceSemanticErrorZ clone() { - long ret = bindings.CResult_InvoiceSemanticErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.cs deleted file mode 100644 index 10c9e4c7..00000000 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_InvoiceSignOrCreationErrorZ : CommonBase { - Result_InvoiceSignOrCreationErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_InvoiceSignOrCreationErrorZ() { - if (ptr != 0) { bindings.CResult_InvoiceSignOrCreationErrorZ_free(ptr); } - } - - internal static Result_InvoiceSignOrCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_InvoiceSignOrCreationErrorZ_is_ok(ptr)) { - return new Result_InvoiceSignOrCreationErrorZ_OK(null, ptr); - } else { - return new Result_InvoiceSignOrCreationErrorZ_Err(null, ptr); - } - } - public class Result_InvoiceSignOrCreationErrorZ_OK : Result_InvoiceSignOrCreationErrorZ { - public readonly Invoice res; - internal Result_InvoiceSignOrCreationErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_InvoiceSignOrCreationErrorZ_get_ok(ptr); - org.ldk.structs.Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Invoice(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_InvoiceSignOrCreationErrorZ_Err : Result_InvoiceSignOrCreationErrorZ { - public readonly SignOrCreationError err; - internal Result_InvoiceSignOrCreationErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_InvoiceSignOrCreationErrorZ_get_err(ptr); - org.ldk.structs.SignOrCreationError err_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state. - */ - public static Result_InvoiceSignOrCreationErrorZ ok(org.ldk.structs.Invoice o) { - long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state. - */ - public static Result_InvoiceSignOrCreationErrorZ err(org.ldk.structs.SignOrCreationError e) { - long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_InvoiceSignOrCreationErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_InvoiceSignOrCreationErrorZ clone() { - long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.cs new file mode 100644 index 00000000..3d3b7f81 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_MaxDustHTLCExposureDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_MaxDustHTLCExposureDecodeErrorZ : CommonBase { + Result_MaxDustHTLCExposureDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_MaxDustHTLCExposureDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_free(ptr); } + } + + internal static Result_MaxDustHTLCExposureDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(ptr)) { + return new Result_MaxDustHTLCExposureDecodeErrorZ_OK(null, ptr); + } else { + return new Result_MaxDustHTLCExposureDecodeErrorZ_Err(null, ptr); + } + } + public class Result_MaxDustHTLCExposureDecodeErrorZ_OK : Result_MaxDustHTLCExposureDecodeErrorZ { + public readonly MaxDustHTLCExposure res; + internal Result_MaxDustHTLCExposureDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_get_ok(ptr); + org.ldk.structs.MaxDustHTLCExposure res_hu_conv = org.ldk.structs.MaxDustHTLCExposure.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_MaxDustHTLCExposureDecodeErrorZ_Err : Result_MaxDustHTLCExposureDecodeErrorZ { + public readonly DecodeError err; + internal Result_MaxDustHTLCExposureDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state. + */ + public static Result_MaxDustHTLCExposureDecodeErrorZ ok(org.ldk.structs.MaxDustHTLCExposure o) { + long ret = bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state. + */ + public static Result_MaxDustHTLCExposureDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_MaxDustHTLCExposureDecodeErrorZ clone() { + long ret = bindings.CResult_MaxDustHTLCExposureDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MaxDustHTLCExposureDecodeErrorZ ret_hu_conv = Result_MaxDustHTLCExposureDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_NetAddressDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NetAddressDecodeErrorZ.cs index ac2f5e93..7acd3edc 100644 --- a/c_sharp/src/org/ldk/structs/Result_NetAddressDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NetAddressDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_NetAddressDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_NetAddressDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs index eddf38ae..31f4e81d 100644 --- a/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.cs @@ -41,13 +41,12 @@ public class Result_NetworkGraphDecodeErrorZ : CommonBase { /** * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state. */ - public static Result_NetworkGraphDecodeErrorZ ok(byte[] o_genesis_hash, Logger o_logger) { - long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(InternalUtils.check_arr_len(o_genesis_hash, 32), o_logger == null ? 0 : o_logger.ptr)); - GC.KeepAlive(o_genesis_hash); + public static Result_NetworkGraphDecodeErrorZ ok(Network o_network, Logger o_logger) { + long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(o_network, o_logger.ptr)); + GC.KeepAlive(o_network); GC.KeepAlive(o_logger); if (ret >= 0 && ret <= 4096) { return null; } Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); - ; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_logger); }; return ret_hu_conv; } @@ -60,6 +59,7 @@ public class Result_NetworkGraphDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs index ea77d9c1..93edb417 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_NodeAliasDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs index c96a56d1..665e8e36 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_NodeAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs index a1bc15c2..cb2c2245 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs index a1ee4073..8d756c32 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_NodeFeaturesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs index 60f272bd..e4a5a918 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_NodeIdDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs index 5463abb2..61cfdcc3 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_NodeInfoDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs index 9ec27783..a89d3eb0 100644 --- a/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NoneAPIErrorZ.cs @@ -51,6 +51,7 @@ public class Result_NoneAPIErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneBolt11SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneBolt11SemanticErrorZ.cs new file mode 100644 index 00000000..f56a9e6c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_NoneBolt11SemanticErrorZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_NoneBolt11SemanticErrorZ : CommonBase { + Result_NoneBolt11SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_NoneBolt11SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_NoneBolt11SemanticErrorZ_free(ptr); } + } + + internal static Result_NoneBolt11SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_NoneBolt11SemanticErrorZ_is_ok(ptr)) { + return new Result_NoneBolt11SemanticErrorZ_OK(null, ptr); + } else { + return new Result_NoneBolt11SemanticErrorZ_Err(null, ptr); + } + } + public class Result_NoneBolt11SemanticErrorZ_OK : Result_NoneBolt11SemanticErrorZ { + internal Result_NoneBolt11SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + public class Result_NoneBolt11SemanticErrorZ_Err : Result_NoneBolt11SemanticErrorZ { + public readonly Bolt11SemanticError err; + internal Result_NoneBolt11SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_NoneBolt11SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state. + */ + public static Result_NoneBolt11SemanticErrorZ ok() { + long ret = bindings.CResult_NoneBolt11SemanticErrorZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt11SemanticErrorZ ret_hu_conv = Result_NoneBolt11SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state. + */ + public static Result_NoneBolt11SemanticErrorZ err(Bolt11SemanticError e) { + long ret = bindings.CResult_NoneBolt11SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt11SemanticErrorZ ret_hu_conv = Result_NoneBolt11SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_NoneBolt11SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_NoneBolt11SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneBolt11SemanticErrorZ clone() { + long ret = bindings.CResult_NoneBolt11SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt11SemanticErrorZ ret_hu_conv = Result_NoneBolt11SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_NonePaymentErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NonePaymentErrorZ.cs index eb585a5e..706cbf42 100644 --- a/c_sharp/src/org/ldk/structs/Result_NonePaymentErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NonePaymentErrorZ.cs @@ -51,6 +51,7 @@ public class Result_NonePaymentErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs index 11184a98..91eb7602 100644 --- a/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NonePaymentSendFailureZ.cs @@ -51,6 +51,7 @@ public class Result_NonePaymentSendFailureZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneRetryableSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneRetryableSendFailureZ.cs new file mode 100644 index 00000000..ddf6a115 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_NoneRetryableSendFailureZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_NoneRetryableSendFailureZ : CommonBase { + Result_NoneRetryableSendFailureZ(object _dummy, long ptr) : base(ptr) { } + ~Result_NoneRetryableSendFailureZ() { + if (ptr != 0) { bindings.CResult_NoneRetryableSendFailureZ_free(ptr); } + } + + internal static Result_NoneRetryableSendFailureZ constr_from_ptr(long ptr) { + if (bindings.CResult_NoneRetryableSendFailureZ_is_ok(ptr)) { + return new Result_NoneRetryableSendFailureZ_OK(null, ptr); + } else { + return new Result_NoneRetryableSendFailureZ_Err(null, ptr); + } + } + public class Result_NoneRetryableSendFailureZ_OK : Result_NoneRetryableSendFailureZ { + internal Result_NoneRetryableSendFailureZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + public class Result_NoneRetryableSendFailureZ_Err : Result_NoneRetryableSendFailureZ { + public readonly RetryableSendFailure err; + internal Result_NoneRetryableSendFailureZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_NoneRetryableSendFailureZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_NoneRetryableSendFailureZ in the success state. + */ + public static Result_NoneRetryableSendFailureZ ok() { + long ret = bindings.CResult_NoneRetryableSendFailureZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneRetryableSendFailureZ in the error state. + */ + public static Result_NoneRetryableSendFailureZ err(RetryableSendFailure e) { + long ret = bindings.CResult_NoneRetryableSendFailureZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_NoneRetryableSendFailureZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_NoneRetryableSendFailureZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneRetryableSendFailureZ clone() { + long ret = bindings.CResult_NoneRetryableSendFailureZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneSemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneSemanticErrorZ.cs deleted file mode 100644 index 59b6c1df..00000000 --- a/c_sharp/src/org/ldk/structs/Result_NoneSemanticErrorZ.cs +++ /dev/null @@ -1,82 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_NoneSemanticErrorZ : CommonBase { - Result_NoneSemanticErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_NoneSemanticErrorZ() { - if (ptr != 0) { bindings.CResult_NoneSemanticErrorZ_free(ptr); } - } - - internal static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_NoneSemanticErrorZ_is_ok(ptr)) { - return new Result_NoneSemanticErrorZ_OK(null, ptr); - } else { - return new Result_NoneSemanticErrorZ_Err(null, ptr); - } - } - public class Result_NoneSemanticErrorZ_OK : Result_NoneSemanticErrorZ { - internal Result_NoneSemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - } - } - - public class Result_NoneSemanticErrorZ_Err : Result_NoneSemanticErrorZ { - public readonly SemanticError err; - internal Result_NoneSemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - this.err = bindings.CResult_NoneSemanticErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_NoneSemanticErrorZ in the success state. - */ - public static Result_NoneSemanticErrorZ ok() { - long ret = bindings.CResult_NoneSemanticErrorZ_ok(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_NoneSemanticErrorZ in the error state. - */ - public static Result_NoneSemanticErrorZ err(SemanticError e) { - long ret = bindings.CResult_NoneSemanticErrorZ_err(e); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_NoneSemanticErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_NoneSemanticErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_NoneSemanticErrorZ clone() { - long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_NoneSendErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneSendErrorZ.cs index cb4b7a10..c9ae6039 100644 --- a/c_sharp/src/org/ldk/structs/Result_NoneSendErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NoneSendErrorZ.cs @@ -51,6 +51,7 @@ public class Result_NoneSendErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs new file mode 100644 index 00000000..778fb0c2 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OfferBolt12ParseErrorZ : CommonBase { + Result_OfferBolt12ParseErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OfferBolt12ParseErrorZ() { + if (ptr != 0) { bindings.CResult_OfferBolt12ParseErrorZ_free(ptr); } + } + + internal static Result_OfferBolt12ParseErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OfferBolt12ParseErrorZ_is_ok(ptr)) { + return new Result_OfferBolt12ParseErrorZ_OK(null, ptr); + } else { + return new Result_OfferBolt12ParseErrorZ_Err(null, ptr); + } + } + public class Result_OfferBolt12ParseErrorZ_OK : Result_OfferBolt12ParseErrorZ { + public readonly Offer res; + internal Result_OfferBolt12ParseErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OfferBolt12ParseErrorZ_get_ok(ptr); + org.ldk.structs.Offer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Offer(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OfferBolt12ParseErrorZ_Err : Result_OfferBolt12ParseErrorZ { + public readonly Bolt12ParseError err; + internal Result_OfferBolt12ParseErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OfferBolt12ParseErrorZ_get_err(ptr); + org.ldk.structs.Bolt12ParseError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.Bolt12ParseError(null, err); } + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OfferBolt12ParseErrorZ in the success state. + */ + public static Result_OfferBolt12ParseErrorZ ok(org.ldk.structs.Offer o) { + long ret = bindings.CResult_OfferBolt12ParseErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OfferBolt12ParseErrorZ in the error state. + */ + public static Result_OfferBolt12ParseErrorZ err(org.ldk.structs.Bolt12ParseError e) { + long ret = bindings.CResult_OfferBolt12ParseErrorZ_err(e == null ? 0 : e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OfferBolt12ParseErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OfferBolt12ParseErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OfferBolt12ParseErrorZ clone() { + long ret = bindings.CResult_OfferBolt12ParseErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferFeaturesDecodeErrorZ.cs deleted file mode 100644 index cae667fd..00000000 --- a/c_sharp/src/org/ldk/structs/Result_OfferFeaturesDecodeErrorZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_OfferFeaturesDecodeErrorZ : CommonBase { - Result_OfferFeaturesDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_OfferFeaturesDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_OfferFeaturesDecodeErrorZ_free(ptr); } - } - - internal static Result_OfferFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_OfferFeaturesDecodeErrorZ_is_ok(ptr)) { - return new Result_OfferFeaturesDecodeErrorZ_OK(null, ptr); - } else { - return new Result_OfferFeaturesDecodeErrorZ_Err(null, ptr); - } - } - public class Result_OfferFeaturesDecodeErrorZ_OK : Result_OfferFeaturesDecodeErrorZ { - public readonly OfferFeatures res; - internal Result_OfferFeaturesDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_OfferFeaturesDecodeErrorZ_get_ok(ptr); - org.ldk.structs.OfferFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OfferFeatures(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_OfferFeaturesDecodeErrorZ_Err : Result_OfferFeaturesDecodeErrorZ { - public readonly DecodeError err; - internal Result_OfferFeaturesDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_OfferFeaturesDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_OfferFeaturesDecodeErrorZ in the success state. - */ - public static Result_OfferFeaturesDecodeErrorZ ok(org.ldk.structs.OfferFeatures o) { - long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_OfferFeaturesDecodeErrorZ in the error state. - */ - public static Result_OfferFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_OfferFeaturesDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_OfferFeaturesDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_OfferFeaturesDecodeErrorZ clone() { - long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OffersMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OffersMessageDecodeErrorZ.cs new file mode 100644 index 00000000..fc13b343 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OffersMessageDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OffersMessageDecodeErrorZ : CommonBase { + Result_OffersMessageDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OffersMessageDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OffersMessageDecodeErrorZ_free(ptr); } + } + + internal static Result_OffersMessageDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OffersMessageDecodeErrorZ_is_ok(ptr)) { + return new Result_OffersMessageDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OffersMessageDecodeErrorZ_Err(null, ptr); + } + } + public class Result_OffersMessageDecodeErrorZ_OK : Result_OffersMessageDecodeErrorZ { + public readonly OffersMessage res; + internal Result_OffersMessageDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OffersMessageDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OffersMessage res_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OffersMessageDecodeErrorZ_Err : Result_OffersMessageDecodeErrorZ { + public readonly DecodeError err; + internal Result_OffersMessageDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OffersMessageDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OffersMessageDecodeErrorZ in the success state. + */ + public static Result_OffersMessageDecodeErrorZ ok(org.ldk.structs.OffersMessage o) { + long ret = bindings.CResult_OffersMessageDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OffersMessageDecodeErrorZ in the error state. + */ + public static Result_OffersMessageDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OffersMessageDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OffersMessageDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OffersMessageDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OffersMessageDecodeErrorZ clone() { + long ret = bindings.CResult_OffersMessageDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OffersMessageDecodeErrorZ ret_hu_conv = Result_OffersMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs index db7e7fde..8dfa807c 100644 --- a/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_OnionMessageDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessageDecodeErrorZ ret_hu_conv = Result_OnionMessageDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs new file mode 100644 index 00000000..c435f160 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OnionMessagePathNoneZ : CommonBase { + Result_OnionMessagePathNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OnionMessagePathNoneZ() { + if (ptr != 0) { bindings.CResult_OnionMessagePathNoneZ_free(ptr); } + } + + internal static Result_OnionMessagePathNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_OnionMessagePathNoneZ_is_ok(ptr)) { + return new Result_OnionMessagePathNoneZ_OK(null, ptr); + } else { + return new Result_OnionMessagePathNoneZ_Err(null, ptr); + } + } + public class Result_OnionMessagePathNoneZ_OK : Result_OnionMessagePathNoneZ { + public readonly OnionMessagePath res; + internal Result_OnionMessagePathNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OnionMessagePathNoneZ_get_ok(ptr); + org.ldk.structs.OnionMessagePath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OnionMessagePath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OnionMessagePathNoneZ_Err : Result_OnionMessagePathNoneZ { + internal Result_OnionMessagePathNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_OnionMessagePathNoneZ in the success state. + */ + public static Result_OnionMessagePathNoneZ ok(org.ldk.structs.OnionMessagePath o) { + long ret = bindings.CResult_OnionMessagePathNoneZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OnionMessagePathNoneZ in the error state. + */ + public static Result_OnionMessagePathNoneZ err() { + long ret = bindings.CResult_OnionMessagePathNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OnionMessagePathNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OnionMessagePathNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OnionMessagePathNoneZ clone() { + long ret = bindings.CResult_OnionMessagePathNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs index 592ce3ff..955e37b6 100644 --- a/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_OpenChannelDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs new file mode 100644 index 00000000..10d7b4dc --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OpenChannelV2DecodeErrorZ : CommonBase { + Result_OpenChannelV2DecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OpenChannelV2DecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OpenChannelV2DecodeErrorZ_free(ptr); } + } + + internal static Result_OpenChannelV2DecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OpenChannelV2DecodeErrorZ_is_ok(ptr)) { + return new Result_OpenChannelV2DecodeErrorZ_OK(null, ptr); + } else { + return new Result_OpenChannelV2DecodeErrorZ_Err(null, ptr); + } + } + public class Result_OpenChannelV2DecodeErrorZ_OK : Result_OpenChannelV2DecodeErrorZ { + public readonly OpenChannelV2 res; + internal Result_OpenChannelV2DecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OpenChannelV2DecodeErrorZ_get_ok(ptr); + org.ldk.structs.OpenChannelV2 res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OpenChannelV2(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OpenChannelV2DecodeErrorZ_Err : Result_OpenChannelV2DecodeErrorZ { + public readonly DecodeError err; + internal Result_OpenChannelV2DecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OpenChannelV2DecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state. + */ + public static Result_OpenChannelV2DecodeErrorZ ok(org.ldk.structs.OpenChannelV2 o) { + long ret = bindings.CResult_OpenChannelV2DecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state. + */ + public static Result_OpenChannelV2DecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OpenChannelV2DecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OpenChannelV2DecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OpenChannelV2DecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OpenChannelV2DecodeErrorZ clone() { + long ret = bindings.CResult_OpenChannelV2DecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs index 70d29eaf..dac99c18 100644 --- a/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_OutPointDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PartiallySignedTransactionNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_PartiallySignedTransactionNoneZ.cs new file mode 100644 index 00000000..cf54d801 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_PartiallySignedTransactionNoneZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_PartiallySignedTransactionNoneZ : CommonBase { + Result_PartiallySignedTransactionNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_PartiallySignedTransactionNoneZ() { + if (ptr != 0) { bindings.CResult_PartiallySignedTransactionNoneZ_free(ptr); } + } + + internal static Result_PartiallySignedTransactionNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_PartiallySignedTransactionNoneZ_is_ok(ptr)) { + return new Result_PartiallySignedTransactionNoneZ_OK(null, ptr); + } else { + return new Result_PartiallySignedTransactionNoneZ_Err(null, ptr); + } + } + public class Result_PartiallySignedTransactionNoneZ_OK : Result_PartiallySignedTransactionNoneZ { + public readonly byte[] res; + internal Result_PartiallySignedTransactionNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + this.res = bindings.CResult_PartiallySignedTransactionNoneZ_get_ok(ptr); + } + } + + public class Result_PartiallySignedTransactionNoneZ_Err : Result_PartiallySignedTransactionNoneZ { + internal Result_PartiallySignedTransactionNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_PartiallySignedTransactionNoneZ in the success state. + */ + public static Result_PartiallySignedTransactionNoneZ ok(byte[] o) { + long ret = bindings.CResult_PartiallySignedTransactionNoneZ_ok(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PartiallySignedTransactionNoneZ ret_hu_conv = Result_PartiallySignedTransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PartiallySignedTransactionNoneZ in the error state. + */ + public static Result_PartiallySignedTransactionNoneZ err() { + long ret = bindings.CResult_PartiallySignedTransactionNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PartiallySignedTransactionNoneZ ret_hu_conv = Result_PartiallySignedTransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_PartiallySignedTransactionNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_PartiallySignedTransactionNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_PartiallySignedTransactionNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PartiallySignedTransactionNoneZ clone() { + long ret = bindings.CResult_PartiallySignedTransactionNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PartiallySignedTransactionNoneZ ret_hu_conv = Result_PartiallySignedTransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.cs new file mode 100644 index 00000000..433c819d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_PaymentFailureReasonDecodeErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_PaymentFailureReasonDecodeErrorZ : CommonBase { + Result_PaymentFailureReasonDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_PaymentFailureReasonDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_PaymentFailureReasonDecodeErrorZ_free(ptr); } + } + + internal static Result_PaymentFailureReasonDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_PaymentFailureReasonDecodeErrorZ_is_ok(ptr)) { + return new Result_PaymentFailureReasonDecodeErrorZ_OK(null, ptr); + } else { + return new Result_PaymentFailureReasonDecodeErrorZ_Err(null, ptr); + } + } + public class Result_PaymentFailureReasonDecodeErrorZ_OK : Result_PaymentFailureReasonDecodeErrorZ { + public readonly PaymentFailureReason res; + internal Result_PaymentFailureReasonDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + this.res = bindings.CResult_PaymentFailureReasonDecodeErrorZ_get_ok(ptr); + } + } + + public class Result_PaymentFailureReasonDecodeErrorZ_Err : Result_PaymentFailureReasonDecodeErrorZ { + public readonly DecodeError err; + internal Result_PaymentFailureReasonDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_PaymentFailureReasonDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state. + */ + public static Result_PaymentFailureReasonDecodeErrorZ ok(PaymentFailureReason o) { + long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_ok(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state. + */ + public static Result_PaymentFailureReasonDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PaymentFailureReasonDecodeErrorZ clone() { + long ret = bindings.CResult_PaymentFailureReasonDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentFailureReasonDecodeErrorZ ret_hu_conv = Result_PaymentFailureReasonDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.cs index f8ba63ca..49989fb1 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.cs @@ -54,6 +54,7 @@ public class Result_PaymentHashPaymentSendFailureZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentHashRetryableSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentHashRetryableSendFailureZ.cs new file mode 100644 index 00000000..a3a69ff7 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_PaymentHashRetryableSendFailureZ.cs @@ -0,0 +1,85 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_PaymentHashRetryableSendFailureZ : CommonBase { + Result_PaymentHashRetryableSendFailureZ(object _dummy, long ptr) : base(ptr) { } + ~Result_PaymentHashRetryableSendFailureZ() { + if (ptr != 0) { bindings.CResult_PaymentHashRetryableSendFailureZ_free(ptr); } + } + + internal static Result_PaymentHashRetryableSendFailureZ constr_from_ptr(long ptr) { + if (bindings.CResult_PaymentHashRetryableSendFailureZ_is_ok(ptr)) { + return new Result_PaymentHashRetryableSendFailureZ_OK(null, ptr); + } else { + return new Result_PaymentHashRetryableSendFailureZ_Err(null, ptr); + } + } + public class Result_PaymentHashRetryableSendFailureZ_OK : Result_PaymentHashRetryableSendFailureZ { + public readonly byte[] res; + internal Result_PaymentHashRetryableSendFailureZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + this.res = bindings.CResult_PaymentHashRetryableSendFailureZ_get_ok(ptr); + } + } + + public class Result_PaymentHashRetryableSendFailureZ_Err : Result_PaymentHashRetryableSendFailureZ { + public readonly RetryableSendFailure err; + internal Result_PaymentHashRetryableSendFailureZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_PaymentHashRetryableSendFailureZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_PaymentHashRetryableSendFailureZ in the success state. + */ + public static Result_PaymentHashRetryableSendFailureZ ok(byte[] o) { + long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_ok(InternalUtils.check_arr_len(o, 32)); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PaymentHashRetryableSendFailureZ in the error state. + */ + public static Result_PaymentHashRetryableSendFailureZ err(RetryableSendFailure e) { + long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_PaymentHashRetryableSendFailureZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_PaymentHashRetryableSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PaymentHashRetryableSendFailureZ clone() { + long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentIdPaymentErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentIdPaymentErrorZ.cs index 99e4a576..1acf00d6 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentIdPaymentErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentIdPaymentErrorZ.cs @@ -54,6 +54,7 @@ public class Result_PaymentIdPaymentErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs index 661a7df1..4d9eb90c 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_PaymentParametersDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.cs index d0dc23c9..c3d1a279 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.cs @@ -54,6 +54,7 @@ public class Result_PaymentPreimageAPIErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs index 3c6d0198..f4ab8b26 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_PaymentPurposeDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_PaymentPurposeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentSecretAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentSecretAPIErrorZ.cs deleted file mode 100644 index 21d8e1f5..00000000 --- a/c_sharp/src/org/ldk/structs/Result_PaymentSecretAPIErrorZ.cs +++ /dev/null @@ -1,88 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_PaymentSecretAPIErrorZ : CommonBase { - Result_PaymentSecretAPIErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_PaymentSecretAPIErrorZ() { - if (ptr != 0) { bindings.CResult_PaymentSecretAPIErrorZ_free(ptr); } - } - - internal static Result_PaymentSecretAPIErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_PaymentSecretAPIErrorZ_is_ok(ptr)) { - return new Result_PaymentSecretAPIErrorZ_OK(null, ptr); - } else { - return new Result_PaymentSecretAPIErrorZ_Err(null, ptr); - } - } - public class Result_PaymentSecretAPIErrorZ_OK : Result_PaymentSecretAPIErrorZ { - public readonly byte[] res; - internal Result_PaymentSecretAPIErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - this.res = bindings.CResult_PaymentSecretAPIErrorZ_get_ok(ptr); - } - } - - public class Result_PaymentSecretAPIErrorZ_Err : Result_PaymentSecretAPIErrorZ { - public readonly APIError err; - internal Result_PaymentSecretAPIErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_PaymentSecretAPIErrorZ_get_err(ptr); - org.ldk.structs.APIError err_hu_conv = org.ldk.structs.APIError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_PaymentSecretAPIErrorZ in the success state. - */ - public static Result_PaymentSecretAPIErrorZ ok(byte[] o) { - long ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(InternalUtils.check_arr_len(o, 32)); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_PaymentSecretAPIErrorZ in the error state. - */ - public static Result_PaymentSecretAPIErrorZ err(org.ldk.structs.APIError e) { - long ret = bindings.CResult_PaymentSecretAPIErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_PaymentSecretAPIErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_PaymentSecretAPIErrorZ clone() { - long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs index 76bfda75..3999a2ca 100644 --- a/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_PhantomRouteHintsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PhantomRouteHintsDecodeErrorZ ret_hu_conv = Result_PhantomRouteHintsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs index 61d88b49..5fb56b9d 100644 --- a/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_PingDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs index 90a8d1d8..0775c310 100644 --- a/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_PongDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs index aed87936..2bed5dd2 100644 --- a/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs @@ -41,14 +41,14 @@ public class Result_ProbabilisticScorerDecodeErrorZ : CommonBase { /** * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state. */ - public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringParameters o_params, NetworkGraph o_network_graph, Logger o_logger) { - long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0 : o_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger == null ? 0 : o_logger.ptr)); - GC.KeepAlive(o_params); + public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringDecayParameters o_decay_params, NetworkGraph o_network_graph, Logger o_logger) { + long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_decay_params == null ? 0 : o_decay_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger.ptr)); + GC.KeepAlive(o_decay_params); GC.KeepAlive(o_network_graph); GC.KeepAlive(o_logger); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_params); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_decay_params); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_network_graph); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_logger); }; return ret_hu_conv; @@ -62,6 +62,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs index 0fb34cc5..e1186107 100644 --- a/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_QueryChannelRangeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs index 8ccc6f74..2f300397 100644 --- a/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs new file mode 100644 index 00000000..fdc4db80 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_RecipientOnionFieldsDecodeErrorZ : CommonBase { + Result_RecipientOnionFieldsDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_RecipientOnionFieldsDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_RecipientOnionFieldsDecodeErrorZ_free(ptr); } + } + + internal static Result_RecipientOnionFieldsDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(ptr)) { + return new Result_RecipientOnionFieldsDecodeErrorZ_OK(null, ptr); + } else { + return new Result_RecipientOnionFieldsDecodeErrorZ_Err(null, ptr); + } + } + public class Result_RecipientOnionFieldsDecodeErrorZ_OK : Result_RecipientOnionFieldsDecodeErrorZ { + public readonly RecipientOnionFields res; + internal Result_RecipientOnionFieldsDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_get_ok(ptr); + org.ldk.structs.RecipientOnionFields res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RecipientOnionFields(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_RecipientOnionFieldsDecodeErrorZ_Err : Result_RecipientOnionFieldsDecodeErrorZ { + public readonly DecodeError err; + internal Result_RecipientOnionFieldsDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state. + */ + public static Result_RecipientOnionFieldsDecodeErrorZ ok(org.ldk.structs.RecipientOnionFields o) { + long ret = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state. + */ + public static Result_RecipientOnionFieldsDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RecipientOnionFieldsDecodeErrorZ clone() { + long ret = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs new file mode 100644 index 00000000..56760a92 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_RefundBolt12ParseErrorZ : CommonBase { + Result_RefundBolt12ParseErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_RefundBolt12ParseErrorZ() { + if (ptr != 0) { bindings.CResult_RefundBolt12ParseErrorZ_free(ptr); } + } + + internal static Result_RefundBolt12ParseErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_RefundBolt12ParseErrorZ_is_ok(ptr)) { + return new Result_RefundBolt12ParseErrorZ_OK(null, ptr); + } else { + return new Result_RefundBolt12ParseErrorZ_Err(null, ptr); + } + } + public class Result_RefundBolt12ParseErrorZ_OK : Result_RefundBolt12ParseErrorZ { + public readonly Refund res; + internal Result_RefundBolt12ParseErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_RefundBolt12ParseErrorZ_get_ok(ptr); + org.ldk.structs.Refund res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Refund(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_RefundBolt12ParseErrorZ_Err : Result_RefundBolt12ParseErrorZ { + public readonly Bolt12ParseError err; + internal Result_RefundBolt12ParseErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_RefundBolt12ParseErrorZ_get_err(ptr); + org.ldk.structs.Bolt12ParseError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.Bolt12ParseError(null, err); } + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_RefundBolt12ParseErrorZ in the success state. + */ + public static Result_RefundBolt12ParseErrorZ ok(org.ldk.structs.Refund o) { + long ret = bindings.CResult_RefundBolt12ParseErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_RefundBolt12ParseErrorZ in the error state. + */ + public static Result_RefundBolt12ParseErrorZ err(org.ldk.structs.Bolt12ParseError e) { + long ret = bindings.CResult_RefundBolt12ParseErrorZ_err(e == null ? 0 : e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_RefundBolt12ParseErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_RefundBolt12ParseErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RefundBolt12ParseErrorZ clone() { + long ret = bindings.CResult_RefundBolt12ParseErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs index 3e6d5465..d2bd98a7 100644 --- a/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs index 8cb489e5..57cb7f02 100644 --- a/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs index 0dca592a..aa178bde 100644 --- a/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_RevokeAndACKDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs index c50bc563..9a406663 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_RouteDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs index c33f47f1..068fc557 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_RouteHintDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs index c4865f1a..99be1f7a 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_RouteHintHopDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs index c6a3a2cf..caee5cf4 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_RouteHopDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs index 247b6ca4..c7fe06d0 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_RouteParametersDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs index e9202210..4009919a 100644 --- a/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_RoutingFeesDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ScriptNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_ScriptNoneZ.cs new file mode 100644 index 00000000..0d3637da --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_ScriptNoneZ.cs @@ -0,0 +1,82 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_ScriptNoneZ : CommonBase { + Result_ScriptNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_ScriptNoneZ() { + if (ptr != 0) { bindings.CResult_ScriptNoneZ_free(ptr); } + } + + internal static Result_ScriptNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_ScriptNoneZ_is_ok(ptr)) { + return new Result_ScriptNoneZ_OK(null, ptr); + } else { + return new Result_ScriptNoneZ_Err(null, ptr); + } + } + public class Result_ScriptNoneZ_OK : Result_ScriptNoneZ { + public readonly byte[] res; + internal Result_ScriptNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + this.res = bindings.CResult_ScriptNoneZ_get_ok(ptr); + } + } + + public class Result_ScriptNoneZ_Err : Result_ScriptNoneZ { + internal Result_ScriptNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_ScriptNoneZ in the success state. + */ + public static Result_ScriptNoneZ ok(byte[] o) { + long ret = bindings.CResult_ScriptNoneZ_ok(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScriptNoneZ ret_hu_conv = Result_ScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ScriptNoneZ in the error state. + */ + public static Result_ScriptNoneZ err() { + long ret = bindings.CResult_ScriptNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScriptNoneZ ret_hu_conv = Result_ScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_ScriptNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_ScriptNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_ScriptNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ScriptNoneZ clone() { + long ret = bindings.CResult_ScriptNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScriptNoneZ ret_hu_conv = Result_ScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SecretKeyNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_SecretKeyNoneZ.cs deleted file mode 100644 index 5d8a57e8..00000000 --- a/c_sharp/src/org/ldk/structs/Result_SecretKeyNoneZ.cs +++ /dev/null @@ -1,82 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_SecretKeyNoneZ : CommonBase { - Result_SecretKeyNoneZ(object _dummy, long ptr) : base(ptr) { } - ~Result_SecretKeyNoneZ() { - if (ptr != 0) { bindings.CResult_SecretKeyNoneZ_free(ptr); } - } - - internal static Result_SecretKeyNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_SecretKeyNoneZ_is_ok(ptr)) { - return new Result_SecretKeyNoneZ_OK(null, ptr); - } else { - return new Result_SecretKeyNoneZ_Err(null, ptr); - } - } - public class Result_SecretKeyNoneZ_OK : Result_SecretKeyNoneZ { - public readonly byte[] res; - internal Result_SecretKeyNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - this.res = bindings.CResult_SecretKeyNoneZ_get_ok(ptr); - } - } - - public class Result_SecretKeyNoneZ_Err : Result_SecretKeyNoneZ { - internal Result_SecretKeyNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - } - } - - /** - * Creates a new CResult_SecretKeyNoneZ in the success state. - */ - public static Result_SecretKeyNoneZ ok(byte[] o) { - long ret = bindings.CResult_SecretKeyNoneZ_ok(InternalUtils.check_arr_len(o, 32)); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyNoneZ ret_hu_conv = Result_SecretKeyNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_SecretKeyNoneZ in the error state. - */ - public static Result_SecretKeyNoneZ err() { - long ret = bindings.CResult_SecretKeyNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyNoneZ ret_hu_conv = Result_SecretKeyNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_SecretKeyNoneZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_SecretKeyNoneZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_SecretKeyNoneZ clone() { - long ret = bindings.CResult_SecretKeyNoneZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyNoneZ ret_hu_conv = Result_SecretKeyNoneZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs index 2df78c1b..6624e31f 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ShutdownDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs index 69953a53..27612b9a 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_ShutdownScriptDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs new file mode 100644 index 00000000..e65cec4d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_ShutdownScriptNoneZ : CommonBase { + Result_ShutdownScriptNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_ShutdownScriptNoneZ() { + if (ptr != 0) { bindings.CResult_ShutdownScriptNoneZ_free(ptr); } + } + + internal static Result_ShutdownScriptNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_ShutdownScriptNoneZ_is_ok(ptr)) { + return new Result_ShutdownScriptNoneZ_OK(null, ptr); + } else { + return new Result_ShutdownScriptNoneZ_Err(null, ptr); + } + } + public class Result_ShutdownScriptNoneZ_OK : Result_ShutdownScriptNoneZ { + public readonly ShutdownScript res; + internal Result_ShutdownScriptNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_ShutdownScriptNoneZ_get_ok(ptr); + org.ldk.structs.ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ShutdownScript(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_ShutdownScriptNoneZ_Err : Result_ShutdownScriptNoneZ { + internal Result_ShutdownScriptNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_ShutdownScriptNoneZ in the success state. + */ + public static Result_ShutdownScriptNoneZ ok(org.ldk.structs.ShutdownScript o) { + long ret = bindings.CResult_ShutdownScriptNoneZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ShutdownScriptNoneZ ret_hu_conv = Result_ShutdownScriptNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_ShutdownScriptNoneZ in the error state. + */ + public static Result_ShutdownScriptNoneZ err() { + long ret = bindings.CResult_ShutdownScriptNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ShutdownScriptNoneZ ret_hu_conv = Result_ShutdownScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_ShutdownScriptNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_ShutdownScriptNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ShutdownScriptNoneZ clone() { + long ret = bindings.CResult_ShutdownScriptNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ShutdownScriptNoneZ ret_hu_conv = Result_ShutdownScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.cs new file mode 100644 index 00000000..442c71b6 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_SiPrefixBolt11ParseErrorZ : CommonBase { + Result_SiPrefixBolt11ParseErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_SiPrefixBolt11ParseErrorZ() { + if (ptr != 0) { bindings.CResult_SiPrefixBolt11ParseErrorZ_free(ptr); } + } + + internal static Result_SiPrefixBolt11ParseErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_SiPrefixBolt11ParseErrorZ_is_ok(ptr)) { + return new Result_SiPrefixBolt11ParseErrorZ_OK(null, ptr); + } else { + return new Result_SiPrefixBolt11ParseErrorZ_Err(null, ptr); + } + } + public class Result_SiPrefixBolt11ParseErrorZ_OK : Result_SiPrefixBolt11ParseErrorZ { + public readonly SiPrefix res; + internal Result_SiPrefixBolt11ParseErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + this.res = bindings.CResult_SiPrefixBolt11ParseErrorZ_get_ok(ptr); + } + } + + public class Result_SiPrefixBolt11ParseErrorZ_Err : Result_SiPrefixBolt11ParseErrorZ { + public readonly Bolt11ParseError err; + internal Result_SiPrefixBolt11ParseErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_SiPrefixBolt11ParseErrorZ_get_err(ptr); + org.ldk.structs.Bolt11ParseError err_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state. + */ + public static Result_SiPrefixBolt11ParseErrorZ ok(SiPrefix o) { + long ret = bindings.CResult_SiPrefixBolt11ParseErrorZ_ok(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SiPrefixBolt11ParseErrorZ ret_hu_conv = Result_SiPrefixBolt11ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state. + */ + public static Result_SiPrefixBolt11ParseErrorZ err(org.ldk.structs.Bolt11ParseError e) { + long ret = bindings.CResult_SiPrefixBolt11ParseErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SiPrefixBolt11ParseErrorZ ret_hu_conv = Result_SiPrefixBolt11ParseErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_SiPrefixBolt11ParseErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SiPrefixBolt11ParseErrorZ clone() { + long ret = bindings.CResult_SiPrefixBolt11ParseErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SiPrefixBolt11ParseErrorZ ret_hu_conv = Result_SiPrefixBolt11ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SiPrefixParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SiPrefixParseErrorZ.cs deleted file mode 100644 index 9d8d6115..00000000 --- a/c_sharp/src/org/ldk/structs/Result_SiPrefixParseErrorZ.cs +++ /dev/null @@ -1,88 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_SiPrefixParseErrorZ : CommonBase { - Result_SiPrefixParseErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_SiPrefixParseErrorZ() { - if (ptr != 0) { bindings.CResult_SiPrefixParseErrorZ_free(ptr); } - } - - internal static Result_SiPrefixParseErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_SiPrefixParseErrorZ_is_ok(ptr)) { - return new Result_SiPrefixParseErrorZ_OK(null, ptr); - } else { - return new Result_SiPrefixParseErrorZ_Err(null, ptr); - } - } - public class Result_SiPrefixParseErrorZ_OK : Result_SiPrefixParseErrorZ { - public readonly SiPrefix res; - internal Result_SiPrefixParseErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - this.res = bindings.CResult_SiPrefixParseErrorZ_get_ok(ptr); - } - } - - public class Result_SiPrefixParseErrorZ_Err : Result_SiPrefixParseErrorZ { - public readonly ParseError err; - internal Result_SiPrefixParseErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_SiPrefixParseErrorZ_get_err(ptr); - org.ldk.structs.ParseError err_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_SiPrefixParseErrorZ in the success state. - */ - public static Result_SiPrefixParseErrorZ ok(SiPrefix o) { - long ret = bindings.CResult_SiPrefixParseErrorZ_ok(o); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SiPrefixParseErrorZ ret_hu_conv = Result_SiPrefixParseErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_SiPrefixParseErrorZ in the error state. - */ - public static Result_SiPrefixParseErrorZ err(org.ldk.structs.ParseError e) { - long ret = bindings.CResult_SiPrefixParseErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SiPrefixParseErrorZ ret_hu_conv = Result_SiPrefixParseErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_SiPrefixParseErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_SiPrefixParseErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_SiPrefixParseErrorZ clone() { - long ret = bindings.CResult_SiPrefixParseErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SiPrefixParseErrorZ ret_hu_conv = Result_SiPrefixParseErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SignDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SignDecodeErrorZ.cs deleted file mode 100644 index 82b3ee8e..00000000 --- a/c_sharp/src/org/ldk/structs/Result_SignDecodeErrorZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_SignDecodeErrorZ : CommonBase { - Result_SignDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_SignDecodeErrorZ() { - if (ptr != 0) { bindings.CResult_SignDecodeErrorZ_free(ptr); } - } - - internal static Result_SignDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_SignDecodeErrorZ_is_ok(ptr)) { - return new Result_SignDecodeErrorZ_OK(null, ptr); - } else { - return new Result_SignDecodeErrorZ_Err(null, ptr); - } - } - public class Result_SignDecodeErrorZ_OK : Result_SignDecodeErrorZ { - public readonly Sign res; - internal Result_SignDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_SignDecodeErrorZ_get_ok(ptr); - Sign ret_hu_conv = new Sign(null, res); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - this.res = ret_hu_conv; - } - } - - public class Result_SignDecodeErrorZ_Err : Result_SignDecodeErrorZ { - public readonly DecodeError err; - internal Result_SignDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_SignDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_SignDecodeErrorZ in the success state. - */ - public static Result_SignDecodeErrorZ ok(org.ldk.structs.Sign o) { - long ret = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_SignDecodeErrorZ in the error state. - */ - public static Result_SignDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_SignDecodeErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_SignDecodeErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_SignDecodeErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_SignDecodeErrorZ clone() { - long ret = bindings.CResult_SignDecodeErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs new file mode 100644 index 00000000..4a811333 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ : CommonBase { + Result_SignedRawBolt11InvoiceBolt11ParseErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_SignedRawBolt11InvoiceBolt11ParseErrorZ() { + if (ptr != 0) { bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(ptr); } + } + + internal static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(ptr)) { + return new Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_OK(null, ptr); + } else { + return new Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_Err(null, ptr); + } + } + public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_OK : Result_SignedRawBolt11InvoiceBolt11ParseErrorZ { + public readonly SignedRawBolt11Invoice res; + internal Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_ok(ptr); + org.ldk.structs.SignedRawBolt11Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.SignedRawBolt11Invoice(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_Err : Result_SignedRawBolt11InvoiceBolt11ParseErrorZ { + public readonly Bolt11ParseError err; + internal Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(ptr); + org.ldk.structs.Bolt11ParseError err_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state. + */ + public static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ok(org.ldk.structs.SignedRawBolt11Invoice o) { + long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state. + */ + public static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ err(org.ldk.structs.Bolt11ParseError e) { + long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SignedRawBolt11InvoiceBolt11ParseErrorZ clone() { + long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.cs deleted file mode 100644 index da6865ee..00000000 --- a/c_sharp/src/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.cs +++ /dev/null @@ -1,92 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_SignedRawInvoiceParseErrorZ : CommonBase { - Result_SignedRawInvoiceParseErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_SignedRawInvoiceParseErrorZ() { - if (ptr != 0) { bindings.CResult_SignedRawInvoiceParseErrorZ_free(ptr); } - } - - internal static Result_SignedRawInvoiceParseErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_SignedRawInvoiceParseErrorZ_is_ok(ptr)) { - return new Result_SignedRawInvoiceParseErrorZ_OK(null, ptr); - } else { - return new Result_SignedRawInvoiceParseErrorZ_Err(null, ptr); - } - } - public class Result_SignedRawInvoiceParseErrorZ_OK : Result_SignedRawInvoiceParseErrorZ { - public readonly SignedRawInvoice res; - internal Result_SignedRawInvoiceParseErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_SignedRawInvoiceParseErrorZ_get_ok(ptr); - org.ldk.structs.SignedRawInvoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.SignedRawInvoice(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; - this.res = res_hu_conv; - } - } - - public class Result_SignedRawInvoiceParseErrorZ_Err : Result_SignedRawInvoiceParseErrorZ { - public readonly ParseError err; - internal Result_SignedRawInvoiceParseErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - long err = bindings.CResult_SignedRawInvoiceParseErrorZ_get_err(ptr); - org.ldk.structs.ParseError err_hu_conv = org.ldk.structs.ParseError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state. - */ - public static Result_SignedRawInvoiceParseErrorZ ok(org.ldk.structs.SignedRawInvoice o) { - long ret = bindings.CResult_SignedRawInvoiceParseErrorZ_ok(o == null ? 0 : o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignedRawInvoiceParseErrorZ ret_hu_conv = Result_SignedRawInvoiceParseErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state. - */ - public static Result_SignedRawInvoiceParseErrorZ err(org.ldk.structs.ParseError e) { - long ret = bindings.CResult_SignedRawInvoiceParseErrorZ_err(e.ptr); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignedRawInvoiceParseErrorZ ret_hu_conv = Result_SignedRawInvoiceParseErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_SignedRawInvoiceParseErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_SignedRawInvoiceParseErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_SignedRawInvoiceParseErrorZ clone() { - long ret = bindings.CResult_SignedRawInvoiceParseErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignedRawInvoiceParseErrorZ ret_hu_conv = Result_SignedRawInvoiceParseErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs index b0bc1e8f..a04b460c 100644 --- a/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.cs @@ -46,6 +46,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; return ret_hu_conv; } @@ -57,6 +58,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs index d8613ab4..571cb1c0 100644 --- a/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs new file mode 100644 index 00000000..56e43b62 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TransactionU16LenLimitedDecodeErrorZ : CommonBase { + Result_TransactionU16LenLimitedDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TransactionU16LenLimitedDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_free(ptr); } + } + + internal static Result_TransactionU16LenLimitedDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(ptr)) { + return new Result_TransactionU16LenLimitedDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TransactionU16LenLimitedDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TransactionU16LenLimitedDecodeErrorZ_OK : Result_TransactionU16LenLimitedDecodeErrorZ { + public readonly TransactionU16LenLimited res; + internal Result_TransactionU16LenLimitedDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TransactionU16LenLimited res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TransactionU16LenLimited(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TransactionU16LenLimitedDecodeErrorZ_Err : Result_TransactionU16LenLimitedDecodeErrorZ { + public readonly DecodeError err; + internal Result_TransactionU16LenLimitedDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state. + */ + public static Result_TransactionU16LenLimitedDecodeErrorZ ok(org.ldk.structs.TransactionU16LenLimited o) { + long ret = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state. + */ + public static Result_TransactionU16LenLimitedDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TransactionU16LenLimitedDecodeErrorZ clone() { + long ret = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs new file mode 100644 index 00000000..543245c1 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TransactionU16LenLimitedNoneZ : CommonBase { + Result_TransactionU16LenLimitedNoneZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TransactionU16LenLimitedNoneZ() { + if (ptr != 0) { bindings.CResult_TransactionU16LenLimitedNoneZ_free(ptr); } + } + + internal static Result_TransactionU16LenLimitedNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_TransactionU16LenLimitedNoneZ_is_ok(ptr)) { + return new Result_TransactionU16LenLimitedNoneZ_OK(null, ptr); + } else { + return new Result_TransactionU16LenLimitedNoneZ_Err(null, ptr); + } + } + public class Result_TransactionU16LenLimitedNoneZ_OK : Result_TransactionU16LenLimitedNoneZ { + public readonly TransactionU16LenLimited res; + internal Result_TransactionU16LenLimitedNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TransactionU16LenLimitedNoneZ_get_ok(ptr); + org.ldk.structs.TransactionU16LenLimited res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TransactionU16LenLimited(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TransactionU16LenLimitedNoneZ_Err : Result_TransactionU16LenLimitedNoneZ { + internal Result_TransactionU16LenLimitedNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + } + } + + /** + * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state. + */ + public static Result_TransactionU16LenLimitedNoneZ ok(org.ldk.structs.TransactionU16LenLimited o) { + long ret = bindings.CResult_TransactionU16LenLimitedNoneZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedNoneZ ret_hu_conv = Result_TransactionU16LenLimitedNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state. + */ + public static Result_TransactionU16LenLimitedNoneZ err() { + long ret = bindings.CResult_TransactionU16LenLimitedNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedNoneZ ret_hu_conv = Result_TransactionU16LenLimitedNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TransactionU16LenLimitedNoneZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TransactionU16LenLimitedNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TransactionU16LenLimitedNoneZ clone() { + long ret = bindings.CResult_TransactionU16LenLimitedNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedNoneZ ret_hu_conv = Result_TransactionU16LenLimitedNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs new file mode 100644 index 00000000..ce64c3a6 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxAbortDecodeErrorZ : CommonBase { + Result_TxAbortDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxAbortDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxAbortDecodeErrorZ_free(ptr); } + } + + internal static Result_TxAbortDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxAbortDecodeErrorZ_is_ok(ptr)) { + return new Result_TxAbortDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxAbortDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxAbortDecodeErrorZ_OK : Result_TxAbortDecodeErrorZ { + public readonly TxAbort res; + internal Result_TxAbortDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxAbortDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxAbort res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxAbort(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxAbortDecodeErrorZ_Err : Result_TxAbortDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxAbortDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxAbortDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxAbortDecodeErrorZ in the success state. + */ + public static Result_TxAbortDecodeErrorZ ok(org.ldk.structs.TxAbort o) { + long ret = bindings.CResult_TxAbortDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxAbortDecodeErrorZ in the error state. + */ + public static Result_TxAbortDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxAbortDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxAbortDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxAbortDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxAbortDecodeErrorZ clone() { + long ret = bindings.CResult_TxAbortDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs new file mode 100644 index 00000000..e7bfd344 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxAckRbfDecodeErrorZ : CommonBase { + Result_TxAckRbfDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxAckRbfDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxAckRbfDecodeErrorZ_free(ptr); } + } + + internal static Result_TxAckRbfDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxAckRbfDecodeErrorZ_is_ok(ptr)) { + return new Result_TxAckRbfDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxAckRbfDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxAckRbfDecodeErrorZ_OK : Result_TxAckRbfDecodeErrorZ { + public readonly TxAckRbf res; + internal Result_TxAckRbfDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxAckRbfDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxAckRbf res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxAckRbf(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxAckRbfDecodeErrorZ_Err : Result_TxAckRbfDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxAckRbfDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxAckRbfDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state. + */ + public static Result_TxAckRbfDecodeErrorZ ok(org.ldk.structs.TxAckRbf o) { + long ret = bindings.CResult_TxAckRbfDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state. + */ + public static Result_TxAckRbfDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxAckRbfDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxAckRbfDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxAckRbfDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxAckRbfDecodeErrorZ clone() { + long ret = bindings.CResult_TxAckRbfDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs new file mode 100644 index 00000000..12b30f31 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxAddInputDecodeErrorZ : CommonBase { + Result_TxAddInputDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxAddInputDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxAddInputDecodeErrorZ_free(ptr); } + } + + internal static Result_TxAddInputDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxAddInputDecodeErrorZ_is_ok(ptr)) { + return new Result_TxAddInputDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxAddInputDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxAddInputDecodeErrorZ_OK : Result_TxAddInputDecodeErrorZ { + public readonly TxAddInput res; + internal Result_TxAddInputDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxAddInputDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxAddInput res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxAddInput(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxAddInputDecodeErrorZ_Err : Result_TxAddInputDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxAddInputDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxAddInputDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxAddInputDecodeErrorZ in the success state. + */ + public static Result_TxAddInputDecodeErrorZ ok(org.ldk.structs.TxAddInput o) { + long ret = bindings.CResult_TxAddInputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxAddInputDecodeErrorZ in the error state. + */ + public static Result_TxAddInputDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxAddInputDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxAddInputDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxAddInputDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxAddInputDecodeErrorZ clone() { + long ret = bindings.CResult_TxAddInputDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs new file mode 100644 index 00000000..90cbe9dc --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxAddOutputDecodeErrorZ : CommonBase { + Result_TxAddOutputDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxAddOutputDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxAddOutputDecodeErrorZ_free(ptr); } + } + + internal static Result_TxAddOutputDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxAddOutputDecodeErrorZ_is_ok(ptr)) { + return new Result_TxAddOutputDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxAddOutputDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxAddOutputDecodeErrorZ_OK : Result_TxAddOutputDecodeErrorZ { + public readonly TxAddOutput res; + internal Result_TxAddOutputDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxAddOutputDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxAddOutput res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxAddOutput(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxAddOutputDecodeErrorZ_Err : Result_TxAddOutputDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxAddOutputDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxAddOutputDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state. + */ + public static Result_TxAddOutputDecodeErrorZ ok(org.ldk.structs.TxAddOutput o) { + long ret = bindings.CResult_TxAddOutputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state. + */ + public static Result_TxAddOutputDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxAddOutputDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxAddOutputDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxAddOutputDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxAddOutputDecodeErrorZ clone() { + long ret = bindings.CResult_TxAddOutputDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs new file mode 100644 index 00000000..1ed6321d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxCompleteDecodeErrorZ : CommonBase { + Result_TxCompleteDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxCompleteDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxCompleteDecodeErrorZ_free(ptr); } + } + + internal static Result_TxCompleteDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxCompleteDecodeErrorZ_is_ok(ptr)) { + return new Result_TxCompleteDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxCompleteDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxCompleteDecodeErrorZ_OK : Result_TxCompleteDecodeErrorZ { + public readonly TxComplete res; + internal Result_TxCompleteDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxCompleteDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxComplete res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxComplete(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxCompleteDecodeErrorZ_Err : Result_TxCompleteDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxCompleteDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxCompleteDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxCompleteDecodeErrorZ in the success state. + */ + public static Result_TxCompleteDecodeErrorZ ok(org.ldk.structs.TxComplete o) { + long ret = bindings.CResult_TxCompleteDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxCompleteDecodeErrorZ in the error state. + */ + public static Result_TxCompleteDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxCompleteDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxCompleteDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxCompleteDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxCompleteDecodeErrorZ clone() { + long ret = bindings.CResult_TxCompleteDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs index de6ca5ab..5d7a8153 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_TxCreationKeysDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs new file mode 100644 index 00000000..53010fd2 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxInitRbfDecodeErrorZ : CommonBase { + Result_TxInitRbfDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxInitRbfDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxInitRbfDecodeErrorZ_free(ptr); } + } + + internal static Result_TxInitRbfDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxInitRbfDecodeErrorZ_is_ok(ptr)) { + return new Result_TxInitRbfDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxInitRbfDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxInitRbfDecodeErrorZ_OK : Result_TxInitRbfDecodeErrorZ { + public readonly TxInitRbf res; + internal Result_TxInitRbfDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxInitRbfDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxInitRbf res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxInitRbf(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxInitRbfDecodeErrorZ_Err : Result_TxInitRbfDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxInitRbfDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxInitRbfDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state. + */ + public static Result_TxInitRbfDecodeErrorZ ok(org.ldk.structs.TxInitRbf o) { + long ret = bindings.CResult_TxInitRbfDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state. + */ + public static Result_TxInitRbfDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxInitRbfDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxInitRbfDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxInitRbfDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxInitRbfDecodeErrorZ clone() { + long ret = bindings.CResult_TxInitRbfDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxOutAccessErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxOutAccessErrorZ.cs deleted file mode 100644 index 9ae0c9d5..00000000 --- a/c_sharp/src/org/ldk/structs/Result_TxOutAccessErrorZ.cs +++ /dev/null @@ -1,87 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -public class Result_TxOutAccessErrorZ : CommonBase { - Result_TxOutAccessErrorZ(object _dummy, long ptr) : base(ptr) { } - ~Result_TxOutAccessErrorZ() { - if (ptr != 0) { bindings.CResult_TxOutAccessErrorZ_free(ptr); } - } - - internal static Result_TxOutAccessErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_TxOutAccessErrorZ_is_ok(ptr)) { - return new Result_TxOutAccessErrorZ_OK(null, ptr); - } else { - return new Result_TxOutAccessErrorZ_Err(null, ptr); - } - } - public class Result_TxOutAccessErrorZ_OK : Result_TxOutAccessErrorZ { - public readonly TxOut res; - internal Result_TxOutAccessErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { - long res = bindings.CResult_TxOutAccessErrorZ_get_ok(ptr); - TxOut res_conv = new TxOut(null, res); - this.res = res_conv; - } - } - - public class Result_TxOutAccessErrorZ_Err : Result_TxOutAccessErrorZ { - public readonly AccessError err; - internal Result_TxOutAccessErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { - this.err = bindings.CResult_TxOutAccessErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_TxOutAccessErrorZ in the success state. - */ - public static Result_TxOutAccessErrorZ ok(org.ldk.structs.TxOut o) { - long ret = bindings.CResult_TxOutAccessErrorZ_ok(o.ptr); - GC.KeepAlive(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_TxOutAccessErrorZ in the error state. - */ - public static Result_TxOutAccessErrorZ err(AccessError e) { - long ret = bindings.CResult_TxOutAccessErrorZ_err(e); - GC.KeepAlive(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the given object is currently in the success state - */ - public bool is_ok() { - bool ret = bindings.CResult_TxOutAccessErrorZ_is_ok(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.CResult_TxOutAccessErrorZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_TxOutAccessErrorZ clone() { - long ret = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxOutUtxoLookupErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxOutUtxoLookupErrorZ.cs new file mode 100644 index 00000000..0d96b9f7 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxOutUtxoLookupErrorZ.cs @@ -0,0 +1,87 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxOutUtxoLookupErrorZ : CommonBase { + Result_TxOutUtxoLookupErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxOutUtxoLookupErrorZ() { + if (ptr != 0) { bindings.CResult_TxOutUtxoLookupErrorZ_free(ptr); } + } + + internal static Result_TxOutUtxoLookupErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxOutUtxoLookupErrorZ_is_ok(ptr)) { + return new Result_TxOutUtxoLookupErrorZ_OK(null, ptr); + } else { + return new Result_TxOutUtxoLookupErrorZ_Err(null, ptr); + } + } + public class Result_TxOutUtxoLookupErrorZ_OK : Result_TxOutUtxoLookupErrorZ { + public readonly TxOut res; + internal Result_TxOutUtxoLookupErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxOutUtxoLookupErrorZ_get_ok(ptr); + TxOut res_conv = new TxOut(null, res); + this.res = res_conv; + } + } + + public class Result_TxOutUtxoLookupErrorZ_Err : Result_TxOutUtxoLookupErrorZ { + public readonly UtxoLookupError err; + internal Result_TxOutUtxoLookupErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_TxOutUtxoLookupErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state. + */ + public static Result_TxOutUtxoLookupErrorZ ok(org.ldk.structs.TxOut o) { + long ret = bindings.CResult_TxOutUtxoLookupErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxOutUtxoLookupErrorZ ret_hu_conv = Result_TxOutUtxoLookupErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state. + */ + public static Result_TxOutUtxoLookupErrorZ err(UtxoLookupError e) { + long ret = bindings.CResult_TxOutUtxoLookupErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxOutUtxoLookupErrorZ ret_hu_conv = Result_TxOutUtxoLookupErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxOutUtxoLookupErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxOutUtxoLookupErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxOutUtxoLookupErrorZ clone() { + long ret = bindings.CResult_TxOutUtxoLookupErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxOutUtxoLookupErrorZ ret_hu_conv = Result_TxOutUtxoLookupErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs new file mode 100644 index 00000000..fd0c4630 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxRemoveInputDecodeErrorZ : CommonBase { + Result_TxRemoveInputDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxRemoveInputDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxRemoveInputDecodeErrorZ_free(ptr); } + } + + internal static Result_TxRemoveInputDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxRemoveInputDecodeErrorZ_is_ok(ptr)) { + return new Result_TxRemoveInputDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxRemoveInputDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxRemoveInputDecodeErrorZ_OK : Result_TxRemoveInputDecodeErrorZ { + public readonly TxRemoveInput res; + internal Result_TxRemoveInputDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxRemoveInputDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxRemoveInput res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxRemoveInput(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxRemoveInputDecodeErrorZ_Err : Result_TxRemoveInputDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxRemoveInputDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxRemoveInputDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state. + */ + public static Result_TxRemoveInputDecodeErrorZ ok(org.ldk.structs.TxRemoveInput o) { + long ret = bindings.CResult_TxRemoveInputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state. + */ + public static Result_TxRemoveInputDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxRemoveInputDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxRemoveInputDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxRemoveInputDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxRemoveInputDecodeErrorZ clone() { + long ret = bindings.CResult_TxRemoveInputDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs new file mode 100644 index 00000000..62dcffe7 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxRemoveOutputDecodeErrorZ : CommonBase { + Result_TxRemoveOutputDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxRemoveOutputDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxRemoveOutputDecodeErrorZ_free(ptr); } + } + + internal static Result_TxRemoveOutputDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxRemoveOutputDecodeErrorZ_is_ok(ptr)) { + return new Result_TxRemoveOutputDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxRemoveOutputDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxRemoveOutputDecodeErrorZ_OK : Result_TxRemoveOutputDecodeErrorZ { + public readonly TxRemoveOutput res; + internal Result_TxRemoveOutputDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxRemoveOutputDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxRemoveOutput res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxRemoveOutput(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxRemoveOutputDecodeErrorZ_Err : Result_TxRemoveOutputDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxRemoveOutputDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxRemoveOutputDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state. + */ + public static Result_TxRemoveOutputDecodeErrorZ ok(org.ldk.structs.TxRemoveOutput o) { + long ret = bindings.CResult_TxRemoveOutputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state. + */ + public static Result_TxRemoveOutputDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxRemoveOutputDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxRemoveOutputDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxRemoveOutputDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxRemoveOutputDecodeErrorZ clone() { + long ret = bindings.CResult_TxRemoveOutputDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs new file mode 100644 index 00000000..6f1ae9ee --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TxSignaturesDecodeErrorZ : CommonBase { + Result_TxSignaturesDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TxSignaturesDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TxSignaturesDecodeErrorZ_free(ptr); } + } + + internal static Result_TxSignaturesDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TxSignaturesDecodeErrorZ_is_ok(ptr)) { + return new Result_TxSignaturesDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TxSignaturesDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TxSignaturesDecodeErrorZ_OK : Result_TxSignaturesDecodeErrorZ { + public readonly TxSignatures res; + internal Result_TxSignaturesDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TxSignaturesDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TxSignatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxSignatures(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TxSignaturesDecodeErrorZ_Err : Result_TxSignaturesDecodeErrorZ { + public readonly DecodeError err; + internal Result_TxSignaturesDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TxSignaturesDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state. + */ + public static Result_TxSignaturesDecodeErrorZ ok(org.ldk.structs.TxSignatures o) { + long ret = bindings.CResult_TxSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state. + */ + public static Result_TxSignaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TxSignaturesDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TxSignaturesDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TxSignaturesDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxSignaturesDecodeErrorZ clone() { + long ret = bindings.CResult_TxSignaturesDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs index b9de0d6b..56833d2e 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs index b390d9eb..664ec9e0 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs index 7ed9f5e5..608b212d 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs new file mode 100644 index 00000000..e3f2c190 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_UntrustedStringDecodeErrorZ : CommonBase { + Result_UntrustedStringDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_UntrustedStringDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_UntrustedStringDecodeErrorZ_free(ptr); } + } + + internal static Result_UntrustedStringDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_UntrustedStringDecodeErrorZ_is_ok(ptr)) { + return new Result_UntrustedStringDecodeErrorZ_OK(null, ptr); + } else { + return new Result_UntrustedStringDecodeErrorZ_Err(null, ptr); + } + } + public class Result_UntrustedStringDecodeErrorZ_OK : Result_UntrustedStringDecodeErrorZ { + public readonly UntrustedString res; + internal Result_UntrustedStringDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_UntrustedStringDecodeErrorZ_get_ok(ptr); + org.ldk.structs.UntrustedString res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UntrustedString(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_UntrustedStringDecodeErrorZ_Err : Result_UntrustedStringDecodeErrorZ { + public readonly DecodeError err; + internal Result_UntrustedStringDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_UntrustedStringDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state. + */ + public static Result_UntrustedStringDecodeErrorZ ok(org.ldk.structs.UntrustedString o) { + long ret = bindings.CResult_UntrustedStringDecodeErrorZ_ok(o == null ? 0 : o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state. + */ + public static Result_UntrustedStringDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_UntrustedStringDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_UntrustedStringDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_UntrustedStringDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UntrustedStringDecodeErrorZ clone() { + long ret = bindings.CResult_UntrustedStringDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs index db3af39f..1dbd98fa 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs index 9b263de8..0aaa9791 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs index ead76d67..e9453266 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs index f63de2eb..b7931952 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UpdateFeeDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs index 1b016cd5..d299d061 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs index 60b04b15..3d6e34bd 100644 --- a/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs @@ -58,6 +58,7 @@ public class Result_WarningMessageDecodeErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_WarningMessageDecodeErrorZ ret_hu_conv = Result_WarningMessageDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.cs new file mode 100644 index 00000000..6c4cb5ca --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_WriteableEcdsaChannelSignerDecodeErrorZ : CommonBase { + Result_WriteableEcdsaChannelSignerDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_WriteableEcdsaChannelSignerDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(ptr); } + } + + internal static Result_WriteableEcdsaChannelSignerDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(ptr)) { + return new Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK(null, ptr); + } else { + return new Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err(null, ptr); + } + } + public class Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK : Result_WriteableEcdsaChannelSignerDecodeErrorZ { + public readonly WriteableEcdsaChannelSigner res; + internal Result_WriteableEcdsaChannelSignerDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(ptr); + WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, res); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + this.res = ret_hu_conv; + } + } + + public class Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err : Result_WriteableEcdsaChannelSignerDecodeErrorZ { + public readonly DecodeError err; + internal Result_WriteableEcdsaChannelSignerDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state. + */ + public static Result_WriteableEcdsaChannelSignerDecodeErrorZ ok(org.ldk.structs.WriteableEcdsaChannelSigner o) { + long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state. + */ + public static Result_WriteableEcdsaChannelSignerDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_WriteableEcdsaChannelSignerDecodeErrorZ clone() { + long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result__u832APIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result__u832APIErrorZ.cs index 9daf5035..c497bb09 100644 --- a/c_sharp/src/org/ldk/structs/Result__u832APIErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result__u832APIErrorZ.cs @@ -54,6 +54,7 @@ public class Result__u832APIErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs index 38ea424b..30e15ca2 100644 --- a/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_u32GraphSyncErrorZ.cs @@ -54,6 +54,7 @@ public class Result_u32GraphSyncErrorZ : CommonBase { GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Retry.cs b/c_sharp/src/org/ldk/structs/Retry.cs index 63ca5603..2759d32a 100644 --- a/c_sharp/src/org/ldk/structs/Retry.cs +++ b/c_sharp/src/org/ldk/structs/Retry.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * Strategies available to retry payment path failures for an [`Invoice`]. + * Strategies available to retry payment path failures. */ public class Retry : CommonBase { protected Retry(object _dummy, long ptr) : base(ptr) { } @@ -96,7 +96,7 @@ public class Retry : CommonBase { return this.eq((Retry)o); } /** - * Checks if two Retrys contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the Retry. */ public long hash() { long ret = bindings.Retry_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/RevokeAndACK.cs b/c_sharp/src/org/ldk/structs/RevokeAndACK.cs index 8546838a..9e49d2a7 100644 --- a/c_sharp/src/org/ldk/structs/RevokeAndACK.cs +++ b/c_sharp/src/org/ldk/structs/RevokeAndACK.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A revoke_and_ack message to be sent or received from a peer + * A [`revoke_and_ack`] message to be sent to or received from a peer. + * + * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack */ public class RevokeAndACK : CommonBase { internal RevokeAndACK(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/Route.cs b/c_sharp/src/org/ldk/structs/Route.cs index 619bd6df..a13f5e08 100644 --- a/c_sharp/src/org/ldk/structs/Route.cs +++ b/c_sharp/src/org/ldk/structs/Route.cs @@ -17,52 +17,40 @@ public class Route : CommonBase { } /** - * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the - * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT - * INCLUDING our own, where the last hop is the destination. Thus, this must always be at - * least length one. While the maximum length of any given path is variable, keeping the length - * of any path less or equal to 19 should currently ensure it is viable. + * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no + * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be + * the same. */ - public RouteHop[][] get_paths() { - long[][] ret = bindings.Route_get_paths(this.ptr); + public Path[] get_paths() { + long[] ret = bindings.Route_get_paths(this.ptr); GC.KeepAlive(this); - int ret_conv_12_len = ret.Length; - RouteHop[][] ret_conv_12_arr = new RouteHop[ret_conv_12_len][]; - for (int m = 0; m < ret_conv_12_len; m++) { - long[] ret_conv_12 = ret[m]; - int ret_conv_12_conv_10_len = ret_conv_12.Length; - RouteHop[] ret_conv_12_conv_10_arr = new RouteHop[ret_conv_12_conv_10_len]; - for (int k = 0; k < ret_conv_12_conv_10_len; k++) { - long ret_conv_12_conv_10 = ret_conv_12[k]; - org.ldk.structs.RouteHop ret_conv_12_conv_10_hu_conv = null; if (ret_conv_12_conv_10 < 0 || ret_conv_12_conv_10 > 4096) { ret_conv_12_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, ret_conv_12_conv_10); } - if (ret_conv_12_conv_10_hu_conv != null) { ret_conv_12_conv_10_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_12_conv_10_arr[k] = ret_conv_12_conv_10_hu_conv; - } - ret_conv_12_arr[m] = ret_conv_12_conv_10_arr; + int ret_conv_6_len = ret.Length; + Path[] ret_conv_6_arr = new Path[ret_conv_6_len]; + for (int g = 0; g < ret_conv_6_len; g++) { + long ret_conv_6 = ret[g]; + org.ldk.structs.Path ret_conv_6_hu_conv = null; if (ret_conv_6 < 0 || ret_conv_6 > 4096) { ret_conv_6_hu_conv = new org.ldk.structs.Path(null, ret_conv_6); } + if (ret_conv_6_hu_conv != null) { ret_conv_6_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_6_arr[g] = ret_conv_6_hu_conv; } - return ret_conv_12_arr; + return ret_conv_6_arr; } /** - * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the - * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT - * INCLUDING our own, where the last hop is the destination. Thus, this must always be at - * least length one. While the maximum length of any given path is variable, keeping the length - * of any path less or equal to 19 should currently ensure it is viable. + * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no + * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be + * the same. */ - public void set_paths(RouteHop[][] val) { - bindings.Route_set_paths(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_12 => val_conv_12 != null ? InternalUtils.mapArray(val_conv_12, val_conv_12_conv_10 => val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr) : null) : null); + public void set_paths(Path[] val) { + bindings.Route_set_paths(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_6 => val_conv_6 == null ? 0 : val_conv_6.ptr) : null); GC.KeepAlive(this); GC.KeepAlive(val); - foreach (RouteHop[] val_conv_12 in val) { foreach (RouteHop val_conv_12_conv_10 in val_conv_12) { if (this != null) { this.ptrs_to.AddLast(val_conv_12_conv_10); }; }; }; + foreach (Path val_conv_6 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_6); }; }; } /** - * The `payment_params` parameter passed to [`find_route`]. - * This is used by `ChannelManager` to track information which may be required for retries, - * provided back to you via [`Event::PaymentPathFailed`]. + * The `payment_params` parameter passed via [`RouteParameters`] to [`find_route`]. * - * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * This is used by `ChannelManager` to track information which may be required for retries. * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -76,11 +64,9 @@ public class Route : CommonBase { } /** - * The `payment_params` parameter passed to [`find_route`]. - * This is used by `ChannelManager` to track information which may be required for retries, - * provided back to you via [`Event::PaymentPathFailed`]. + * The `payment_params` parameter passed via [`RouteParameters`] to [`find_route`]. * - * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * This is used by `ChannelManager` to track information which may be required for retries. * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -94,14 +80,14 @@ public class Route : CommonBase { /** * Constructs a new Route given each field */ - public static Route of(RouteHop[][] paths_arg, org.ldk.structs.PaymentParameters payment_params_arg) { - long ret = bindings.Route_new(paths_arg != null ? InternalUtils.mapArray(paths_arg, paths_arg_conv_12 => paths_arg_conv_12 != null ? InternalUtils.mapArray(paths_arg_conv_12, paths_arg_conv_12_conv_10 => paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr) : null) : null, payment_params_arg == null ? 0 : payment_params_arg.ptr); + public static Route of(Path[] paths_arg, org.ldk.structs.PaymentParameters payment_params_arg) { + long ret = bindings.Route_new(paths_arg != null ? InternalUtils.mapArray(paths_arg, paths_arg_conv_6 => paths_arg_conv_6 == null ? 0 : paths_arg_conv_6.ptr) : null, payment_params_arg == null ? 0 : payment_params_arg.ptr); GC.KeepAlive(paths_arg); GC.KeepAlive(payment_params_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Route(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (RouteHop[] paths_arg_conv_12 in paths_arg) { foreach (RouteHop paths_arg_conv_12_conv_10 in paths_arg_conv_12) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(paths_arg_conv_12_conv_10); }; }; }; + foreach (Path paths_arg_conv_6 in paths_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(paths_arg_conv_6); }; }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_params_arg); }; return ret_hu_conv; } @@ -125,7 +111,7 @@ public class Route : CommonBase { } /** - * Checks if two Routes contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the Route. */ public long hash() { long ret = bindings.Route_hash(this.ptr); @@ -157,7 +143,7 @@ public class Route : CommonBase { * Returns the total amount of fees paid on this [`Route`]. * * This doesn't include any extra payment made to the recipient, which can happen in excess of - * the amount passed to [`find_route`]'s `params.final_value_msat`. + * the amount passed to [`find_route`]'s `route_params.final_value_msat`. */ public long get_total_fees() { long ret = bindings.Route_get_total_fees(this.ptr); @@ -166,7 +152,8 @@ public class Route : CommonBase { } /** - * Returns the total amount paid on this [`Route`], excluding the fees. + * Returns the total amount paid on this [`Route`], excluding the fees. Might be more than + * requested if we had to reach htlc_minimum_msat. */ public long get_total_amount() { long ret = bindings.Route_get_total_amount(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/RouteHint.cs b/c_sharp/src/org/ldk/structs/RouteHint.cs index d3b956df..962cb0d4 100644 --- a/c_sharp/src/org/ldk/structs/RouteHint.cs +++ b/c_sharp/src/org/ldk/structs/RouteHint.cs @@ -68,7 +68,7 @@ public class RouteHint : CommonBase { } /** - * Checks if two RouteHints contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the RouteHint. */ public long hash() { long ret = bindings.RouteHint_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/RouteHintHop.cs b/c_sharp/src/org/ldk/structs/RouteHintHop.cs index 98bd1074..f8f17a9c 100644 --- a/c_sharp/src/org/ldk/structs/RouteHintHop.cs +++ b/c_sharp/src/org/ldk/structs/RouteHintHop.cs @@ -110,6 +110,7 @@ public class RouteHintHop : CommonBase { bindings.RouteHintHop_set_htlc_minimum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -131,6 +132,7 @@ public class RouteHintHop : CommonBase { bindings.RouteHintHop_set_htlc_maximum_msat(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -148,6 +150,8 @@ public class RouteHintHop : CommonBase { org.ldk.structs.RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHintHop(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fees_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_minimum_msat_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_maximum_msat_arg); }; return ret_hu_conv; } @@ -170,7 +174,7 @@ public class RouteHintHop : CommonBase { } /** - * Checks if two RouteHintHops contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the RouteHintHop. */ public long hash() { long ret = bindings.RouteHintHop_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/RouteHop.cs b/c_sharp/src/org/ldk/structs/RouteHop.cs index 5575b8cc..d6c29335 100644 --- a/c_sharp/src/org/ldk/structs/RouteHop.cs +++ b/c_sharp/src/org/ldk/structs/RouteHop.cs @@ -7,7 +7,8 @@ namespace org { namespace ldk { namespace structs { /** - * A hop in a route + * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel + * that leads to it. */ public class RouteHop : CommonBase { internal RouteHop(object _dummy, long ptr) : base(ptr) { } @@ -101,8 +102,11 @@ public class RouteHop : CommonBase { /** * The fee taken on this hop (for paying for the use of the *next* channel in the path). - * For the last hop, this should be the full value of the payment (might be more than - * requested if we had to match htlc_minimum_msat). + * If this is the last hop in [`Path::hops`]: + * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path + * otherwise, this is the full value of this [`Path`]'s part of the payment + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public long get_fee_msat() { long ret = bindings.RouteHop_get_fee_msat(this.ptr); @@ -112,8 +116,11 @@ public class RouteHop : CommonBase { /** * The fee taken on this hop (for paying for the use of the *next* channel in the path). - * For the last hop, this should be the full value of the payment (might be more than - * requested if we had to match htlc_minimum_msat). + * If this is the last hop in [`Path::hops`]: + * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path + * otherwise, this is the full value of this [`Path`]'s part of the payment + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public void set_fee_msat(long val) { bindings.RouteHop_set_fee_msat(this.ptr, val); @@ -122,8 +129,12 @@ public class RouteHop : CommonBase { } /** - * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value - * expected at the destination, in excess of the current block height. + * The CLTV delta added for this hop. + * If this is the last hop in [`Path::hops`]: + * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path + * otherwise, this is the CLTV delta expected at the destination + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public int get_cltv_expiry_delta() { int ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr); @@ -132,8 +143,12 @@ public class RouteHop : CommonBase { } /** - * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value - * expected at the destination, in excess of the current block height. + * The CLTV delta added for this hop. + * If this is the last hop in [`Path::hops`]: + * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path + * otherwise, this is the CLTV delta expected at the destination + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public void set_cltv_expiry_delta(int val) { bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val); @@ -179,7 +194,7 @@ public class RouteHop : CommonBase { } /** - * Checks if two RouteHops contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the RouteHop. */ public long hash() { long ret = bindings.RouteHop_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/RouteParameters.cs b/c_sharp/src/org/ldk/structs/RouteParameters.cs index 1fa7af7a..35c04630 100644 --- a/c_sharp/src/org/ldk/structs/RouteParameters.cs +++ b/c_sharp/src/org/ldk/structs/RouteParameters.cs @@ -9,10 +9,7 @@ namespace org { namespace ldk { namespace structs { /** * Parameters needed to find a [`Route`]. * - * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in - * [`Event::PaymentPathFailed`] for retrying a failed payment path. - * - * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * Passed to [`find_route`] and [`build_route_from_hops`]. */ public class RouteParameters : CommonBase { internal RouteParameters(object _dummy, long ptr) : base(ptr) { } @@ -60,32 +57,13 @@ public class RouteParameters : CommonBase { GC.KeepAlive(val); } - /** - * The CLTV on the final hop of the failed payment path. - */ - public int get_final_cltv_expiry_delta() { - int ret = bindings.RouteParameters_get_final_cltv_expiry_delta(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The CLTV on the final hop of the failed payment path. - */ - public void set_final_cltv_expiry_delta(int val) { - bindings.RouteParameters_set_final_cltv_expiry_delta(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * Constructs a new RouteParameters given each field */ - public static RouteParameters of(org.ldk.structs.PaymentParameters payment_params_arg, long final_value_msat_arg, int final_cltv_expiry_delta_arg) { - long ret = bindings.RouteParameters_new(payment_params_arg == null ? 0 : payment_params_arg.ptr, final_value_msat_arg, final_cltv_expiry_delta_arg); + public static RouteParameters of(org.ldk.structs.PaymentParameters payment_params_arg, long final_value_msat_arg) { + long ret = bindings.RouteParameters_new(payment_params_arg == null ? 0 : payment_params_arg.ptr, final_value_msat_arg); GC.KeepAlive(payment_params_arg); GC.KeepAlive(final_value_msat_arg); - GC.KeepAlive(final_cltv_expiry_delta_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -111,6 +89,23 @@ public class RouteParameters : CommonBase { return ret_hu_conv; } + /** + * Checks if two RouteParameterss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.RouteParameters b) { + bool ret = bindings.RouteParameters_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is RouteParameters)) return false; + return this.eq((RouteParameters)o); + } /** * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read */ diff --git a/c_sharp/src/org/ldk/structs/Router.cs b/c_sharp/src/org/ldk/structs/Router.cs index cf87be82..32c60514 100644 --- a/c_sharp/src/org/ldk/structs/Router.cs +++ b/c_sharp/src/org/ldk/structs/Router.cs @@ -21,34 +21,26 @@ public class Router : CommonBase { public interface RouterInterface { /** - * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. + * Finds a [`Route`] for a payment between the given `payer` and a payee. + * + * The `payee` and the payment's value are given in [`RouteParameters::payment_params`] + * and [`RouteParameters::final_value_msat`], respectively. * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ Result_RouteLightningErrorZ find_route(byte[] _payer, RouteParameters _route_params, ChannelDetails[] _first_hops, InFlightHtlcs _inflight_htlcs); /** - * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes - * `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment. + * Finds a [`Route`] for a payment between the given `payer` and a payee. + * + * The `payee` and the payment's value are given in [`RouteParameters::payment_params`] + * and [`RouteParameters::final_value_msat`], respectively. + * + * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific + * payment. * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ Result_RouteLightningErrorZ find_route_with_id(byte[] _payer, RouteParameters _route_params, ChannelDetails[] _first_hops, InFlightHtlcs _inflight_htlcs, byte[] __payment_hash, byte[] __payment_id); - /** - * Lets the router know that payment through a specific path has failed. - */ - void notify_payment_path_failed(RouteHop[] _path, long _short_channel_id); - /** - * Lets the router know that payment through a specific path was successful. - */ - void notify_payment_path_successful(RouteHop[] _path); - /** - * Lets the router know that a payment probe was successful. - */ - void notify_payment_probe_successful(RouteHop[] _path); - /** - * Lets the router know that a payment probe failed. - */ - void notify_payment_probe_failed(RouteHop[] _path, long _short_channel_id); } private class LDKRouterHolder { internal Router held; } private class LDKRouterImpl : bindings.LDKRouter { @@ -93,54 +85,6 @@ public class Router : CommonBase { long result = ret == null ? 0 : ret.clone_ptr(); return result; } - public void notify_payment_path_failed(long[] _path, long _short_channel_id) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.notify_payment_path_failed(_path_conv_10_arr, _short_channel_id); - GC.KeepAlive(arg); - } - public void notify_payment_path_successful(long[] _path) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.notify_payment_path_successful(_path_conv_10_arr); - GC.KeepAlive(arg); - } - public void notify_payment_probe_successful(long[] _path) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.notify_payment_probe_successful(_path_conv_10_arr); - GC.KeepAlive(arg); - } - public void notify_payment_probe_failed(long[] _path, long _short_channel_id) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.notify_payment_probe_failed(_path_conv_10_arr, _short_channel_id); - GC.KeepAlive(arg); - } } public static Router new_impl(RouterInterface arg) { LDKRouterHolder impl_holder = new LDKRouterHolder(); @@ -148,7 +92,10 @@ public class Router : CommonBase { return impl_holder.held; } /** - * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. + * Finds a [`Route`] for a payment between the given `payer` and a payee. + * + * The `payee` and the payment's value are given in [`RouteParameters::payment_params`] + * and [`RouteParameters::final_value_msat`], respectively. * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -168,8 +115,13 @@ public class Router : CommonBase { } /** - * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes - * `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment. + * Finds a [`Route`] for a payment between the given `payer` and a payee. + * + * The `payee` and the payment's value are given in [`RouteParameters::payment_params`] + * and [`RouteParameters::final_value_msat`], respectively. + * + * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific + * payment. * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ @@ -190,47 +142,5 @@ public class Router : CommonBase { return ret_hu_conv; } - /** - * Lets the router know that payment through a specific path has failed. - */ - public void notify_payment_path_failed(RouteHop[] path, long short_channel_id) { - bindings.Router_notify_payment_path_failed(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null, short_channel_id); - GC.KeepAlive(this); - GC.KeepAlive(path); - GC.KeepAlive(short_channel_id); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; - } - - /** - * Lets the router know that payment through a specific path was successful. - */ - public void notify_payment_path_successful(RouteHop[] path) { - bindings.Router_notify_payment_path_successful(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null); - GC.KeepAlive(this); - GC.KeepAlive(path); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; - } - - /** - * Lets the router know that a payment probe was successful. - */ - public void notify_payment_probe_successful(RouteHop[] path) { - bindings.Router_notify_payment_probe_successful(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null); - GC.KeepAlive(this); - GC.KeepAlive(path); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; - } - - /** - * Lets the router know that a payment probe failed. - */ - public void notify_payment_probe_failed(RouteHop[] path, long short_channel_id) { - bindings.Router_notify_payment_probe_failed(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null, short_channel_id); - GC.KeepAlive(this); - GC.KeepAlive(path); - GC.KeepAlive(short_channel_id); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; - } - } } } } diff --git a/c_sharp/src/org/ldk/structs/RoutingFees.cs b/c_sharp/src/org/ldk/structs/RoutingFees.cs index e3b14370..087d9562 100644 --- a/c_sharp/src/org/ldk/structs/RoutingFees.cs +++ b/c_sharp/src/org/ldk/structs/RoutingFees.cs @@ -16,7 +16,7 @@ public class RoutingFees : CommonBase { } /** - * Flat routing fee in satoshis + * Flat routing fee in millisatoshis. */ public int get_base_msat() { int ret = bindings.RoutingFees_get_base_msat(this.ptr); @@ -25,7 +25,7 @@ public class RoutingFees : CommonBase { } /** - * Flat routing fee in satoshis + * Flat routing fee in millisatoshis. */ public void set_base_msat(int val) { bindings.RoutingFees_set_base_msat(this.ptr, val); @@ -102,7 +102,7 @@ public class RoutingFees : CommonBase { } /** - * Checks if two RoutingFeess contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the RoutingFees. */ public long hash() { long ret = bindings.RoutingFees_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs b/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs index c06d0f19..574d2c99 100644 --- a/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs @@ -10,8 +10,8 @@ namespace org { namespace ldk { namespace structs { * * # Implementor DoS Warnings * - * For `gossip_queries` messages there are potential DoS vectors when handling - * inbound queries. Implementors using an on-disk network graph should be aware of + * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when + * handling inbound queries. Implementors using an on-disk network graph should be aware of * repeated disk I/O for queries accessing different parts of the network graph. */ public class RoutingMessageHandler : CommonBase { @@ -28,36 +28,36 @@ public class RoutingMessageHandler : CommonBase { public interface RoutingMessageHandlerInterface { /** - * Handle an incoming node_announcement message, returning true if it should be forwarded on, - * false or returning an Err otherwise. + * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on, + * `false` or returning an `Err` otherwise. */ Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement _msg); /** - * Handle a channel_announcement message, returning true if it should be forwarded on, false - * or returning an Err otherwise. + * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false` + * or returning an `Err` otherwise. */ Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement _msg); /** - * Handle an incoming channel_update message, returning true if it should be forwarded on, - * false or returning an Err otherwise. + * Handle an incoming `channel_update` message, returning true if it should be forwarded on, + * `false` or returning an `Err` otherwise. */ Result_boolLightningErrorZ handle_channel_update(ChannelUpdate _msg); /** * Gets channel announcements and updates required to dump our routing table to a remote node, - * starting at the short_channel_id indicated by starting_point and including announcements + * starting at the `short_channel_id` indicated by `starting_point` and including announcements * for a single channel. */ Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement(long _starting_point); /** * Gets a node announcement required to dump our routing table to a remote node, starting at * the node *after* the provided pubkey and including up to one announcement immediately - * higher (as defined by ::cmp) than starting_point. - * If None is provided for starting_point, we start at the first node. + * higher (as defined by `::cmp`) than `starting_point`. + * If `None` is provided for `starting_point`, we start at the first node. * * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - NodeAnnouncement get_next_node_announcement(byte[] _starting_point); + NodeAnnouncement get_next_node_announcement(NodeId _starting_point); /** * Called when a connection is established with a peer. This can be used to * perform routing table synchronization using a strategy defined by the @@ -67,7 +67,7 @@ public class RoutingMessageHandler : CommonBase { * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - Result_NoneNoneZ peer_connected(byte[] _their_node_id, Init _init); + Result_NoneNoneZ peer_connected(byte[] _their_node_id, Init _init, bool _inbound); /** * Handles the reply of a query we initiated to learn about channels * for a given range of blocks. We can expect to receive one or more @@ -82,15 +82,22 @@ public class RoutingMessageHandler : CommonBase { */ Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] _their_node_id, ReplyShortChannelIdsEnd _msg); /** - * Handles when a peer asks us to send a list of short_channel_ids + * Handles when a peer asks us to send a list of `short_channel_id`s * for the requested range of blocks. */ Result_NoneLightningErrorZ handle_query_channel_range(byte[] _their_node_id, QueryChannelRange _msg); /** * Handles when a peer asks us to send routing gossip messages for a - * list of short_channel_ids. + * list of `short_channel_id`s. */ Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] _their_node_id, QueryShortChannelIds _msg); + /** + * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages + * pending some async action. While there is no guarantee of the rate of future messages, the + * caller should seek to reduce the rate of new gossip messages handled, especially + * [`ChannelAnnouncement`]s. + */ + bool processing_queue_high(); /** * Gets the node feature flags which this handler itself supports. All available handlers are * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] @@ -136,17 +143,20 @@ public class RoutingMessageHandler : CommonBase { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = arg.get_next_channel_announcement(_starting_point); GC.KeepAlive(arg); long result = ret == null ? 0 : ret.clone_ptr(); + if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } - public long get_next_node_announcement(byte[] _starting_point) { - NodeAnnouncement ret = arg.get_next_node_announcement(_starting_point); + public long get_next_node_announcement(long _starting_point) { + org.ldk.structs.NodeId _starting_point_hu_conv = null; if (_starting_point < 0 || _starting_point > 4096) { _starting_point_hu_conv = new org.ldk.structs.NodeId(null, _starting_point); } + if (_starting_point_hu_conv != null) { _starting_point_hu_conv.ptrs_to.AddLast(this); }; + NodeAnnouncement ret = arg.get_next_node_announcement(_starting_point_hu_conv); GC.KeepAlive(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } - public long peer_connected(byte[] _their_node_id, long _init) { + public long peer_connected(byte[] _their_node_id, long _init, bool _inbound) { org.ldk.structs.Init _init_hu_conv = null; if (_init < 0 || _init > 4096) { _init_hu_conv = new org.ldk.structs.Init(null, _init); } - Result_NoneNoneZ ret = arg.peer_connected(_their_node_id, _init_hu_conv); + Result_NoneNoneZ ret = arg.peer_connected(_their_node_id, _init_hu_conv, _inbound); GC.KeepAlive(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; @@ -183,6 +193,11 @@ public class RoutingMessageHandler : CommonBase { long result = ret == null ? 0 : ret.clone_ptr(); return result; } + public bool processing_queue_high() { + bool ret = arg.processing_queue_high(); + GC.KeepAlive(arg); + return ret; + } public long provided_node_features() { NodeFeatures ret = arg.provided_node_features(); GC.KeepAlive(arg); @@ -212,8 +227,8 @@ public class RoutingMessageHandler : CommonBase { } /** - * Handle an incoming node_announcement message, returning true if it should be forwarded on, - * false or returning an Err otherwise. + * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on, + * `false` or returning an `Err` otherwise. */ public Result_boolLightningErrorZ handle_node_announcement(org.ldk.structs.NodeAnnouncement msg) { long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr); @@ -226,8 +241,8 @@ public class RoutingMessageHandler : CommonBase { } /** - * Handle a channel_announcement message, returning true if it should be forwarded on, false - * or returning an Err otherwise. + * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false` + * or returning an `Err` otherwise. */ public Result_boolLightningErrorZ handle_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr); @@ -240,8 +255,8 @@ public class RoutingMessageHandler : CommonBase { } /** - * Handle an incoming channel_update message, returning true if it should be forwarded on, - * false or returning an Err otherwise. + * Handle an incoming `channel_update` message, returning true if it should be forwarded on, + * `false` or returning an `Err` otherwise. */ public Result_boolLightningErrorZ handle_channel_update(org.ldk.structs.ChannelUpdate msg) { long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr); @@ -255,7 +270,7 @@ public class RoutingMessageHandler : CommonBase { /** * Gets channel announcements and updates required to dump our routing table to a remote node, - * starting at the short_channel_id indicated by starting_point and including announcements + * starting at the `short_channel_id` indicated by `starting_point` and including announcements * for a single channel. */ public Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement(long starting_point) { @@ -271,19 +286,20 @@ public class RoutingMessageHandler : CommonBase { /** * Gets a node announcement required to dump our routing table to a remote node, starting at * the node *after* the provided pubkey and including up to one announcement immediately - * higher (as defined by ::cmp) than starting_point. - * If None is provided for starting_point, we start at the first node. + * higher (as defined by `::cmp`) than `starting_point`. + * If `None` is provided for `starting_point`, we start at the first node. * * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public NodeAnnouncement get_next_node_announcement(byte[] starting_point) { - long ret = bindings.RoutingMessageHandler_get_next_node_announcement(this.ptr, InternalUtils.check_arr_len(starting_point, 33)); + public NodeAnnouncement get_next_node_announcement(org.ldk.structs.NodeId starting_point) { + long ret = bindings.RoutingMessageHandler_get_next_node_announcement(this.ptr, starting_point == null ? 0 : starting_point.ptr); GC.KeepAlive(this); GC.KeepAlive(starting_point); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(starting_point); }; return ret_hu_conv; } @@ -296,11 +312,12 @@ public class RoutingMessageHandler : CommonBase { * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init) { - long ret = bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr); + public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init, bool inbound) { + long ret = bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr, inbound); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(init); + GC.KeepAlive(inbound); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(init); }; @@ -341,7 +358,7 @@ public class RoutingMessageHandler : CommonBase { } /** - * Handles when a peer asks us to send a list of short_channel_ids + * Handles when a peer asks us to send a list of `short_channel_id`s * for the requested range of blocks. */ public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, org.ldk.structs.QueryChannelRange msg) { @@ -357,7 +374,7 @@ public class RoutingMessageHandler : CommonBase { /** * Handles when a peer asks us to send routing gossip messages for a - * list of short_channel_ids. + * list of `short_channel_id`s. */ public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, org.ldk.structs.QueryShortChannelIds msg) { long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); @@ -370,6 +387,18 @@ public class RoutingMessageHandler : CommonBase { return ret_hu_conv; } + /** + * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages + * pending some async action. While there is no guarantee of the rate of future messages, the + * caller should seek to reduce the rate of new gossip messages handled, especially + * [`ChannelAnnouncement`]s. + */ + public bool processing_queue_high() { + bool ret = bindings.RoutingMessageHandler_processing_queue_high(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Gets the node feature flags which this handler itself supports. All available handlers are * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] diff --git a/c_sharp/src/org/ldk/structs/Score.cs b/c_sharp/src/org/ldk/structs/Score.cs index 967ee60e..fb5de89a 100644 --- a/c_sharp/src/org/ldk/structs/Score.cs +++ b/c_sharp/src/org/ldk/structs/Score.cs @@ -32,23 +32,23 @@ public class Score : CommonBase { * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount. * Thus, implementations should be overflow-safe. */ - long channel_penalty_msat(long _short_channel_id, NodeId _source, NodeId _target, ChannelUsage _usage); + long channel_penalty_msat(long _short_channel_id, NodeId _source, NodeId _target, ChannelUsage _usage, ProbabilisticScoringFeeParameters _score_params); /** * Handles updating channel penalties after failing to route through a channel. */ - void payment_path_failed(RouteHop[] _path, long _short_channel_id); + void payment_path_failed(Path _path, long _short_channel_id); /** * Handles updating channel penalties after successfully routing along a path. */ - void payment_path_successful(RouteHop[] _path); + void payment_path_successful(Path _path); /** * Handles updating channel penalties after a probe over the given path failed. */ - void probe_failed(RouteHop[] _path, long _short_channel_id); + void probe_failed(Path _path, long _short_channel_id); /** * Handles updating channel penalties after a probe over the given path succeeded. */ - void probe_successful(RouteHop[] _path); + void probe_successful(Path _path); /** * Serialize the object into a byte array */ @@ -59,61 +59,34 @@ public class Score : CommonBase { internal LDKScoreImpl(ScoreInterface arg, LDKScoreHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private ScoreInterface arg; private LDKScoreHolder impl_holder; - public long channel_penalty_msat(long _short_channel_id, long _source, long _target, long _usage) { + public long channel_penalty_msat(long _short_channel_id, long _source, long _target, long _usage, long _score_params) { org.ldk.structs.NodeId _source_hu_conv = null; if (_source < 0 || _source > 4096) { _source_hu_conv = new org.ldk.structs.NodeId(null, _source); } org.ldk.structs.NodeId _target_hu_conv = null; if (_target < 0 || _target > 4096) { _target_hu_conv = new org.ldk.structs.NodeId(null, _target); } org.ldk.structs.ChannelUsage _usage_hu_conv = null; if (_usage < 0 || _usage > 4096) { _usage_hu_conv = new org.ldk.structs.ChannelUsage(null, _usage); } if (_usage_hu_conv != null) { _usage_hu_conv.ptrs_to.AddLast(this); }; - long ret = arg.channel_penalty_msat(_short_channel_id, _source_hu_conv, _target_hu_conv, _usage_hu_conv); + org.ldk.structs.ProbabilisticScoringFeeParameters _score_params_hu_conv = null; if (_score_params < 0 || _score_params > 4096) { _score_params_hu_conv = new org.ldk.structs.ProbabilisticScoringFeeParameters(null, _score_params); } + long ret = arg.channel_penalty_msat(_short_channel_id, _source_hu_conv, _target_hu_conv, _usage_hu_conv, _score_params_hu_conv); GC.KeepAlive(arg); return ret; } - public void payment_path_failed(long[] _path, long _short_channel_id) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.payment_path_failed(_path_conv_10_arr, _short_channel_id); + public void payment_path_failed(long _path, long _short_channel_id) { + org.ldk.structs.Path _path_hu_conv = null; if (_path < 0 || _path > 4096) { _path_hu_conv = new org.ldk.structs.Path(null, _path); } + arg.payment_path_failed(_path_hu_conv, _short_channel_id); GC.KeepAlive(arg); } - public void payment_path_successful(long[] _path) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.payment_path_successful(_path_conv_10_arr); + public void payment_path_successful(long _path) { + org.ldk.structs.Path _path_hu_conv = null; if (_path < 0 || _path > 4096) { _path_hu_conv = new org.ldk.structs.Path(null, _path); } + arg.payment_path_successful(_path_hu_conv); GC.KeepAlive(arg); } - public void probe_failed(long[] _path, long _short_channel_id) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.probe_failed(_path_conv_10_arr, _short_channel_id); + public void probe_failed(long _path, long _short_channel_id) { + org.ldk.structs.Path _path_hu_conv = null; if (_path < 0 || _path > 4096) { _path_hu_conv = new org.ldk.structs.Path(null, _path); } + arg.probe_failed(_path_hu_conv, _short_channel_id); GC.KeepAlive(arg); } - public void probe_successful(long[] _path) { - int _path_conv_10_len = _path.Length; - RouteHop[] _path_conv_10_arr = new RouteHop[_path_conv_10_len]; - for (int k = 0; k < _path_conv_10_len; k++) { - long _path_conv_10 = _path[k]; - org.ldk.structs.RouteHop _path_conv_10_hu_conv = null; if (_path_conv_10 < 0 || _path_conv_10 > 4096) { _path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, _path_conv_10); } - if (_path_conv_10_hu_conv != null) { _path_conv_10_hu_conv.ptrs_to.AddLast(this); }; - _path_conv_10_arr[k] = _path_conv_10_hu_conv; - } - arg.probe_successful(_path_conv_10_arr); + public void probe_successful(long _path) { + org.ldk.structs.Path _path_hu_conv = null; if (_path < 0 || _path > 4096) { _path_hu_conv = new org.ldk.structs.Path(null, _path); } + arg.probe_successful(_path_hu_conv); GC.KeepAlive(arg); } public byte[] write() { @@ -137,59 +110,61 @@ public class Score : CommonBase { * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount. * Thus, implementations should be overflow-safe. */ - public long channel_penalty_msat(long short_channel_id, org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, org.ldk.structs.ChannelUsage usage) { - long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, usage == null ? 0 : usage.ptr); + public long channel_penalty_msat(long short_channel_id, org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, org.ldk.structs.ChannelUsage usage, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) { + long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, usage == null ? 0 : usage.ptr, score_params == null ? 0 : score_params.ptr); GC.KeepAlive(this); GC.KeepAlive(short_channel_id); GC.KeepAlive(source); GC.KeepAlive(target); GC.KeepAlive(usage); + GC.KeepAlive(score_params); if (this != null) { this.ptrs_to.AddLast(source); }; if (this != null) { this.ptrs_to.AddLast(target); }; if (this != null) { this.ptrs_to.AddLast(usage); }; + if (this != null) { this.ptrs_to.AddLast(score_params); }; return ret; } /** * Handles updating channel penalties after failing to route through a channel. */ - public void payment_path_failed(RouteHop[] path, long short_channel_id) { - bindings.Score_payment_path_failed(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null, short_channel_id); + public void payment_path_failed(org.ldk.structs.Path path, long short_channel_id) { + bindings.Score_payment_path_failed(this.ptr, path == null ? 0 : path.ptr, short_channel_id); GC.KeepAlive(this); GC.KeepAlive(path); GC.KeepAlive(short_channel_id); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; + if (this != null) { this.ptrs_to.AddLast(path); }; } /** * Handles updating channel penalties after successfully routing along a path. */ - public void payment_path_successful(RouteHop[] path) { - bindings.Score_payment_path_successful(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null); + public void payment_path_successful(org.ldk.structs.Path path) { + bindings.Score_payment_path_successful(this.ptr, path == null ? 0 : path.ptr); GC.KeepAlive(this); GC.KeepAlive(path); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; + if (this != null) { this.ptrs_to.AddLast(path); }; } /** * Handles updating channel penalties after a probe over the given path failed. */ - public void probe_failed(RouteHop[] path, long short_channel_id) { - bindings.Score_probe_failed(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null, short_channel_id); + public void probe_failed(org.ldk.structs.Path path, long short_channel_id) { + bindings.Score_probe_failed(this.ptr, path == null ? 0 : path.ptr, short_channel_id); GC.KeepAlive(this); GC.KeepAlive(path); GC.KeepAlive(short_channel_id); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; + if (this != null) { this.ptrs_to.AddLast(path); }; } /** * Handles updating channel penalties after a probe over the given path succeeded. */ - public void probe_successful(RouteHop[] path) { - bindings.Score_probe_successful(this.ptr, path != null ? InternalUtils.mapArray(path, path_conv_10 => path_conv_10 == null ? 0 : path_conv_10.ptr) : null); + public void probe_successful(org.ldk.structs.Path path) { + bindings.Score_probe_successful(this.ptr, path == null ? 0 : path.ptr); GC.KeepAlive(this); GC.KeepAlive(path); - foreach (RouteHop path_conv_10 in path) { if (this != null) { this.ptrs_to.AddLast(path_conv_10); }; }; + if (this != null) { this.ptrs_to.AddLast(path); }; } /** diff --git a/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs b/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs index 6f9f629e..ea8ffc53 100644 --- a/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs +++ b/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs @@ -24,7 +24,7 @@ public class ScorerAccountingForInFlightHtlcs : CommonBase { * Initialize a new `ScorerAccountingForInFlightHtlcs`. */ public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.Score scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) { - long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer == null ? 0 : scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr); + long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr); GC.KeepAlive(scorer); GC.KeepAlive(inflight_htlcs); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/Sha256.cs b/c_sharp/src/org/ldk/structs/Sha256.cs index 5ec61e2f..274000f4 100644 --- a/c_sharp/src/org/ldk/structs/Sha256.cs +++ b/c_sharp/src/org/ldk/structs/Sha256.cs @@ -34,7 +34,7 @@ public class Sha256 : CommonBase { } /** - * Checks if two Sha256s contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the Sha256. */ public long hash() { long ret = bindings.Sha256_hash(this.ptr); @@ -62,5 +62,18 @@ public class Sha256 : CommonBase { if (!(o is Sha256)) return false; return this.eq((Sha256)o); } + /** + * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a + * single sha256 hash. + */ + public static Sha256 from_bytes(byte[] bytes) { + long ret = bindings.Sha256_from_bytes(InternalUtils.check_arr_len(bytes, 32)); + GC.KeepAlive(bytes); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Shutdown.cs b/c_sharp/src/org/ldk/structs/Shutdown.cs index 79e97dad..9b1b7d4d 100644 --- a/c_sharp/src/org/ldk/structs/Shutdown.cs +++ b/c_sharp/src/org/ldk/structs/Shutdown.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A shutdown message to be sent or received from a peer + * A [`shutdown`] message to be sent to or received from a peer. + * + * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown */ public class Shutdown : CommonBase { internal Shutdown(object _dummy, long ptr) : base(ptr) { } @@ -35,7 +37,8 @@ public class Shutdown : CommonBase { /** * The destination of this peer's funds on closing. - * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh. + * + * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR. */ public byte[] get_scriptpubkey() { byte[] ret = bindings.Shutdown_get_scriptpubkey(this.ptr); @@ -45,7 +48,8 @@ public class Shutdown : CommonBase { /** * The destination of this peer's funds on closing. - * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh. + * + * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR. */ public void set_scriptpubkey(byte[] val) { bindings.Shutdown_set_scriptpubkey(this.ptr, val); diff --git a/c_sharp/src/org/ldk/structs/Sign.cs b/c_sharp/src/org/ldk/structs/Sign.cs deleted file mode 100644 index e914b766..00000000 --- a/c_sharp/src/org/ldk/structs/Sign.cs +++ /dev/null @@ -1,89 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - -/** - * A writeable signer. - * - * There will always be two instances of a signer per channel, one occupied by the - * [`ChannelManager`] and another by the channel's [`ChannelMonitor`]. - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor - */ -public class Sign : CommonBase { - internal readonly bindings.LDKSign bindings_instance; - internal Sign(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } - private Sign(bindings.LDKSign arg, bindings.LDKBaseSign BaseSign, ChannelPublicKeys pubkeys) : base(bindings.LDKSign_new(arg, BaseSign, pubkeys == null ? 0 : pubkeys.clone_ptr())) { - this.ptrs_to.AddLast(arg); - this.ptrs_to.AddLast(BaseSign); - this.bindings_instance = arg; - } - ~Sign() { - if (ptr != 0) { bindings.Sign_free(ptr); } - } - - public interface SignInterface { - /** - * Serialize the object into a byte array - */ - byte[] write(); - } - private class LDKSignHolder { internal Sign held; } - private class LDKSignImpl : bindings.LDKSign { - internal LDKSignImpl(SignInterface arg, LDKSignHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } - private SignInterface arg; - private LDKSignHolder impl_holder; - public byte[] write() { - byte[] ret = arg.write(); - GC.KeepAlive(arg); - return ret; - } - } - public static Sign new_impl(SignInterface arg, BaseSign.BaseSignInterface BaseSign_impl, ChannelPublicKeys pubkeys) { - LDKSignHolder impl_holder = new LDKSignHolder(); - impl_holder.held = new Sign(new LDKSignImpl(arg, impl_holder), BaseSign.new_impl(BaseSign_impl, pubkeys).bindings_instance, pubkeys); - return impl_holder.held; - } - - /** - * Gets the underlying BaseSign. - */ - public BaseSign get_base_sign() { - BaseSign res = new BaseSign(null, bindings.LDKSign_get_BaseSign(this.ptr)); - this.ptrs_to.AddLast(res); - return res; - } - - /** - * Serialize the object into a byte array - */ - public byte[] write() { - byte[] ret = bindings.Sign_write(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.Sign_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of a Sign - */ - public Sign clone() { - long ret = bindings.Sign_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Sign ret_hu_conv = new Sign(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/SignOrCreationError.cs b/c_sharp/src/org/ldk/structs/SignOrCreationError.cs index d4efde11..a077e986 100644 --- a/c_sharp/src/org/ldk/structs/SignOrCreationError.cs +++ b/c_sharp/src/org/ldk/structs/SignOrCreationError.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * When signing using a fallible method either an user-supplied `SignError` or a `CreationError` + * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`] * may occur. */ public class SignOrCreationError : CommonBase { diff --git a/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs b/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs new file mode 100644 index 00000000..8953c5ee --- /dev/null +++ b/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs @@ -0,0 +1,160 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be + * invalid. + * + * # Invariants + * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`]. + */ +public class SignedRawBolt11Invoice : CommonBase { + internal SignedRawBolt11Invoice(object _dummy, long ptr) : base(ptr) { } + ~SignedRawBolt11Invoice() { + if (ptr != 0) { bindings.SignedRawBolt11Invoice_free(ptr); } + } + + /** + * Checks if two SignedRawBolt11Invoices contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.SignedRawBolt11Invoice b) { + bool ret = bindings.SignedRawBolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is SignedRawBolt11Invoice)) return false; + return this.eq((SignedRawBolt11Invoice)o); + } + internal long clone_ptr() { + long ret = bindings.SignedRawBolt11Invoice_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the SignedRawBolt11Invoice + */ + public SignedRawBolt11Invoice clone() { + long ret = bindings.SignedRawBolt11Invoice_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SignedRawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawBolt11Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice. + */ + public long hash() { + long ret = bindings.SignedRawBolt11Invoice_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Disassembles the `SignedRawBolt11Invoice` into its three parts: + * 1. raw invoice + * 2. hash of the raw invoice + * 3. signature + */ + public ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ into_parts() { + long ret = bindings.SignedRawBolt11Invoice_into_parts(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The [`RawBolt11Invoice`] which was signed. + */ + public RawBolt11Invoice raw_invoice() { + long ret = bindings.SignedRawBolt11Invoice_raw_invoice(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawBolt11Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The hash of the [`RawBolt11Invoice`] that was signed. + */ + public byte[] signable_hash() { + byte[] ret = bindings.SignedRawBolt11Invoice_signable_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Signature for the invoice. + */ + public Bolt11InvoiceSignature signature() { + long ret = bindings.SignedRawBolt11Invoice_signature(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceSignature(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Recovers the public key used for signing the invoice from the recoverable signature. + */ + public Result_PayeePubKeyErrorZ recover_payee_pub_key() { + long ret = bindings.SignedRawBolt11Invoice_recover_payee_pub_key(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the signature is valid for the included payee public key or if none exists if it's + * valid for the recovered signature (which should always be true?). + */ + public bool check_signature() { + bool ret = bindings.SignedRawBolt11Invoice_check_signature(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a SignedRawBolt11Invoice object from a string + */ + public static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ from_str(string s) { + long ret = bindings.SignedRawBolt11Invoice_from_str(s); + GC.KeepAlive(s); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Get the string representation of a SignedRawBolt11Invoice object + */ + public string to_str() { + string ret = bindings.SignedRawBolt11Invoice_to_str(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/SignedRawInvoice.cs b/c_sharp/src/org/ldk/structs/SignedRawInvoice.cs deleted file mode 100644 index e9e4e959..00000000 --- a/c_sharp/src/org/ldk/structs/SignedRawInvoice.cs +++ /dev/null @@ -1,160 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be - * invalid. - * - * # Invariants - * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`. - */ -public class SignedRawInvoice : CommonBase { - internal SignedRawInvoice(object _dummy, long ptr) : base(ptr) { } - ~SignedRawInvoice() { - if (ptr != 0) { bindings.SignedRawInvoice_free(ptr); } - } - - /** - * Checks if two SignedRawInvoices contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - * Two objects with NULL inner values will be considered "equal" here. - */ - public bool eq(org.ldk.structs.SignedRawInvoice b) { - bool ret = bindings.SignedRawInvoice_eq(this.ptr, b == null ? 0 : b.ptr); - GC.KeepAlive(this); - GC.KeepAlive(b); - if (this != null) { this.ptrs_to.AddLast(b); }; - return ret; - } - - public override bool Equals(object o) { - if (!(o is SignedRawInvoice)) return false; - return this.eq((SignedRawInvoice)o); - } - internal long clone_ptr() { - long ret = bindings.SignedRawInvoice_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the SignedRawInvoice - */ - public SignedRawInvoice clone() { - long ret = bindings.SignedRawInvoice_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawInvoice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Checks if two SignedRawInvoices contain equal inner contents. - */ - public long hash() { - long ret = bindings.SignedRawInvoice_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - public override int GetHashCode() { - return (int)this.hash(); - } - /** - * Disassembles the `SignedRawInvoice` into its three parts: - * 1. raw invoice - * 2. hash of the raw invoice - * 3. signature - */ - public ThreeTuple_RawInvoice_u832InvoiceSignatureZ into_parts() { - long ret = bindings.SignedRawInvoice_into_parts(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - if (this != null) { this.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The `RawInvoice` which was signed. - */ - public RawInvoice raw_invoice() { - long ret = bindings.SignedRawInvoice_raw_invoice(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawInvoice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The hash of the `RawInvoice` that was signed. - */ - public byte[] signable_hash() { - byte[] ret = bindings.SignedRawInvoice_signable_hash(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * InvoiceSignature for the invoice. - */ - public InvoiceSignature signature() { - long ret = bindings.SignedRawInvoice_signature(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Recovers the public key used for signing the invoice from the recoverable signature. - */ - public Result_PayeePubKeyErrorZ recover_payee_pub_key() { - long ret = bindings.SignedRawInvoice_recover_payee_pub_key(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Checks if the signature is valid for the included payee public key or if none exists if it's - * valid for the recovered signature (which should always be true?). - */ - public bool check_signature() { - bool ret = bindings.SignedRawInvoice_check_signature(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Read a SignedRawInvoice object from a string - */ - public static Result_SignedRawInvoiceParseErrorZ from_str(string s) { - long ret = bindings.SignedRawInvoice_from_str(s); - GC.KeepAlive(s); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SignedRawInvoiceParseErrorZ ret_hu_conv = Result_SignedRawInvoiceParseErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Get the string representation of a SignedRawInvoice object - */ - public string to_str() { - string ret = bindings.SignedRawInvoice_to_str(this.ptr); - GC.KeepAlive(this); - return ret; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/SignerProvider.cs b/c_sharp/src/org/ldk/structs/SignerProvider.cs new file mode 100644 index 00000000..5de97acd --- /dev/null +++ b/c_sharp/src/org/ldk/structs/SignerProvider.cs @@ -0,0 +1,216 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A trait that can return signer instances for individual channels. + */ +public class SignerProvider : CommonBase { + internal readonly bindings.LDKSignerProvider bindings_instance; + internal SignerProvider(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private SignerProvider(bindings.LDKSignerProvider arg) : base(bindings.LDKSignerProvider_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~SignerProvider() { + if (ptr != 0) { bindings.SignerProvider_free(ptr); } + } + + public interface SignerProviderInterface { + /** + * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through + * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow + * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated + * `channel_keys_id`. + * + * This method must return a different value each time it is called. + */ + byte[] generate_channel_keys_id(bool _inbound, long _channel_value_satoshis, UInt128 _user_channel_id); + /** + * Derives the private key material backing a `Signer`. + * + * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through + * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be + * re-derived from its `channel_keys_id`, which can be obtained through its trait method + * [`ChannelSigner::channel_keys_id`]. + */ + WriteableEcdsaChannelSigner derive_channel_signer(long _channel_value_satoshis, byte[] _channel_keys_id); + /** + * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream. + * This is only called during deserialization of other objects which contain + * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). + * The bytes are exactly those which `::write()` writes, and + * contain no versioning scheme. You may wish to include your own version prefix and ensure + * you've read all of the provided bytes to ensure no corruption occurred. + * + * This method is slowly being phased out -- it will only be called when reading objects + * written by LDK versions prior to 0.0.113. + * + * [`Signer`]: Self::Signer + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + */ + Result_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] _reader); + /** + * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. + * + * If this function returns an error, this will result in a channel failing to open. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ + Result_ScriptNoneZ get_destination_script(); + /** + * Get a script pubkey which we will send funds to when closing a channel. + * + * If this function returns an error, this will result in a channel failing to open or close. + * In the event of a failure when the counterparty is initiating a close, this can result in a + * channel force close. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ + Result_ShutdownScriptNoneZ get_shutdown_scriptpubkey(); + } + private class LDKSignerProviderHolder { internal SignerProvider held; } + private class LDKSignerProviderImpl : bindings.LDKSignerProvider { + internal LDKSignerProviderImpl(SignerProviderInterface arg, LDKSignerProviderHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private SignerProviderInterface arg; + private LDKSignerProviderHolder impl_holder; + public byte[] generate_channel_keys_id(bool _inbound, long _channel_value_satoshis, byte[] _user_channel_id) { + org.ldk.util.UInt128 _user_channel_id_conv = new org.ldk.util.UInt128(_user_channel_id); + byte[] ret = arg.generate_channel_keys_id(_inbound, _channel_value_satoshis, _user_channel_id_conv); + GC.KeepAlive(arg); + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; + } + public long derive_channel_signer(long _channel_value_satoshis, byte[] _channel_keys_id) { + WriteableEcdsaChannelSigner ret = arg.derive_channel_signer(_channel_value_satoshis, _channel_keys_id); + GC.KeepAlive(arg); + long result = ret.clone_ptr(); + if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; + return result; + } + public long read_chan_signer(byte[] _reader) { + Result_WriteableEcdsaChannelSignerDecodeErrorZ ret = arg.read_chan_signer(_reader); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long get_destination_script() { + Result_ScriptNoneZ ret = arg.get_destination_script(); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long get_shutdown_scriptpubkey() { + Result_ShutdownScriptNoneZ ret = arg.get_shutdown_scriptpubkey(); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + } + public static SignerProvider new_impl(SignerProviderInterface arg) { + LDKSignerProviderHolder impl_holder = new LDKSignerProviderHolder(); + impl_holder.held = new SignerProvider(new LDKSignerProviderImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through + * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow + * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated + * `channel_keys_id`. + * + * This method must return a different value each time it is called. + */ + public byte[] generate_channel_keys_id(bool inbound, long channel_value_satoshis, org.ldk.util.UInt128 user_channel_id) { + byte[] ret = bindings.SignerProvider_generate_channel_keys_id(this.ptr, inbound, channel_value_satoshis, user_channel_id.getLEBytes()); + GC.KeepAlive(this); + GC.KeepAlive(inbound); + GC.KeepAlive(channel_value_satoshis); + GC.KeepAlive(user_channel_id); + return ret; + } + + /** + * Derives the private key material backing a `Signer`. + * + * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through + * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be + * re-derived from its `channel_keys_id`, which can be obtained through its trait method + * [`ChannelSigner::channel_keys_id`]. + */ + public WriteableEcdsaChannelSigner derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { + long ret = bindings.SignerProvider_derive_channel_signer(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); + GC.KeepAlive(this); + GC.KeepAlive(channel_value_satoshis); + GC.KeepAlive(channel_keys_id); + if (ret >= 0 && ret <= 4096) { return null; } + WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream. + * This is only called during deserialization of other objects which contain + * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). + * The bytes are exactly those which `::write()` writes, and + * contain no versioning scheme. You may wish to include your own version prefix and ensure + * you've read all of the provided bytes to ensure no corruption occurred. + * + * This method is slowly being phased out -- it will only be called when reading objects + * written by LDK versions prior to 0.0.113. + * + * [`Signer`]: Self::Signer + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + */ + public Result_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer(byte[] reader) { + long ret = bindings.SignerProvider_read_chan_signer(this.ptr, reader); + GC.KeepAlive(this); + GC.KeepAlive(reader); + if (ret >= 0 && ret <= 4096) { return null; } + Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. + * + * If this function returns an error, this will result in a channel failing to open. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ + public Result_ScriptNoneZ get_destination_script() { + long ret = bindings.SignerProvider_get_destination_script(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScriptNoneZ ret_hu_conv = Result_ScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Get a script pubkey which we will send funds to when closing a channel. + * + * If this function returns an error, this will result in a channel failing to open or close. + * In the event of a failure when the counterparty is initiating a close, this can result in a + * channel force close. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ + public Result_ShutdownScriptNoneZ get_shutdown_scriptpubkey() { + long ret = bindings.SignerProvider_get_shutdown_scriptpubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ShutdownScriptNoneZ ret_hu_conv = Result_ShutdownScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Sleeper.cs b/c_sharp/src/org/ldk/structs/Sleeper.cs new file mode 100644 index 00000000..348a692d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Sleeper.cs @@ -0,0 +1,81 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A struct which can be used to select across many [`Future`]s at once without relying on a full + * async context. + */ +public class Sleeper : CommonBase { + internal Sleeper(object _dummy, long ptr) : base(ptr) { } + ~Sleeper() { + if (ptr != 0) { bindings.Sleeper_free(ptr); } + } + + /** + * Constructs a new sleeper from one future, allowing blocking on it. + */ + public static Sleeper from_single_future(org.ldk.structs.Future future) { + long ret = bindings.Sleeper_from_single_future(future == null ? 0 : future.ptr); + GC.KeepAlive(future); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Sleeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sleeper(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(future); }; + return ret_hu_conv; + } + + /** + * Constructs a new sleeper from two futures, allowing blocking on both at once. + */ + public static Sleeper from_two_futures(org.ldk.structs.Future fut_a, org.ldk.structs.Future fut_b) { + long ret = bindings.Sleeper_from_two_futures(fut_a == null ? 0 : fut_a.ptr, fut_b == null ? 0 : fut_b.ptr); + GC.KeepAlive(fut_a); + GC.KeepAlive(fut_b); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Sleeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sleeper(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fut_a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fut_b); }; + return ret_hu_conv; + } + + /** + * Constructs a new sleeper on many futures, allowing blocking on all at once. + */ + public static Sleeper of(Future[] futures) { + long ret = bindings.Sleeper_new(futures != null ? InternalUtils.mapArray(futures, futures_conv_8 => futures_conv_8 == null ? 0 : futures_conv_8.ptr) : null); + GC.KeepAlive(futures); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Sleeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sleeper(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + foreach (Future futures_conv_8 in futures) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(futures_conv_8); }; }; + return ret_hu_conv; + } + + /** + * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed. + */ + public void wait() { + bindings.Sleeper_wait(this.ptr); + GC.KeepAlive(this); + } + + /** + * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the + * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time + * elapsed. + */ + public bool wait_timeout(long max_wait) { + bool ret = bindings.Sleeper_wait_timeout(this.ptr, max_wait); + GC.KeepAlive(this); + GC.KeepAlive(max_wait); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/SocketDescriptor.cs b/c_sharp/src/org/ldk/structs/SocketDescriptor.cs index 26286cd3..3dead289 100644 --- a/c_sharp/src/org/ldk/structs/SocketDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/SocketDescriptor.cs @@ -10,7 +10,7 @@ namespace org { namespace ldk { namespace structs { * to a remote host. You will need to be able to generate multiple of these which meet Eq and * implement Hash to meet the PeerManager API. * - * For efficiency, Clone should be relatively cheap for this type. + * For efficiency, [`Clone`] should be relatively cheap for this type. * * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it diff --git a/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs index f349e6f8..54bdbb22 100644 --- a/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs @@ -14,7 +14,7 @@ namespace org { namespace ldk { namespace structs { * outpoint describing which `txid` and output `index` is available, the full output which exists * at that `txid`/`index`, and any keys or other information required to sign. * - * [`SpendableOutputs`]: crate::util::events::Event::SpendableOutputs + * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs */ public class SpendableOutputDescriptor : CommonBase { protected SpendableOutputDescriptor(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs index 63e6bddf..b302baa1 100644 --- a/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs @@ -41,8 +41,6 @@ public class StaticPaymentOutputDescriptor : CommonBase { /** * The output which is referenced by the given outpoint. - * - * Returns a copy of the field. */ public TxOut get_output() { long ret = bindings.StaticPaymentOutputDescriptor_get_output(this.ptr); @@ -62,7 +60,7 @@ public class StaticPaymentOutputDescriptor : CommonBase { } /** - * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`]. * This may be useful in re-deriving keys used in the channel to spend the output. */ public byte[] get_channel_keys_id() { @@ -72,7 +70,7 @@ public class StaticPaymentOutputDescriptor : CommonBase { } /** - * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`]. * This may be useful in re-deriving keys used in the channel to spend the output. */ public void set_channel_keys_id(byte[] val) { diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.cs index a07500a4..b99b2910 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.cs @@ -84,6 +84,7 @@ public class ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ : CommonBase { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ ret_hu_conv = new ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + foreach (MonitorEvent b_conv_14 in b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_conv_14); }; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs new file mode 100644 index 00000000..dfaa86e3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs @@ -0,0 +1,87 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ : CommonBase { + internal ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(object _dummy, long ptr) : base(ptr) { } + ~ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ() { + if (ptr != 0) { bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(ptr); } + } + + /** + * + */ + public RawBolt11Invoice get_a() { + long ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawBolt11Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public byte[] get_b() { + byte[] ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_b(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * + */ + public Bolt11InvoiceSignature get_c() { + long ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_get_c(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceSignature(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ clone() { + long ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements. + */ + public static ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ of(org.ldk.structs.RawBolt11Invoice a, byte[] b, org.ldk.structs.Bolt11InvoiceSignature c) { + long ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a == null ? 0 : a.ptr, InternalUtils.check_arr_len(b, 32), c == null ? 0 : c.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + GC.KeepAlive(c); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.cs deleted file mode 100644 index 54d989da..00000000 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.cs +++ /dev/null @@ -1,87 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A Tuple - */ -public class ThreeTuple_RawInvoice_u832InvoiceSignatureZ : CommonBase { - internal ThreeTuple_RawInvoice_u832InvoiceSignatureZ(object _dummy, long ptr) : base(ptr) { } - ~ThreeTuple_RawInvoice_u832InvoiceSignatureZ() { - if (ptr != 0) { bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(ptr); } - } - - /** - * - */ - public RawInvoice get_a() { - long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawInvoice(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * - */ - public byte[] get_b() { - byte[] ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * - */ - public InvoiceSignature get_c() { - long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public ThreeTuple_RawInvoice_u832InvoiceSignatureZ clone() { - long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements. - */ - public static ThreeTuple_RawInvoice_u832InvoiceSignatureZ of(org.ldk.structs.RawInvoice a, byte[] b, org.ldk.structs.InvoiceSignature c) { - long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a == null ? 0 : a.ptr, InternalUtils.check_arr_len(b, 32), c == null ? 0 : c.ptr); - GC.KeepAlive(a); - GC.KeepAlive(b); - GC.KeepAlive(c); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs new file mode 100644 index 00000000..a22f1479 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs @@ -0,0 +1,99 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`] + * if the `Transaction`'s consensus-serialized length is <= u16::MAX. + * + * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`. + */ +public class TransactionU16LenLimited : CommonBase { + internal TransactionU16LenLimited(object _dummy, long ptr) : base(ptr) { } + ~TransactionU16LenLimited() { + if (ptr != 0) { bindings.TransactionU16LenLimited_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.TransactionU16LenLimited_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TransactionU16LenLimited + */ + public TransactionU16LenLimited clone() { + long ret = bindings.TransactionU16LenLimited_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TransactionU16LenLimited ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TransactionU16LenLimited(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TransactionU16LenLimiteds contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TransactionU16LenLimited b) { + bool ret = bindings.TransactionU16LenLimited_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TransactionU16LenLimited)) return false; + return this.eq((TransactionU16LenLimited)o); + } + /** + * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus- + * serialized length is <= u16::MAX. + */ + public static Result_TransactionU16LenLimitedNoneZ of(byte[] transaction) { + long ret = bindings.TransactionU16LenLimited_new(transaction); + GC.KeepAlive(transaction); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedNoneZ ret_hu_conv = Result_TransactionU16LenLimitedNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`. + */ + public byte[] into_transaction() { + byte[] ret = bindings.TransactionU16LenLimited_into_transaction(this.ptr); + GC.KeepAlive(this); + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret; + } + + /** + * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read + */ + public byte[] write() { + byte[] ret = bindings.TransactionU16LenLimited_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write + */ + public static Result_TransactionU16LenLimitedDecodeErrorZ read(byte[] ser) { + long ret = bindings.TransactionU16LenLimited_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs index d15bed30..638e16f3 100644 --- a/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs @@ -56,10 +56,13 @@ public class TrustedCommitmentTransaction : CommonBase { /** * Should anchors be used. */ - public bool opt_anchors() { - bool ret = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr); + public ChannelTypeFeatures channel_type_features() { + long ret = bindings.TrustedCommitmentTransaction_channel_type_features(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** @@ -70,14 +73,16 @@ public class TrustedCommitmentTransaction : CommonBase { * * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All. */ - public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters) { - long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr); + public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source.ptr); GC.KeepAlive(this); GC.KeepAlive(htlc_base_key); GC.KeepAlive(channel_parameters); + GC.KeepAlive(entropy_source); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(channel_parameters); }; + if (this != null) { this.ptrs_to.AddLast(entropy_source); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs new file mode 100644 index 00000000..45bce528 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs @@ -0,0 +1,77 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_BlindedPayInfoBlindedPathZ : CommonBase { + internal TwoTuple_BlindedPayInfoBlindedPathZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_BlindedPayInfoBlindedPathZ() { + if (ptr != 0) { bindings.C2Tuple_BlindedPayInfoBlindedPathZ_free(ptr); } + } + + /** + * + */ + public BlindedPayInfo get_a() { + long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public BlindedPath get_b() { + long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_BlindedPayInfoBlindedPathZ clone() { + long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_BlindedPayInfoBlindedPathZ ret_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements. + */ + public static TwoTuple_BlindedPayInfoBlindedPathZ of(org.ldk.structs.BlindedPayInfo a, org.ldk.structs.BlindedPath b) { + long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_new(a == null ? 0 : a.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_BlindedPayInfoBlindedPathZ ret_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.cs index 5a3f91f3..8267f203 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.cs @@ -39,24 +39,31 @@ public class TwoTuple_BlockHashChannelManagerZ : CommonBase { /** * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements. */ - public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Logger b_logger, KeysInterface b_keys_manager, UserConfig b_config, ChainParameters b_params) { - long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr)); + public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Router b_router, Logger b_logger, EntropySource b_entropy_source, NodeSigner b_node_signer, SignerProvider b_signer_provider, UserConfig b_config, ChainParameters b_params, int b_current_timestamp) { + long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr, b_current_timestamp)); GC.KeepAlive(a); GC.KeepAlive(b_fee_est); GC.KeepAlive(b_chain_monitor); GC.KeepAlive(b_tx_broadcaster); + GC.KeepAlive(b_router); GC.KeepAlive(b_logger); - GC.KeepAlive(b_keys_manager); + GC.KeepAlive(b_entropy_source); + GC.KeepAlive(b_node_signer); + GC.KeepAlive(b_signer_provider); GC.KeepAlive(b_config); GC.KeepAlive(b_params); + GC.KeepAlive(b_current_timestamp); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_BlockHashChannelManagerZ ret_hu_conv = new TwoTuple_BlockHashChannelManagerZ(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_fee_est); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_tx_broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_logger); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_signer_provider); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_config); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_params); }; return ret_hu_conv; diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_PartiallySignedTransactionusizeZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_PartiallySignedTransactionusizeZ.cs new file mode 100644 index 00000000..b2b3bb34 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_PartiallySignedTransactionusizeZ.cs @@ -0,0 +1,69 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_PartiallySignedTransactionusizeZ : CommonBase { + internal TwoTuple_PartiallySignedTransactionusizeZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_PartiallySignedTransactionusizeZ() { + if (ptr != 0) { bindings.C2Tuple_PartiallySignedTransactionusizeZ_free(ptr); } + } + + /** + * + */ + public byte[] get_a() { + byte[] ret = bindings.C2Tuple_PartiallySignedTransactionusizeZ_get_a(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * + */ + public long get_b() { + long ret = bindings.C2Tuple_PartiallySignedTransactionusizeZ_get_b(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_PartiallySignedTransactionusizeZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_PartiallySignedTransactionusizeZ clone() { + long ret = bindings.C2Tuple_PartiallySignedTransactionusizeZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_PartiallySignedTransactionusizeZ ret_hu_conv = new TwoTuple_PartiallySignedTransactionusizeZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_PartiallySignedTransactionusizeZ from the contained elements. + */ + public static TwoTuple_PartiallySignedTransactionusizeZ of(byte[] a, long b) { + long ret = bindings.C2Tuple_PartiallySignedTransactionusizeZ_new(a, b); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_PartiallySignedTransactionusizeZ ret_hu_conv = new TwoTuple_PartiallySignedTransactionusizeZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCOption_NetAddressZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCOption_NetAddressZZ.cs new file mode 100644 index 00000000..299f4f0e --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCOption_NetAddressZZ.cs @@ -0,0 +1,73 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_PublicKeyCOption_NetAddressZZ : CommonBase { + internal TwoTuple_PublicKeyCOption_NetAddressZZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_PublicKeyCOption_NetAddressZZ() { + if (ptr != 0) { bindings.C2Tuple_PublicKeyCOption_NetAddressZZ_free(ptr); } + } + + /** + * + */ + public byte[] get_a() { + byte[] ret = bindings.C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * + */ + public Option_NetAddressZ get_b() { + long ret = bindings.C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_NetAddressZ ret_hu_conv = org.ldk.structs.Option_NetAddressZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_PublicKeyCOption_NetAddressZZ clone() { + long ret = bindings.C2Tuple_PublicKeyCOption_NetAddressZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_PublicKeyCOption_NetAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCOption_NetAddressZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_PublicKeyCOption_NetAddressZZ from the contained elements. + */ + public static TwoTuple_PublicKeyCOption_NetAddressZZ of(byte[] a, org.ldk.structs.Option_NetAddressZ b) { + long ret = bindings.C2Tuple_PublicKeyCOption_NetAddressZZ_new(InternalUtils.check_arr_len(a, 33), b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_PublicKeyCOption_NetAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCOption_NetAddressZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyTypeZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyTypeZ.cs index fca997db..4c3352fd 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyTypeZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyTypeZ.cs @@ -59,7 +59,7 @@ public class TwoTuple_PublicKeyTypeZ : CommonBase { * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements. */ public static TwoTuple_PublicKeyTypeZ of(byte[] a, org.ldk.structs.Type b) { - long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b == null ? 0 : b.ptr); + long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b.ptr); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_SignatureSignatureZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_SignatureSignatureZ.cs deleted file mode 100644 index 0736f6f6..00000000 --- a/c_sharp/src/org/ldk/structs/TwoTuple_SignatureSignatureZ.cs +++ /dev/null @@ -1,69 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A Tuple - */ -public class TwoTuple_SignatureSignatureZ : CommonBase { - internal TwoTuple_SignatureSignatureZ(object _dummy, long ptr) : base(ptr) { } - ~TwoTuple_SignatureSignatureZ() { - if (ptr != 0) { bindings.C2Tuple_SignatureSignatureZ_free(ptr); } - } - - /** - * - */ - public byte[] get_a() { - byte[] ret = bindings.C2Tuple_SignatureSignatureZ_get_a(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * - */ - public byte[] get_b() { - byte[] ret = bindings.C2Tuple_SignatureSignatureZ_get_b(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.C2Tuple_SignatureSignatureZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public TwoTuple_SignatureSignatureZ clone() { - long ret = bindings.C2Tuple_SignatureSignatureZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_SignatureSignatureZ ret_hu_conv = new TwoTuple_SignatureSignatureZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_SignatureSignatureZ from the contained elements. - */ - public static TwoTuple_SignatureSignatureZ of(byte[] a, byte[] b) { - long ret = bindings.C2Tuple_SignatureSignatureZ_new(InternalUtils.check_arr_len(a, 64), InternalUtils.check_arr_len(b, 64)); - GC.KeepAlive(a); - GC.KeepAlive(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_SignatureSignatureZ ret_hu_conv = new TwoTuple_SignatureSignatureZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_TxidBlockHashZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_TxidBlockHashZ.cs deleted file mode 100644 index 67deebb7..00000000 --- a/c_sharp/src/org/ldk/structs/TwoTuple_TxidBlockHashZ.cs +++ /dev/null @@ -1,69 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A Tuple - */ -public class TwoTuple_TxidBlockHashZ : CommonBase { - internal TwoTuple_TxidBlockHashZ(object _dummy, long ptr) : base(ptr) { } - ~TwoTuple_TxidBlockHashZ() { - if (ptr != 0) { bindings.C2Tuple_TxidBlockHashZ_free(ptr); } - } - - /** - * - */ - public byte[] get_a() { - byte[] ret = bindings.C2Tuple_TxidBlockHashZ_get_a(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * - */ - public byte[] get_b() { - byte[] ret = bindings.C2Tuple_TxidBlockHashZ_get_b(this.ptr); - GC.KeepAlive(this); - return ret; - } - - internal long clone_ptr() { - long ret = bindings.C2Tuple_TxidBlockHashZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public TwoTuple_TxidBlockHashZ clone() { - long ret = bindings.C2Tuple_TxidBlockHashZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_TxidBlockHashZ ret_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_TxidBlockHashZ from the contained elements. - */ - public static TwoTuple_TxidBlockHashZ of(byte[] a, byte[] b) { - long ret = bindings.C2Tuple_TxidBlockHashZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); - GC.KeepAlive(a); - GC.KeepAlive(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_TxidBlockHashZ ret_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_TxidCOption_BlockHashZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_TxidCOption_BlockHashZZ.cs new file mode 100644 index 00000000..7e92273f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_TxidCOption_BlockHashZZ.cs @@ -0,0 +1,73 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_TxidCOption_BlockHashZZ : CommonBase { + internal TwoTuple_TxidCOption_BlockHashZZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_TxidCOption_BlockHashZZ() { + if (ptr != 0) { bindings.C2Tuple_TxidCOption_BlockHashZZ_free(ptr); } + } + + /** + * + */ + public byte[] get_a() { + byte[] ret = bindings.C2Tuple_TxidCOption_BlockHashZZ_get_a(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * + */ + public Option_BlockHashZ get_b() { + long ret = bindings.C2Tuple_TxidCOption_BlockHashZZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_BlockHashZ ret_hu_conv = org.ldk.structs.Option_BlockHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_TxidCOption_BlockHashZZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_TxidCOption_BlockHashZZ clone() { + long ret = bindings.C2Tuple_TxidCOption_BlockHashZZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_TxidCOption_BlockHashZZ ret_hu_conv = new TwoTuple_TxidCOption_BlockHashZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_TxidCOption_BlockHashZZ from the contained elements. + */ + public static TwoTuple_TxidCOption_BlockHashZZ of(byte[] a, org.ldk.structs.Option_BlockHashZ b) { + long ret = bindings.C2Tuple_TxidCOption_BlockHashZZ_new(InternalUtils.check_arr_len(a, 32), b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_TxidCOption_BlockHashZZ ret_hu_conv = new TwoTuple_TxidCOption_BlockHashZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_Z.cs b/c_sharp/src/org/ldk/structs/TwoTuple_Z.cs new file mode 100644 index 00000000..d87410d8 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_Z.cs @@ -0,0 +1,69 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_Z : CommonBase { + internal TwoTuple_Z(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_Z() { + if (ptr != 0) { bindings.C2Tuple_Z_free(ptr); } + } + + /** + * + */ + public short[] get_a() { + short[] ret = bindings.C2Tuple_Z_get_a(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * + */ + public short[] get_b() { + short[] ret = bindings.C2Tuple_Z_get_b(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_Z_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_Z clone() { + long ret = bindings.C2Tuple_Z_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_Z ret_hu_conv = new TwoTuple_Z(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_Z from the contained elements. + */ + public static TwoTuple_Z of(short[] a, short[] b) { + long ret = bindings.C2Tuple_Z_new(InternalUtils.check_arr_len(a, 8), InternalUtils.check_arr_len(b, 8)); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_Z ret_hu_conv = new TwoTuple_Z(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple__u168_u168Z.cs b/c_sharp/src/org/ldk/structs/TwoTuple__u168_u168Z.cs new file mode 100644 index 00000000..3687af39 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple__u168_u168Z.cs @@ -0,0 +1,69 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple__u168_u168Z : CommonBase { + internal TwoTuple__u168_u168Z(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple__u168_u168Z() { + if (ptr != 0) { bindings.C2Tuple__u168_u168Z_free(ptr); } + } + + /** + * + */ + public short[] get_a() { + short[] ret = bindings.C2Tuple__u168_u168Z_get_a(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * + */ + public short[] get_b() { + short[] ret = bindings.C2Tuple__u168_u168Z_get_b(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple__u168_u168Z_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple__u168_u168Z clone() { + long ret = bindings.C2Tuple__u168_u168Z_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple__u168_u168Z ret_hu_conv = new TwoTuple__u168_u168Z(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple__u168_u168Z from the contained elements. + */ + public static TwoTuple__u168_u168Z of(short[] a, short[] b) { + long ret = bindings.C2Tuple__u168_u168Z_new(InternalUtils.check_arr_len(a, 8), InternalUtils.check_arr_len(b, 8)); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple__u168_u168Z ret_hu_conv = new TwoTuple__u168_u168Z(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxAbort.cs b/c_sharp/src/org/ldk/structs/TxAbort.cs new file mode 100644 index 00000000..f526bfe2 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxAbort.cs @@ -0,0 +1,125 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_abort message which signals the cancellation of an in-progress transaction negotiation. + */ +public class TxAbort : CommonBase { + internal TxAbort(object _dummy, long ptr) : base(ptr) { } + ~TxAbort() { + if (ptr != 0) { bindings.TxAbort_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxAbort_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxAbort_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Message data + * + * Returns a copy of the field. + */ + public byte[] get_data() { + byte[] ret = bindings.TxAbort_get_data(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Message data + */ + public void set_data(byte[] val) { + bindings.TxAbort_set_data(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TxAbort given each field + */ + public static TxAbort of(byte[] channel_id_arg, byte[] data_arg) { + long ret = bindings.TxAbort_new(InternalUtils.check_arr_len(channel_id_arg, 32), data_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(data_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAbort ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAbort(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxAbort_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxAbort + */ + public TxAbort clone() { + long ret = bindings.TxAbort_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAbort ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAbort(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxAborts contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxAbort b) { + bool ret = bindings.TxAbort_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxAbort)) return false; + return this.eq((TxAbort)o); + } + /** + * Serialize the TxAbort object into a byte array which can be read by TxAbort_read + */ + public byte[] write() { + byte[] ret = bindings.TxAbort_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxAbort from a byte array, created by TxAbort_write + */ + public static Result_TxAbortDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxAbort_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxAckRbf.cs b/c_sharp/src/org/ldk/structs/TxAckRbf.cs new file mode 100644 index 00000000..42811918 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxAckRbf.cs @@ -0,0 +1,131 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been + * completed. + */ +public class TxAckRbf : CommonBase { + internal TxAckRbf(object _dummy, long ptr) : base(ptr) { } + ~TxAckRbf() { + if (ptr != 0) { bindings.TxAckRbf_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxAckRbf_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxAckRbf_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The number of satoshis the sender will contribute to or, if negative, remove from + * (e.g. splice-out) the funding output of the transaction + */ + public Option_i64Z get_funding_output_contribution() { + long ret = bindings.TxAckRbf_get_funding_output_contribution(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The number of satoshis the sender will contribute to or, if negative, remove from + * (e.g. splice-out) the funding output of the transaction + */ + public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) { + bindings.TxAckRbf_set_funding_output_contribution(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new TxAckRbf given each field + */ + public static TxAckRbf of(byte[] channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { + long ret = bindings.TxAckRbf_new(InternalUtils.check_arr_len(channel_id_arg, 32), funding_output_contribution_arg.ptr); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(funding_output_contribution_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxAckRbf_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxAckRbf + */ + public TxAckRbf clone() { + long ret = bindings.TxAckRbf_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxAckRbfs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxAckRbf b) { + bool ret = bindings.TxAckRbf_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxAckRbf)) return false; + return this.eq((TxAckRbf)o); + } + /** + * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read + */ + public byte[] write() { + byte[] ret = bindings.TxAckRbf_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxAckRbf from a byte array, created by TxAckRbf_write + */ + public static Result_TxAckRbfDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxAckRbf_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxAddInput.cs b/c_sharp/src/org/ldk/structs/TxAddInput.cs new file mode 100644 index 00000000..6ee743b1 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxAddInput.cs @@ -0,0 +1,189 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_add_input message for adding an input during interactive transaction construction + */ +public class TxAddInput : CommonBase { + internal TxAddInput(object _dummy, long ptr) : base(ptr) { } + ~TxAddInput() { + if (ptr != 0) { bindings.TxAddInput_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxAddInput_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxAddInput_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A randomly chosen unique identifier for this input, which is even for initiators and odd for + * non-initiators. + */ + public long get_serial_id() { + long ret = bindings.TxAddInput_get_serial_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A randomly chosen unique identifier for this input, which is even for initiators and odd for + * non-initiators. + */ + public void set_serial_id(long val) { + bindings.TxAddInput_set_serial_id(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Serialized transaction that contains the output this input spends to verify that it is non + * malleable. + */ + public TransactionU16LenLimited get_prevtx() { + long ret = bindings.TxAddInput_get_prevtx(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TransactionU16LenLimited ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TransactionU16LenLimited(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Serialized transaction that contains the output this input spends to verify that it is non + * malleable. + */ + public void set_prevtx(org.ldk.structs.TransactionU16LenLimited val) { + bindings.TxAddInput_set_prevtx(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The index of the output being spent + */ + public int get_prevtx_out() { + int ret = bindings.TxAddInput_get_prevtx_out(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The index of the output being spent + */ + public void set_prevtx_out(int val) { + bindings.TxAddInput_set_prevtx_out(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The sequence number of this input + */ + public int get_sequence() { + int ret = bindings.TxAddInput_get_sequence(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The sequence number of this input + */ + public void set_sequence(int val) { + bindings.TxAddInput_set_sequence(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TxAddInput given each field + */ + public static TxAddInput of(byte[] channel_id_arg, long serial_id_arg, org.ldk.structs.TransactionU16LenLimited prevtx_arg, int prevtx_out_arg, int sequence_arg) { + long ret = bindings.TxAddInput_new(InternalUtils.check_arr_len(channel_id_arg, 32), serial_id_arg, prevtx_arg == null ? 0 : prevtx_arg.ptr, prevtx_out_arg, sequence_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(serial_id_arg); + GC.KeepAlive(prevtx_arg); + GC.KeepAlive(prevtx_out_arg); + GC.KeepAlive(sequence_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prevtx_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxAddInput_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxAddInput + */ + public TxAddInput clone() { + long ret = bindings.TxAddInput_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxAddInputs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxAddInput b) { + bool ret = bindings.TxAddInput_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxAddInput)) return false; + return this.eq((TxAddInput)o); + } + /** + * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read + */ + public byte[] write() { + byte[] ret = bindings.TxAddInput_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxAddInput from a byte array, created by TxAddInput_write + */ + public static Result_TxAddInputDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxAddInput_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxAddOutput.cs b/c_sharp/src/org/ldk/structs/TxAddOutput.cs new file mode 100644 index 00000000..7b31d9e1 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxAddOutput.cs @@ -0,0 +1,163 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_add_output message for adding an output during interactive transaction construction. + */ +public class TxAddOutput : CommonBase { + internal TxAddOutput(object _dummy, long ptr) : base(ptr) { } + ~TxAddOutput() { + if (ptr != 0) { bindings.TxAddOutput_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxAddOutput_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxAddOutput_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A randomly chosen unique identifier for this output, which is even for initiators and odd for + * non-initiators. + */ + public long get_serial_id() { + long ret = bindings.TxAddOutput_get_serial_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * A randomly chosen unique identifier for this output, which is even for initiators and odd for + * non-initiators. + */ + public void set_serial_id(long val) { + bindings.TxAddOutput_set_serial_id(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The satoshi value of the output + */ + public long get_sats() { + long ret = bindings.TxAddOutput_get_sats(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The satoshi value of the output + */ + public void set_sats(long val) { + bindings.TxAddOutput_set_sats(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The scriptPubKey for the output + */ + public byte[] get_script() { + byte[] ret = bindings.TxAddOutput_get_script(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The scriptPubKey for the output + */ + public void set_script(byte[] val) { + bindings.TxAddOutput_set_script(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TxAddOutput given each field + */ + public static TxAddOutput of(byte[] channel_id_arg, long serial_id_arg, long sats_arg, byte[] script_arg) { + long ret = bindings.TxAddOutput_new(InternalUtils.check_arr_len(channel_id_arg, 32), serial_id_arg, sats_arg, script_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(serial_id_arg); + GC.KeepAlive(sats_arg); + GC.KeepAlive(script_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAddOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddOutput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxAddOutput_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxAddOutput + */ + public TxAddOutput clone() { + long ret = bindings.TxAddOutput_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxAddOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddOutput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxAddOutputs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxAddOutput b) { + bool ret = bindings.TxAddOutput_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxAddOutput)) return false; + return this.eq((TxAddOutput)o); + } + /** + * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read + */ + public byte[] write() { + byte[] ret = bindings.TxAddOutput_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxAddOutput from a byte array, created by TxAddOutput_write + */ + public static Result_TxAddOutputDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxAddOutput_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxComplete.cs b/c_sharp/src/org/ldk/structs/TxComplete.cs new file mode 100644 index 00000000..3cc12feb --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxComplete.cs @@ -0,0 +1,105 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_complete message signalling the conclusion of a peer's transaction contributions during + * interactive transaction construction. + */ +public class TxComplete : CommonBase { + internal TxComplete(object _dummy, long ptr) : base(ptr) { } + ~TxComplete() { + if (ptr != 0) { bindings.TxComplete_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxComplete_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxComplete_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TxComplete given each field + */ + public static TxComplete of(byte[] channel_id_arg) { + long ret = bindings.TxComplete_new(InternalUtils.check_arr_len(channel_id_arg, 32)); + GC.KeepAlive(channel_id_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxComplete_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxComplete + */ + public TxComplete clone() { + long ret = bindings.TxComplete_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxCompletes contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxComplete b) { + bool ret = bindings.TxComplete_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxComplete)) return false; + return this.eq((TxComplete)o); + } + /** + * Serialize the TxComplete object into a byte array which can be read by TxComplete_read + */ + public byte[] write() { + byte[] ret = bindings.TxComplete_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxComplete from a byte array, created by TxComplete_write + */ + public static Result_TxCompleteDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxComplete_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxIn.cs b/c_sharp/src/org/ldk/structs/TxIn.cs new file mode 100644 index 00000000..08e10a78 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxIn.cs @@ -0,0 +1,33 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class TxIn : CommonBase { + /** The witness in this input, in serialized form */ + public readonly byte[] witness; + /** The script_sig in this input */ + public readonly byte[] script_sig; + /** The transaction output's sequence number */ + public readonly int sequence; + /** The txid this input is spending */ + public readonly byte[] previous_txid; + /** The output index within the spent transaction of the output this input is spending */ + public readonly int previous_vout; + + internal TxIn(object _dummy, long ptr) : base(ptr) { + this.witness = bindings.TxIn_get_witness(ptr); + this.script_sig = bindings.TxIn_get_script_sig(ptr); + this.sequence = bindings.TxIn_get_sequence(ptr); + this.previous_txid = bindings.TxIn_get_previous_txid(ptr); + this.previous_vout = bindings.TxIn_get_previous_vout(ptr); + } + public TxIn(byte[] witness, byte[] script_sig, int sequence, byte[] previous_txid, int previous_vout) + : this(null, bindings.TxIn_new(witness, script_sig, sequence, previous_txid, previous_vout)) {} + + ~TxIn() { + if (ptr != 0) { bindings.TxIn_free(ptr); } + } +}} } } diff --git a/c_sharp/src/org/ldk/structs/TxInitRbf.cs b/c_sharp/src/org/ldk/structs/TxInitRbf.cs new file mode 100644 index 00000000..cb62c65e --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxInitRbf.cs @@ -0,0 +1,169 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_init_rbf message which initiates a replacement of the transaction after it's been + * completed. + */ +public class TxInitRbf : CommonBase { + internal TxInitRbf(object _dummy, long ptr) : base(ptr) { } + ~TxInitRbf() { + if (ptr != 0) { bindings.TxInitRbf_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxInitRbf_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxInitRbf_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The locktime of the transaction + */ + public int get_locktime() { + int ret = bindings.TxInitRbf_get_locktime(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The locktime of the transaction + */ + public void set_locktime(int val) { + bindings.TxInitRbf_set_locktime(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The feerate of the transaction + */ + public int get_feerate_sat_per_1000_weight() { + int ret = bindings.TxInitRbf_get_feerate_sat_per_1000_weight(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The feerate of the transaction + */ + public void set_feerate_sat_per_1000_weight(int val) { + bindings.TxInitRbf_set_feerate_sat_per_1000_weight(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The number of satoshis the sender will contribute to or, if negative, remove from + * (e.g. splice-out) the funding output of the transaction + */ + public Option_i64Z get_funding_output_contribution() { + long ret = bindings.TxInitRbf_get_funding_output_contribution(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The number of satoshis the sender will contribute to or, if negative, remove from + * (e.g. splice-out) the funding output of the transaction + */ + public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) { + bindings.TxInitRbf_set_funding_output_contribution(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new TxInitRbf given each field + */ + public static TxInitRbf of(byte[] channel_id_arg, int locktime_arg, int feerate_sat_per_1000_weight_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { + long ret = bindings.TxInitRbf_new(InternalUtils.check_arr_len(channel_id_arg, 32), locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg.ptr); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(locktime_arg); + GC.KeepAlive(feerate_sat_per_1000_weight_arg); + GC.KeepAlive(funding_output_contribution_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxInitRbf_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxInitRbf + */ + public TxInitRbf clone() { + long ret = bindings.TxInitRbf_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxInitRbfs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxInitRbf b) { + bool ret = bindings.TxInitRbf_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxInitRbf)) return false; + return this.eq((TxInitRbf)o); + } + /** + * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read + */ + public byte[] write() { + byte[] ret = bindings.TxInitRbf_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxInitRbf from a byte array, created by TxInitRbf_write + */ + public static Result_TxInitRbfDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxInitRbf_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxOut.cs b/c_sharp/src/org/ldk/structs/TxOut.cs index 5e4b89a1..5df7f3f7 100644 --- a/c_sharp/src/org/ldk/structs/TxOut.cs +++ b/c_sharp/src/org/ldk/structs/TxOut.cs @@ -15,10 +15,7 @@ public class TxOut : CommonBase { this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr); this.value = bindings.TxOut_get_value(ptr); } - public TxOut(long value, byte[] script_pubkey) : base(bindings.TxOut_new(script_pubkey, value)) { - this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr); - this.value = bindings.TxOut_get_value(ptr); - } + public TxOut(long value, byte[] script_pubkey) : this(null, bindings.TxOut_new(script_pubkey, value)) {} ~TxOut() { if (ptr != 0) { bindings.TxOut_free(ptr); } diff --git a/c_sharp/src/org/ldk/structs/TxRemoveInput.cs b/c_sharp/src/org/ldk/structs/TxRemoveInput.cs new file mode 100644 index 00000000..6855aa25 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxRemoveInput.cs @@ -0,0 +1,123 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_remove_input message for removing an input during interactive transaction construction. + */ +public class TxRemoveInput : CommonBase { + internal TxRemoveInput(object _dummy, long ptr) : base(ptr) { } + ~TxRemoveInput() { + if (ptr != 0) { bindings.TxRemoveInput_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxRemoveInput_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxRemoveInput_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The serial ID of the input to be removed + */ + public long get_serial_id() { + long ret = bindings.TxRemoveInput_get_serial_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The serial ID of the input to be removed + */ + public void set_serial_id(long val) { + bindings.TxRemoveInput_set_serial_id(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TxRemoveInput given each field + */ + public static TxRemoveInput of(byte[] channel_id_arg, long serial_id_arg) { + long ret = bindings.TxRemoveInput_new(InternalUtils.check_arr_len(channel_id_arg, 32), serial_id_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(serial_id_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxRemoveInput_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxRemoveInput + */ + public TxRemoveInput clone() { + long ret = bindings.TxRemoveInput_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxRemoveInputs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxRemoveInput b) { + bool ret = bindings.TxRemoveInput_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxRemoveInput)) return false; + return this.eq((TxRemoveInput)o); + } + /** + * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read + */ + public byte[] write() { + byte[] ret = bindings.TxRemoveInput_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write + */ + public static Result_TxRemoveInputDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxRemoveInput_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs b/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs new file mode 100644 index 00000000..469983e8 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs @@ -0,0 +1,123 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_remove_output message for removing an output during interactive transaction construction. + */ +public class TxRemoveOutput : CommonBase { + internal TxRemoveOutput(object _dummy, long ptr) : base(ptr) { } + ~TxRemoveOutput() { + if (ptr != 0) { bindings.TxRemoveOutput_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxRemoveOutput_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxRemoveOutput_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The serial ID of the output to be removed + */ + public long get_serial_id() { + long ret = bindings.TxRemoveOutput_get_serial_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The serial ID of the output to be removed + */ + public void set_serial_id(long val) { + bindings.TxRemoveOutput_set_serial_id(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TxRemoveOutput given each field + */ + public static TxRemoveOutput of(byte[] channel_id_arg, long serial_id_arg) { + long ret = bindings.TxRemoveOutput_new(InternalUtils.check_arr_len(channel_id_arg, 32), serial_id_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(serial_id_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxRemoveOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveOutput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxRemoveOutput_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxRemoveOutput + */ + public TxRemoveOutput clone() { + long ret = bindings.TxRemoveOutput_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxRemoveOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveOutput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxRemoveOutputs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxRemoveOutput b) { + bool ret = bindings.TxRemoveOutput_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxRemoveOutput)) return false; + return this.eq((TxRemoveOutput)o); + } + /** + * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read + */ + public byte[] write() { + byte[] ret = bindings.TxRemoveOutput_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write + */ + public static Result_TxRemoveOutputDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxRemoveOutput_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TxSignatures.cs b/c_sharp/src/org/ldk/structs/TxSignatures.cs new file mode 100644 index 00000000..b2210bfe --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TxSignatures.cs @@ -0,0 +1,145 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A tx_signatures message containing the sender's signatures for a transaction constructed with + * interactive transaction construction. + */ +public class TxSignatures : CommonBase { + internal TxSignatures(object _dummy, long ptr) : base(ptr) { } + ~TxSignatures() { + if (ptr != 0) { bindings.TxSignatures_free(ptr); } + } + + /** + * The channel ID + */ + public byte[] get_channel_id() { + byte[] ret = bindings.TxSignatures_get_channel_id(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel ID + */ + public void set_channel_id(byte[] val) { + bindings.TxSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The TXID + */ + public byte[] get_tx_hash() { + byte[] ret = bindings.TxSignatures_get_tx_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The TXID + */ + public void set_tx_hash(byte[] val) { + bindings.TxSignatures_set_tx_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The list of witnesses + * + * Returns a copy of the field. + */ + public byte[][] get_witnesses() { + byte[][] ret = bindings.TxSignatures_get_witnesses(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The list of witnesses + */ + public void set_witnesses(byte[][] val) { + bindings.TxSignatures_set_witnesses(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TxSignatures given each field + */ + public static TxSignatures of(byte[] channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg) { + long ret = bindings.TxSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(tx_hash_arg, 32), witnesses_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(tx_hash_arg); + GC.KeepAlive(witnesses_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TxSignatures_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TxSignatures + */ + public TxSignatures clone() { + long ret = bindings.TxSignatures_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TxSignaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TxSignatures b) { + bool ret = bindings.TxSignatures_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TxSignatures)) return false; + return this.eq((TxSignatures)o); + } + /** + * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read + */ + public byte[] write() { + byte[] ret = bindings.TxSignatures_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a TxSignatures from a byte array, created by TxSignatures_write + */ + public static Result_TxSignaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.TxSignatures_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs b/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs new file mode 100644 index 00000000..f9855541 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs @@ -0,0 +1,28 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A semantically valid [`Bolt12Invoice`] that hasn't been signed. + */ +public class UnsignedBolt12Invoice : CommonBase { + internal UnsignedBolt12Invoice(object _dummy, long ptr) : base(ptr) { } + ~UnsignedBolt12Invoice() { + if (ptr != 0) { bindings.UnsignedBolt12Invoice_free(ptr); } + } + + /** + * The public key corresponding to the key needed to sign the invoice. + */ + public byte[] signing_pubkey() { + byte[] ret = bindings.UnsignedBolt12Invoice_signing_pubkey(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs b/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs index 63a8c1cc..89308cb8 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * The unsigned part of a channel_announcement + * The unsigned part of a [`channel_announcement`] message. + * + * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message */ public class UnsignedChannelAnnouncement : CommonBase { internal UnsignedChannelAnnouncement(object _dummy, long ptr) : base(ptr) { } @@ -74,75 +76,91 @@ public class UnsignedChannelAnnouncement : CommonBase { } /** - * One of the two node_ids which are endpoints of this channel + * One of the two `node_id`s which are endpoints of this channel */ - public byte[] get_node_id_1() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr); + public NodeId get_node_id_1() { + long ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * One of the two node_ids which are endpoints of this channel + * One of the two `node_id`s which are endpoints of this channel */ - public void set_node_id_1(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, InternalUtils.check_arr_len(val, 33)); + public void set_node_id_1(org.ldk.structs.NodeId val) { + bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** - * The other of the two node_ids which are endpoints of this channel + * The other of the two `node_id`s which are endpoints of this channel */ - public byte[] get_node_id_2() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr); + public NodeId get_node_id_2() { + long ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * The other of the two node_ids which are endpoints of this channel + * The other of the two `node_id`s which are endpoints of this channel */ - public void set_node_id_2(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, InternalUtils.check_arr_len(val, 33)); + public void set_node_id_2(org.ldk.structs.NodeId val) { + bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** * The funding key for the first node */ - public byte[] get_bitcoin_key_1() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr); + public NodeId get_bitcoin_key_1() { + long ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The funding key for the first node */ - public void set_bitcoin_key_1(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, InternalUtils.check_arr_len(val, 33)); + public void set_bitcoin_key_1(org.ldk.structs.NodeId val) { + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** * The funding key for the second node */ - public byte[] get_bitcoin_key_2() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr); + public NodeId get_bitcoin_key_2() { + long ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The funding key for the second node */ - public void set_bitcoin_key_2(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, InternalUtils.check_arr_len(val, 33)); + public void set_bitcoin_key_2(org.ldk.structs.NodeId val) { + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } internal long clone_ptr() { diff --git a/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs b/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs index 2dc601e5..41705bea 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * The unsigned part of a channel_update + * The unsigned part of a [`channel_update`] message. + * + * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message */ public class UnsignedChannelUpdate : CommonBase { internal UnsignedChannelUpdate(object _dummy, long ptr) : base(ptr) { } @@ -90,10 +92,10 @@ public class UnsignedChannelUpdate : CommonBase { /** * The number of blocks such that if: * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` - * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines - * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a - * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10, - * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before + * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines + * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a + * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10, + * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before * forwarding. Note that the HTLC sender is the one who originally sets this value when * constructing the route. */ @@ -106,10 +108,10 @@ public class UnsignedChannelUpdate : CommonBase { /** * The number of blocks such that if: * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` - * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines - * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a - * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10, - * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before + * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines + * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a + * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10, + * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before * forwarding. Note that the HTLC sender is the one who originally sets this value when * constructing the route. */ @@ -138,7 +140,9 @@ public class UnsignedChannelUpdate : CommonBase { } /** - * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional. + * The maximum HTLC value incoming to sender, in milli-satoshi. + * + * This used to be optional. */ public long get_htlc_maximum_msat() { long ret = bindings.UnsignedChannelUpdate_get_htlc_maximum_msat(this.ptr); @@ -147,7 +151,9 @@ public class UnsignedChannelUpdate : CommonBase { } /** - * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional. + * The maximum HTLC value incoming to sender, in milli-satoshi. + * + * This used to be optional. */ public void set_htlc_maximum_msat(long val) { bindings.UnsignedChannelUpdate_set_htlc_maximum_msat(this.ptr, val); @@ -193,8 +199,9 @@ public class UnsignedChannelUpdate : CommonBase { /** * Excess data which was signed as a part of the message which we do not (yet) understand how - * to decode. This is stored to ensure forward-compatibility as new fields are added to the - * lightning gossip + * to decode. + * + * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol. * * Returns a copy of the field. */ @@ -206,8 +213,9 @@ public class UnsignedChannelUpdate : CommonBase { /** * Excess data which was signed as a part of the message which we do not (yet) understand how - * to decode. This is stored to ensure forward-compatibility as new fields are added to the - * lightning gossip + * to decode. + * + * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol. */ public void set_excess_data(byte[] val) { bindings.UnsignedChannelUpdate_set_excess_data(this.ptr, val); diff --git a/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs new file mode 100644 index 00000000..1b6990bd --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs @@ -0,0 +1,125 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Represents the set of gossip messages that require a signature from a node's identity key. + */ +public class UnsignedGossipMessage : CommonBase { + protected UnsignedGossipMessage(object _dummy, long ptr) : base(ptr) { } + ~UnsignedGossipMessage() { + if (ptr != 0) { bindings.UnsignedGossipMessage_free(ptr); } + } + + internal static UnsignedGossipMessage constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKUnsignedGossipMessage_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new UnsignedGossipMessage_ChannelAnnouncement(ptr); + case 1: return new UnsignedGossipMessage_ChannelUpdate(ptr); + case 2: return new UnsignedGossipMessage_NodeAnnouncement(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A UnsignedGossipMessage of type ChannelAnnouncement */ + public class UnsignedGossipMessage_ChannelAnnouncement : UnsignedGossipMessage { + public UnsignedChannelAnnouncement channel_announcement; + internal UnsignedGossipMessage_ChannelAnnouncement(long ptr) : base(null, ptr) { + long channel_announcement = bindings.LDKUnsignedGossipMessage_ChannelAnnouncement_get_channel_announcement(ptr); + org.ldk.structs.UnsignedChannelAnnouncement channel_announcement_hu_conv = null; if (channel_announcement < 0 || channel_announcement > 4096) { channel_announcement_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, channel_announcement); } + if (channel_announcement_hu_conv != null) { channel_announcement_hu_conv.ptrs_to.AddLast(this); }; + this.channel_announcement = channel_announcement_hu_conv; + } + } + /** A UnsignedGossipMessage of type ChannelUpdate */ + public class UnsignedGossipMessage_ChannelUpdate : UnsignedGossipMessage { + public UnsignedChannelUpdate channel_update; + internal UnsignedGossipMessage_ChannelUpdate(long ptr) : base(null, ptr) { + long channel_update = bindings.LDKUnsignedGossipMessage_ChannelUpdate_get_channel_update(ptr); + org.ldk.structs.UnsignedChannelUpdate channel_update_hu_conv = null; if (channel_update < 0 || channel_update > 4096) { channel_update_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, channel_update); } + if (channel_update_hu_conv != null) { channel_update_hu_conv.ptrs_to.AddLast(this); }; + this.channel_update = channel_update_hu_conv; + } + } + /** A UnsignedGossipMessage of type NodeAnnouncement */ + public class UnsignedGossipMessage_NodeAnnouncement : UnsignedGossipMessage { + public UnsignedNodeAnnouncement node_announcement; + internal UnsignedGossipMessage_NodeAnnouncement(long ptr) : base(null, ptr) { + long node_announcement = bindings.LDKUnsignedGossipMessage_NodeAnnouncement_get_node_announcement(ptr); + org.ldk.structs.UnsignedNodeAnnouncement node_announcement_hu_conv = null; if (node_announcement < 0 || node_announcement > 4096) { node_announcement_hu_conv = new org.ldk.structs.UnsignedNodeAnnouncement(null, node_announcement); } + if (node_announcement_hu_conv != null) { node_announcement_hu_conv.ptrs_to.AddLast(this); }; + this.node_announcement = node_announcement_hu_conv; + } + } + internal long clone_ptr() { + long ret = bindings.UnsignedGossipMessage_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the UnsignedGossipMessage + */ + public UnsignedGossipMessage clone() { + long ret = bindings.UnsignedGossipMessage_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage + */ + public static UnsignedGossipMessage channel_announcement(org.ldk.structs.UnsignedChannelAnnouncement a) { + long ret = bindings.UnsignedGossipMessage_channel_announcement(a == null ? 0 : a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage + */ + public static UnsignedGossipMessage channel_update(org.ldk.structs.UnsignedChannelUpdate a) { + long ret = bindings.UnsignedGossipMessage_channel_update(a == null ? 0 : a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage + */ + public static UnsignedGossipMessage node_announcement(org.ldk.structs.UnsignedNodeAnnouncement a) { + long ret = bindings.UnsignedGossipMessage_node_announcement(a == null ? 0 : a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read + */ + public byte[] write() { + byte[] ret = bindings.UnsignedGossipMessage_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs b/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs new file mode 100644 index 00000000..e212cadc --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs @@ -0,0 +1,19 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A semantically valid [`InvoiceRequest`] that hasn't been signed. + */ +public class UnsignedInvoiceRequest : CommonBase { + internal UnsignedInvoiceRequest(object _dummy, long ptr) : base(ptr) { } + ~UnsignedInvoiceRequest() { + if (ptr != 0) { bindings.UnsignedInvoiceRequest_free(ptr); } + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs b/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs index 6104a01a..73a8a133 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * The unsigned part of a node_announcement + * The unsigned part of a [`node_announcement`] message. + * + * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message */ public class UnsignedNodeAnnouncement : CommonBase { internal UnsignedNodeAnnouncement(object _dummy, long ptr) : base(ptr) { } @@ -56,23 +58,27 @@ public class UnsignedNodeAnnouncement : CommonBase { } /** - * The node_id this announcement originated from (don't rebroadcast the node_announcement back + * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back * to this node). */ - public byte[] get_node_id() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); + public NodeId get_node_id() { + long ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * The node_id this announcement originated from (don't rebroadcast the node_announcement back + * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back * to this node). */ - public void set_node_id(byte[] val) { - bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); + public void set_node_id(org.ldk.structs.NodeId val) { + bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -94,23 +100,29 @@ public class UnsignedNodeAnnouncement : CommonBase { } /** - * An alias, for UI purposes. This should be sanitized before use. There is no guarantee - * of uniqueness. + * An alias, for UI purposes. + * + * This should be sanitized before use. There is no guarantee of uniqueness. */ - public byte[] get_alias() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); + public NodeAlias get_alias() { + long ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * An alias, for UI purposes. This should be sanitized before use. There is no guarantee - * of uniqueness. + * An alias, for UI purposes. + * + * This should be sanitized before use. There is no guarantee of uniqueness. */ - public void set_alias(byte[] val) { - bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32)); + public void set_alias(org.ldk.structs.NodeAlias val) { + bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -139,6 +151,7 @@ public class UnsignedNodeAnnouncement : CommonBase { bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_12 => val_conv_12.ptr) : null); GC.KeepAlive(this); GC.KeepAlive(val); + foreach (NetAddress val_conv_12 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_12); }; }; } internal long clone_ptr() { diff --git a/c_sharp/src/org/ldk/structs/UntrustedString.cs b/c_sharp/src/org/ldk/structs/UntrustedString.cs new file mode 100644 index 00000000..93ed1c5b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UntrustedString.cs @@ -0,0 +1,98 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Struct to `Display` fields in a safe way using `PrintableString` + */ +public class UntrustedString : CommonBase { + internal UntrustedString(object _dummy, long ptr) : base(ptr) { } + ~UntrustedString() { + if (ptr != 0) { bindings.UntrustedString_free(ptr); } + } + + public string get_a() { + string ret = bindings.UntrustedString_get_a(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public void set_a(string val) { + bindings.UntrustedString_set_a(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new UntrustedString given each field + */ + public static UntrustedString of(string a_arg) { + long ret = bindings.UntrustedString_new(a_arg); + GC.KeepAlive(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UntrustedString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UntrustedString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.UntrustedString_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the UntrustedString + */ + public UntrustedString clone() { + long ret = bindings.UntrustedString_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UntrustedString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UntrustedString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two UntrustedStrings contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.UntrustedString b) { + bool ret = bindings.UntrustedString_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is UntrustedString)) return false; + return this.eq((UntrustedString)o); + } + /** + * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read + */ + public byte[] write() { + byte[] ret = bindings.UntrustedString_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Read a UntrustedString from a byte array, created by UntrustedString_write + */ + public static Result_UntrustedStringDecodeErrorZ read(byte[] ser) { + long ret = bindings.UntrustedString_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs index 42056273..9b7e8db6 100644 --- a/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An update_add_htlc message to be sent or received from a peer + * An [`update_add_htlc`] message to be sent to or received from a peer. + * + * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc */ public class UpdateAddHTLC : CommonBase { internal UpdateAddHTLC(object _dummy, long ptr) : base(ptr) { } @@ -105,6 +107,34 @@ public class UpdateAddHTLC : CommonBase { GC.KeepAlive(val); } + /** + * The extra fee skimmed by the sender of this message. See + * [`ChannelConfig::accept_underpaying_htlcs`]. + * + * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs + */ + public Option_u64Z get_skimmed_fee_msat() { + long ret = bindings.UpdateAddHTLC_get_skimmed_fee_msat(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The extra fee skimmed by the sender of this message. See + * [`ChannelConfig::accept_underpaying_htlcs`]. + * + * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs + */ + public void set_skimmed_fee_msat(org.ldk.structs.Option_u64Z val) { + bindings.UpdateAddHTLC_set_skimmed_fee_msat(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + internal long clone_ptr() { long ret = bindings.UpdateAddHTLC_clone_ptr(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs index a733a807..2c29d885 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An update_fail_htlc message to be sent or received from a peer + * An [`update_fail_htlc`] message to be sent to or received from a peer. + * + * [`update_fail_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc */ public class UpdateFailHTLC : CommonBase { internal UpdateFailHTLC(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs index 8d3c54e6..8d8cbea4 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An update_fail_malformed_htlc message to be sent or received from a peer + * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer. + * + * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc */ public class UpdateFailMalformedHTLC : CommonBase { internal UpdateFailMalformedHTLC(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/UpdateFee.cs b/c_sharp/src/org/ldk/structs/UpdateFee.cs index a962f002..ef67d259 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFee.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFee.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An update_fee message to be sent or received from a peer + * An [`update_fee`] message to be sent to or received from a peer + * + * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee */ public class UpdateFee : CommonBase { internal UpdateFee(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs index 7fc7a855..4cd59991 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * An update_fulfill_htlc message to be sent or received from a peer + * An [`update_fulfill_htlc`] message to be sent to or received from a peer. + * + * [`update_fulfill_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc */ public class UpdateFulfillHTLC : CommonBase { internal UpdateFulfillHTLC(object _dummy, long ptr) : base(ptr) { } diff --git a/c_sharp/src/org/ldk/structs/UserConfig.cs b/c_sharp/src/org/ldk/structs/UserConfig.cs index 128402ed..345d5d35 100644 --- a/c_sharp/src/org/ldk/structs/UserConfig.cs +++ b/c_sharp/src/org/ldk/structs/UserConfig.cs @@ -163,7 +163,7 @@ public class UserConfig : CommonBase { * * Default value: false. * - * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest + * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel */ @@ -184,7 +184,7 @@ public class UserConfig : CommonBase { * * Default value: false. * - * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest + * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel */ @@ -204,7 +204,7 @@ public class UserConfig : CommonBase { * Default value: false. * * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid - * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted + * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted */ public bool get_accept_intercept_htlcs() { bool ret = bindings.UserConfig_get_accept_intercept_htlcs(this.ptr); @@ -222,7 +222,7 @@ public class UserConfig : CommonBase { * Default value: false. * * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid - * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted + * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted */ public void set_accept_intercept_htlcs(bool val) { bindings.UserConfig_set_accept_intercept_htlcs(this.ptr, val); @@ -230,11 +230,47 @@ public class UserConfig : CommonBase { GC.KeepAlive(val); } + /** + * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple + * parts. If this is set to true, we'll accept the payment. + * + * Setting this to true will break backwards compatibility upon downgrading to an LDK + * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP + * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`]. + * + * Default value: false. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + */ + public bool get_accept_mpp_keysend() { + bool ret = bindings.UserConfig_get_accept_mpp_keysend(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple + * parts. If this is set to true, we'll accept the payment. + * + * Setting this to true will break backwards compatibility upon downgrading to an LDK + * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP + * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`]. + * + * Default value: false. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + */ + public void set_accept_mpp_keysend(bool val) { + bindings.UserConfig_set_accept_mpp_keysend(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * Constructs a new UserConfig given each field */ - public static UserConfig of(org.ldk.structs.ChannelHandshakeConfig channel_handshake_config_arg, org.ldk.structs.ChannelHandshakeLimits channel_handshake_limits_arg, org.ldk.structs.ChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg) { - long ret = bindings.UserConfig_new(channel_handshake_config_arg == null ? 0 : channel_handshake_config_arg.ptr, channel_handshake_limits_arg == null ? 0 : channel_handshake_limits_arg.ptr, channel_config_arg == null ? 0 : channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg); + public static UserConfig of(org.ldk.structs.ChannelHandshakeConfig channel_handshake_config_arg, org.ldk.structs.ChannelHandshakeLimits channel_handshake_limits_arg, org.ldk.structs.ChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg) { + long ret = bindings.UserConfig_new(channel_handshake_config_arg == null ? 0 : channel_handshake_config_arg.ptr, channel_handshake_limits_arg == null ? 0 : channel_handshake_limits_arg.ptr, channel_config_arg == null ? 0 : channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); GC.KeepAlive(channel_handshake_config_arg); GC.KeepAlive(channel_handshake_limits_arg); GC.KeepAlive(channel_config_arg); @@ -242,6 +278,7 @@ public class UserConfig : CommonBase { GC.KeepAlive(accept_inbound_channels_arg); GC.KeepAlive(manually_accept_inbound_channels_arg); GC.KeepAlive(accept_intercept_htlcs_arg); + GC.KeepAlive(accept_mpp_keysend_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; diff --git a/c_sharp/src/org/ldk/structs/UtilMethods.cs b/c_sharp/src/org/ldk/structs/UtilMethods.cs index 54bf0ea8..4f333b8f 100644 --- a/c_sharp/src/org/ldk/structs/UtilMethods.cs +++ b/c_sharp/src/org/ldk/structs/UtilMethods.cs @@ -42,35 +42,13 @@ public class UtilMethods { } /** - * Read a ClosureReason from a byte array, created by ClosureReason_write - */ - public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { - long ret = bindings.ClosureReason_read(ser); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a HTLCDestination from a byte array, created by HTLCDestination_write - */ - public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { - long ret = bindings.HTLCDestination_read(ser); - GC.KeepAlive(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Read a Event from a byte array, created by Event_write + * Read a APIError from a byte array, created by APIError_write */ - public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { - long ret = bindings.Event_read(ser); + public static Result_COption_APIErrorZDecodeErrorZ APIError_read(byte[] ser) { + long ret = bindings.APIError_read(ser); GC.KeepAlive(ser); if (ret >= 0 && ret <= 4096) { return null; } - Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + Result_COption_APIErrorZDecodeErrorZ ret_hu_conv = Result_COption_APIErrorZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -136,37 +114,15 @@ public class UtilMethods { /** * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write */ - public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, org.ldk.structs.KeysInterface arg) { - long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr); + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, org.ldk.structs.EntropySource arg_a, org.ldk.structs.SignerProvider arg_b) { + long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg_a.ptr, arg_b.ptr); GC.KeepAlive(ser); - GC.KeepAlive(arg); + GC.KeepAlive(arg_a); + GC.KeepAlive(arg_b); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg); }; - return ret_hu_conv; - } - - /** - * Fetches the set of [`NodeFeatures`] flags which are provided by or required by - * [`ChannelManager`]. - */ - public static NodeFeatures provided_node_features() { - long ret = bindings.provided_node_features(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by - * [`ChannelManager`]. - */ - public static ChannelFeatures provided_channel_features() { - long ret = bindings.provided_channel_features(); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_b); }; return ret_hu_conv; } @@ -174,33 +130,41 @@ public class UtilMethods { * Fetches the set of [`InitFeatures`] flags which are provided by or required by * [`ChannelManager`]. */ - public static InitFeatures provided_init_features() { - long ret = bindings.provided_init_features(); + public static InitFeatures provided_init_features(org.ldk.structs.UserConfig config) { + long ret = bindings.provided_init_features(config == null ? 0 : config.ptr); + GC.KeepAlive(config); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config); }; return ret_hu_conv; } /** * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write */ - public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, KeysInterface arg_keys_manager, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) { - long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr, arg_channel_monitors != null ? InternalUtils.mapArray(arg_channel_monitors, arg_channel_monitors_conv_16 => arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr) : null)); + public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, EntropySource arg_entropy_source, NodeSigner arg_node_signer, SignerProvider arg_signer_provider, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Router arg_router, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) { + long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_entropy_source.ptr, arg_node_signer.ptr, arg_signer_provider.ptr, arg_fee_estimator.ptr, arg_chain_monitor.ptr, arg_tx_broadcaster.ptr, arg_router.ptr, arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr, arg_channel_monitors != null ? InternalUtils.mapArray(arg_channel_monitors, arg_channel_monitors_conv_16 => arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr) : null)); GC.KeepAlive(ser); - GC.KeepAlive(arg_keys_manager); + GC.KeepAlive(arg_entropy_source); + GC.KeepAlive(arg_node_signer); + GC.KeepAlive(arg_signer_provider); GC.KeepAlive(arg_fee_estimator); GC.KeepAlive(arg_chain_monitor); GC.KeepAlive(arg_tx_broadcaster); + GC.KeepAlive(arg_router); GC.KeepAlive(arg_logger); GC.KeepAlive(arg_default_config); GC.KeepAlive(arg_channel_monitors); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_signer_provider); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_fee_estimator); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_tx_broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_default_config); }; foreach (ChannelMonitor arg_channel_monitors_conv_16 in arg_channel_monitors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_channel_monitors_conv_16); }; }; @@ -212,25 +176,32 @@ public class UtilMethods { * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without * a `ChannelManager`. * - * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then + * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not * regenerate it for each new inbound payment. * * `current_time` is a Unix timestamp representing the current time. * - * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable + * on versions of LDK prior to 0.0.114. + * + * [phantom node payments]: crate::sign::PhantomKeysManager + * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material */ - public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.KeysInterface keys_manager, long current_time) { - long ret = bindings.create(keys == null ? 0 : keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, keys_manager == null ? 0 : keys_manager.ptr, current_time); + public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.EntropySource entropy_source, long current_time, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create(keys == null ? 0 : keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(keys); GC.KeepAlive(min_value_msat); GC.KeepAlive(invoice_expiry_delta_secs); - GC.KeepAlive(keys_manager); + GC.KeepAlive(entropy_source); GC.KeepAlive(current_time); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_value_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -241,36 +212,42 @@ public class UtilMethods { * * See [`create`] for information on the `keys` and `current_time` parameters. * - * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable + * on versions of LDK prior to 0.0.114. + * + * [phantom node payments]: crate::sign::PhantomKeysManager */ - public static Result_PaymentSecretNoneZ create_from_hash(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long current_time) { - long ret = bindings.create_from_hash(keys == null ? 0 : keys.ptr, min_value_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, current_time); + public static Result_PaymentSecretNoneZ create_from_hash(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long current_time, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_from_hash(keys == null ? 0 : keys.ptr, min_value_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, current_time, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(keys); GC.KeepAlive(min_value_msat); GC.KeepAlive(payment_hash); GC.KeepAlive(invoice_expiry_delta_secs); GC.KeepAlive(current_time); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_value_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } /** * Gets the weight for an HTLC-Success transaction. */ - public static long htlc_success_tx_weight(bool opt_anchors) { - long ret = bindings.htlc_success_tx_weight(opt_anchors); - GC.KeepAlive(opt_anchors); + public static long htlc_success_tx_weight(org.ldk.structs.ChannelTypeFeatures channel_type_features) { + long ret = bindings.htlc_success_tx_weight(channel_type_features == null ? 0 : channel_type_features.ptr); + GC.KeepAlive(channel_type_features); return ret; } /** * Gets the weight for an HTLC-Timeout transaction. */ - public static long htlc_timeout_tx_weight(bool opt_anchors) { - long ret = bindings.htlc_timeout_tx_weight(opt_anchors); - GC.KeepAlive(opt_anchors); + public static long htlc_timeout_tx_weight(org.ldk.structs.ChannelTypeFeatures channel_type_features) { + long ret = bindings.htlc_timeout_tx_weight(channel_type_features == null ? 0 : channel_type_features.ptr); + GC.KeepAlive(channel_type_features); return ret; } @@ -384,10 +361,10 @@ public class UtilMethods { * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc * does not need to have its previous_output_index filled. */ - public static byte[] get_htlc_redeemscript(org.ldk.structs.HTLCOutputInCommitment htlc, bool opt_anchors, org.ldk.structs.TxCreationKeys keys) { - byte[] ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr, opt_anchors, keys == null ? 0 : keys.ptr); + public static byte[] get_htlc_redeemscript(org.ldk.structs.HTLCOutputInCommitment htlc, org.ldk.structs.ChannelTypeFeatures channel_type_features, org.ldk.structs.TxCreationKeys keys) { + byte[] ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr, channel_type_features == null ? 0 : channel_type_features.ptr, keys == null ? 0 : keys.ptr); GC.KeepAlive(htlc); - GC.KeepAlive(opt_anchors); + GC.KeepAlive(channel_type_features); GC.KeepAlive(keys); return ret; } @@ -412,14 +389,13 @@ public class UtilMethods { * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the * commitment transaction). */ - public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, org.ldk.structs.HTLCOutputInCommitment htlc, bool opt_anchors, bool use_non_zero_fee_anchors, byte[] broadcaster_delayed_payment_key, byte[] revocation_key) { - byte[] ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr, opt_anchors, use_non_zero_fee_anchors, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33)); + public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, org.ldk.structs.HTLCOutputInCommitment htlc, org.ldk.structs.ChannelTypeFeatures channel_type_features, byte[] broadcaster_delayed_payment_key, byte[] revocation_key) { + byte[] ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr, channel_type_features == null ? 0 : channel_type_features.ptr, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33)); GC.KeepAlive(commitment_txid); GC.KeepAlive(feerate_per_kw); GC.KeepAlive(contest_delay); GC.KeepAlive(htlc); - GC.KeepAlive(opt_anchors); - GC.KeepAlive(use_non_zero_fee_anchors); + GC.KeepAlive(channel_type_features); GC.KeepAlive(broadcaster_delayed_payment_key); GC.KeepAlive(revocation_key); return ret; @@ -427,16 +403,14 @@ public class UtilMethods { /** * Returns the witness required to satisfy and spend a HTLC input. - * - * Note that preimage (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static byte[] build_htlc_input_witness(byte[] local_sig, byte[] remote_sig, byte[] preimage, byte[] redeem_script, bool opt_anchors) { - byte[] ret = bindings.build_htlc_input_witness(InternalUtils.check_arr_len(local_sig, 64), InternalUtils.check_arr_len(remote_sig, 64), InternalUtils.check_arr_len(preimage, 32), redeem_script, opt_anchors); + public static byte[] build_htlc_input_witness(byte[] local_sig, byte[] remote_sig, org.ldk.structs.Option_PaymentPreimageZ preimage, byte[] redeem_script, org.ldk.structs.ChannelTypeFeatures channel_type_features) { + byte[] ret = bindings.build_htlc_input_witness(InternalUtils.check_arr_len(local_sig, 64), InternalUtils.check_arr_len(remote_sig, 64), preimage.ptr, redeem_script, channel_type_features == null ? 0 : channel_type_features.ptr); GC.KeepAlive(local_sig); GC.KeepAlive(remote_sig); GC.KeepAlive(preimage); GC.KeepAlive(redeem_script); - GC.KeepAlive(opt_anchors); + GC.KeepAlive(channel_type_features); return ret; } @@ -500,13 +474,43 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Verifies the signature of a [`NodeAnnouncement`]. + * + * Returns an error if it is invalid. + */ + public static Result_NoneLightningErrorZ verify_node_announcement(org.ldk.structs.NodeAnnouncement msg) { + long ret = bindings.verify_node_announcement(msg == null ? 0 : msg.ptr); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + + /** + * Verifies all signatures included in a [`ChannelAnnouncement`]. + * + * Returns an error if one of the signatures is invalid. + */ + public static Result_NoneLightningErrorZ verify_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { + long ret = bindings.verify_channel_announcement(msg == null ? 0 : msg.ptr); + GC.KeepAlive(msg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); }; + return ret_hu_conv; + } + /** * Finds a route from us (payer) to the given target node (payee). * - * If the payee provided features in their invoice, they should be provided via `params.payee`. + * If the payee provided features in their invoice, they should be provided via the `payee` field + * in the given [`RouteParameters::payment_params`]. * Without this, MPP will only be used if the payee's features are available in the network graph. * - * Private routing paths between a public node and the target may be included in `params.payee`. + * Private routing paths between a public node and the target may be included in the `payee` field + * of [`RouteParameters::payment_params`]. * * If some channels aren't announced, it may be useful to fill in `first_hops` with the results * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels @@ -516,31 +520,26 @@ public class UtilMethods { * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / * `htlc_maximum_msat` *are* checked as they may change based on the receiving node. * - * # Note - * - * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any - * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this - * function. - * * # Panics * - * Panics if first_hops contains channels without short_channel_ids; + * Panics if first_hops contains channels without `short_channel_id`s; * [`ChannelManager::list_usable_channels`] will never include such channels. * * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels - * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.Score scorer, byte[] random_seed_bytes) { - long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, first_hops != null ? InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr) : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); + public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.Score scorer, org.ldk.structs.ProbabilisticScoringFeeParameters score_params, byte[] random_seed_bytes) { + long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, first_hops != null ? InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr) : null, logger.ptr, scorer.ptr, score_params == null ? 0 : score_params.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); GC.KeepAlive(our_node_pubkey); GC.KeepAlive(route_params); GC.KeepAlive(network_graph); GC.KeepAlive(first_hops); GC.KeepAlive(logger); GC.KeepAlive(scorer); + GC.KeepAlive(score_params); GC.KeepAlive(random_seed_bytes); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); @@ -549,6 +548,7 @@ public class UtilMethods { if (first_hops != null) { foreach (ChannelDetails first_hops_conv_16 in first_hops) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(first_hops_conv_16); }; } }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score_params); }; return ret_hu_conv; } @@ -559,7 +559,7 @@ public class UtilMethods { * Re-uses logic from `find_route`, so the restrictions described there also apply here. */ public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes) { - long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? InternalUtils.mapArray(hops, hops_conv_8 => InternalUtils.check_arr_len(hops_conv_8, 33)) : null, route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); + long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? InternalUtils.mapArray(hops, hops_conv_8 => InternalUtils.check_arr_len(hops_conv_8, 33)) : null, route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); GC.KeepAlive(our_node_pubkey); GC.KeepAlive(hops); GC.KeepAlive(route_params); @@ -574,6 +574,192 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to + * the given outputs, plus an output to the given change destination (if sufficient + * change value remains). The PSBT will have a feerate, at least, of the given value. + * + * The `locktime` argument is used to set the transaction's locktime. If `None`, the + * transaction will have a locktime of 0. It it recommended to set this to the current block + * height to avoid fee sniping, unless you have some specific reason to use a different + * locktime. + * + * Returns the PSBT and expected max transaction weight. + * + * Returns `Err(())` if the output value is greater than the input value minus required fee, + * if a descriptor was duplicated, or if an output descriptor `script_pubkey` + * does not match the one we can spend. + * + * We do not enforce that outputs meet the dust limit or that any output scripts are standard. + */ + public static Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_PackedLockTimeZ locktime) { + long ret = bindings.SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors != null ? InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr) : null, outputs != null ? InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr) : null, change_destination_script, feerate_sat_per_1000_weight, locktime.ptr); + GC.KeepAlive(descriptors); + GC.KeepAlive(outputs); + GC.KeepAlive(change_destination_script); + GC.KeepAlive(feerate_sat_per_1000_weight); + GC.KeepAlive(locktime); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ ret_hu_conv = Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.constr_from_ptr(ret); + foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(descriptors_conv_27); }; }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(locktime); }; + return ret_hu_conv; + } + + /** + * Returns whether `tlv_type` corresponds to a TLV record for Offers. + */ + public static bool OffersMessage_is_known_type(long tlv_type) { + bool ret = bindings.OffersMessage_is_known_type(tlv_type); + GC.KeepAlive(tlv_type); + return ret; + } + + /** + * Read a PathFailure from a byte array, created by PathFailure_write + */ + public static Result_COption_PathFailureZDecodeErrorZ PathFailure_read(byte[] ser) { + long ret = bindings.PathFailure_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_PathFailureZDecodeErrorZ ret_hu_conv = Result_COption_PathFailureZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a ClosureReason from a byte array, created by ClosureReason_write + */ + public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { + long ret = bindings.ClosureReason_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a HTLCDestination from a byte array, created by HTLCDestination_write + */ + public static Result_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(byte[] ser) { + long ret = bindings.HTLCDestination_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a Event from a byte array, created by Event_write + */ + public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { + long ret = bindings.Event_read(ser); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Pays the given [`Bolt11Invoice`], retrying if needed based on [`Retry`]. + * + * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long + * as the payment is still pending. If the payment succeeds, you must ensure that a second payment + * with the same [`PaymentHash`] is never sent. + * + * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`]. + */ + public static Result_PaymentIdPaymentErrorZ pay_invoice(org.ldk.structs.Bolt11Invoice invoice, org.ldk.structs.Retry retry_strategy, org.ldk.structs.ChannelManager channelmanager) { + long ret = bindings.pay_invoice(invoice == null ? 0 : invoice.ptr, retry_strategy.ptr, channelmanager == null ? 0 : channelmanager.ptr); + GC.KeepAlive(invoice); + GC.KeepAlive(retry_strategy); + GC.KeepAlive(channelmanager); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(invoice); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(retry_strategy); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + return ret_hu_conv; + } + + /** + * Pays the given [`Bolt11Invoice`] with a custom idempotency key, retrying if needed based on + * [`Retry`]. + * + * Note that idempotency is only guaranteed as long as the payment is still pending. Once the + * payment completes or fails, no idempotency guarantees are made. + * + * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same + * [`PaymentHash`] has never been paid before. + * + * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token. + */ + public static Result_NonePaymentErrorZ pay_invoice_with_id(org.ldk.structs.Bolt11Invoice invoice, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.ChannelManager channelmanager) { + long ret = bindings.pay_invoice_with_id(invoice == null ? 0 : invoice.ptr, InternalUtils.check_arr_len(payment_id, 32), retry_strategy.ptr, channelmanager == null ? 0 : channelmanager.ptr); + GC.KeepAlive(invoice); + GC.KeepAlive(payment_id); + GC.KeepAlive(retry_strategy); + GC.KeepAlive(channelmanager); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(invoice); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(retry_strategy); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + return ret_hu_conv; + } + + /** + * Pays the given zero-value [`Bolt11Invoice`] using the given amount, retrying if needed based on + * [`Retry`]. + * + * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long + * as the payment is still pending. If the payment succeeds, you must ensure that a second payment + * with the same [`PaymentHash`] is never sent. + * + * If you wish to use a different payment idempotency token, see + * [`pay_zero_value_invoice_with_id`]. + */ + public static Result_PaymentIdPaymentErrorZ pay_zero_value_invoice(org.ldk.structs.Bolt11Invoice invoice, long amount_msats, org.ldk.structs.Retry retry_strategy, org.ldk.structs.ChannelManager channelmanager) { + long ret = bindings.pay_zero_value_invoice(invoice == null ? 0 : invoice.ptr, amount_msats, retry_strategy.ptr, channelmanager == null ? 0 : channelmanager.ptr); + GC.KeepAlive(invoice); + GC.KeepAlive(amount_msats); + GC.KeepAlive(retry_strategy); + GC.KeepAlive(channelmanager); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(invoice); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(retry_strategy); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + return ret_hu_conv; + } + + /** + * Pays the given zero-value [`Bolt11Invoice`] using the given amount and custom idempotency key, + * retrying if needed based on [`Retry`]. + * + * Note that idempotency is only guaranteed as long as the payment is still pending. Once the + * payment completes or fails, no idempotency guarantees are made. + * + * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same + * [`PaymentHash`] has never been paid before. + * + * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the + * idempotency token. + */ + public static Result_NonePaymentErrorZ pay_zero_value_invoice_with_id(org.ldk.structs.Bolt11Invoice invoice, long amount_msats, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.ChannelManager channelmanager) { + long ret = bindings.pay_zero_value_invoice_with_id(invoice == null ? 0 : invoice.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32), retry_strategy.ptr, channelmanager == null ? 0 : channelmanager.ptr); + GC.KeepAlive(invoice); + GC.KeepAlive(amount_msats); + GC.KeepAlive(payment_id); + GC.KeepAlive(retry_strategy); + GC.KeepAlive(channelmanager); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(invoice); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(retry_strategy); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; + return ret_hu_conv; + } + /** * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\" * See [`PhantomKeysManager`] for more information on phantom node payments. @@ -595,33 +781,49 @@ public class UtilMethods { * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for * in excess of the current time. * - * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom + * `duration_since_epoch` is the current time since epoch in seconds. + * + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. + * + * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this * requirement). * - * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager + * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA * - * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None + * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, byte[] payment_hash, string description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, Currency network) { - long ret = bindings.create_phantom_invoice(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), description, invoice_expiry_delta_secs, phantom_route_hints != null ? InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr) : null, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_PaymentHashZ payment_hash, string description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { + long ret = bindings.create_phantom_invoice(amt_msat.ptr, payment_hash.ptr, description, invoice_expiry_delta_secs, phantom_route_hints != null ? InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr) : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); GC.KeepAlive(amt_msat); GC.KeepAlive(payment_hash); GC.KeepAlive(description); GC.KeepAlive(invoice_expiry_delta_secs); GC.KeepAlive(phantom_route_hints); - GC.KeepAlive(keys_manager); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); GC.KeepAlive(network); + GC.KeepAlive(min_final_cltv_expiry_delta); + GC.KeepAlive(duration_since_epoch); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_hash); }; foreach (PhantomRouteHints phantom_route_hints_conv_19 in phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(phantom_route_hints_conv_19); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -635,9 +837,11 @@ public class UtilMethods { * participating node * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is * updated when a channel becomes disabled or closes - * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice - * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared - * down + * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum + * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected + * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node + * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as + * desired, but note that some nodes will be trimmed if more than 3 nodes are provided. * * `description_hash` is a SHA-256 hash of the description text * @@ -648,34 +852,44 @@ public class UtilMethods { * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for * in excess of the current time. * - * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom + * `duration_since_epoch` is the current time since epoch in seconds. + * + * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this * requirement). * - * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager + * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels * - * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None + * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not + * available and the current time is supplied by the caller. */ - public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, byte[] payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, Currency network) { - long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr, phantom_route_hints != null ? InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr) : null, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_PaymentHashZ payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { + long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, payment_hash.ptr, invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr, phantom_route_hints != null ? InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr) : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); GC.KeepAlive(amt_msat); GC.KeepAlive(payment_hash); GC.KeepAlive(invoice_expiry_delta_secs); GC.KeepAlive(description_hash); GC.KeepAlive(phantom_route_hints); - GC.KeepAlive(keys_manager); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); GC.KeepAlive(network); + GC.KeepAlive(min_final_cltv_expiry_delta); + GC.KeepAlive(duration_since_epoch); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_hash); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(description_hash); }; foreach (PhantomRouteHints phantom_route_hints_conv_19 in phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(phantom_route_hints_conv_19); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -688,21 +902,31 @@ public class UtilMethods { * * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for * in excess of the current time. + * + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. + * + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, int invoice_expiry_delta_secs) { - long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); - GC.KeepAlive(keys_manager); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); GC.KeepAlive(network); GC.KeepAlive(amt_msat); GC.KeepAlive(description); GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -716,22 +940,32 @@ public class UtilMethods { * * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for * in excess of the current time. + * + * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block + * confirmations during routing. + * + * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); - GC.KeepAlive(keys_manager); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); GC.KeepAlive(network); GC.KeepAlive(amt_msat); GC.KeepAlive(description_hash); GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(description_hash); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -740,22 +974,25 @@ public class UtilMethods { * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not * available and the current time is supplied by the caller. */ - public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); - GC.KeepAlive(keys_manager); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); GC.KeepAlive(network); GC.KeepAlive(amt_msat); GC.KeepAlive(description_hash); GC.KeepAlive(duration_since_epoch); GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(description_hash); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -764,21 +1001,24 @@ public class UtilMethods { * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not * available and the current time is supplied by the caller. */ - public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, long duration_since_epoch, int invoice_expiry_delta_secs) { - long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); - GC.KeepAlive(keys_manager); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); GC.KeepAlive(network); GC.KeepAlive(amt_msat); GC.KeepAlive(description); GC.KeepAlive(duration_since_epoch); GC.KeepAlive(invoice_expiry_delta_secs); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } @@ -788,10 +1028,10 @@ public class UtilMethods { * This may be useful if you're building an on-chain swap or involving another protocol where * the payment hash is also involved outside the scope of lightning. */ - public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash) { - long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32)); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32), min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); - GC.KeepAlive(keys_manager); + GC.KeepAlive(node_signer); GC.KeepAlive(logger); GC.KeepAlive(network); GC.KeepAlive(amt_msat); @@ -799,11 +1039,14 @@ public class UtilMethods { GC.KeepAlive(duration_since_epoch); GC.KeepAlive(invoice_expiry_delta_secs); GC.KeepAlive(payment_hash); + GC.KeepAlive(min_final_cltv_expiry_delta); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channelmanager); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(amt_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(min_final_cltv_expiry_delta); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Utxo.cs b/c_sharp/src/org/ldk/structs/Utxo.cs new file mode 100644 index 00000000..8874553c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Utxo.cs @@ -0,0 +1,161 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An unspent transaction output that is available to spend resulting from a successful + * [`CoinSelection`] attempt. + */ +public class Utxo : CommonBase { + internal Utxo(object _dummy, long ptr) : base(ptr) { } + ~Utxo() { + if (ptr != 0) { bindings.Utxo_free(ptr); } + } + + /** + * The unique identifier of the output. + */ + public OutPoint get_outpoint() { + long ret = bindings.Utxo_get_outpoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The unique identifier of the output. + */ + public void set_outpoint(org.ldk.structs.OutPoint val) { + bindings.Utxo_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The output to spend. + */ + public TxOut get_output() { + long ret = bindings.Utxo_get_output(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TxOut ret_conv = new TxOut(null, ret); + return ret_conv; + } + + /** + * The output to spend. + */ + public void set_output(org.ldk.structs.TxOut val) { + bindings.Utxo_set_output(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each + * with their lengths included, required to satisfy the output's script. The weight consumed by + * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`]. + */ + public long get_satisfaction_weight() { + long ret = bindings.Utxo_get_satisfaction_weight(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each + * with their lengths included, required to satisfy the output's script. The weight consumed by + * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`]. + */ + public void set_satisfaction_weight(long val) { + bindings.Utxo_set_satisfaction_weight(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new Utxo given each field + */ + public static Utxo of(org.ldk.structs.OutPoint outpoint_arg, org.ldk.structs.TxOut output_arg, long satisfaction_weight_arg) { + long ret = bindings.Utxo_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, output_arg.ptr, satisfaction_weight_arg); + GC.KeepAlive(outpoint_arg); + GC.KeepAlive(output_arg); + GC.KeepAlive(satisfaction_weight_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Utxo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Utxo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.Utxo_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Utxo + */ + public Utxo clone() { + long ret = bindings.Utxo_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Utxo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Utxo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the Utxo. + */ + public long hash() { + long ret = bindings.Utxo_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two Utxos contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Utxo b) { + bool ret = bindings.Utxo_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Utxo)) return false; + return this.eq((Utxo)o); + } + /** + * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output. + */ + public static Utxo new_p2pkh(org.ldk.structs.OutPoint outpoint, long value, byte[] pubkey_hash) { + long ret = bindings.Utxo_new_p2pkh(outpoint == null ? 0 : outpoint.ptr, value, InternalUtils.check_arr_len(pubkey_hash, 20)); + GC.KeepAlive(outpoint); + GC.KeepAlive(value); + GC.KeepAlive(pubkey_hash); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Utxo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Utxo(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UtxoFuture.cs b/c_sharp/src/org/ldk/structs/UtxoFuture.cs new file mode 100644 index 00000000..bf797e5d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UtxoFuture.cs @@ -0,0 +1,94 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async. + * + * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info. + */ +public class UtxoFuture : CommonBase { + internal UtxoFuture(object _dummy, long ptr) : base(ptr) { } + ~UtxoFuture() { + if (ptr != 0) { bindings.UtxoFuture_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.UtxoFuture_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the UtxoFuture + */ + public UtxoFuture clone() { + long ret = bindings.UtxoFuture_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UtxoFuture ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UtxoFuture(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Builds a new future for later resolution. + */ + public static UtxoFuture of() { + long ret = bindings.UtxoFuture_new(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UtxoFuture ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UtxoFuture(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Resolves this future against the given `graph` and with the given `result`. + * + * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling + * forwarding the validated gossip message onwards to peers. + * + * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order + * to allow us to interact with peers again, you should call [`PeerManager::process_events`] + * after this. + * + * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high + * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events + */ + public void resolve_without_forwarding(org.ldk.structs.NetworkGraph graph, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) { + bindings.UtxoFuture_resolve_without_forwarding(this.ptr, graph == null ? 0 : graph.ptr, result != null ? result.ptr : 0); + GC.KeepAlive(this); + GC.KeepAlive(graph); + GC.KeepAlive(result); + if (this != null) { this.ptrs_to.AddLast(graph); }; + } + + /** + * Resolves this future against the given `graph` and with the given `result`. + * + * The given `gossip` is used to broadcast any validated messages onwards to all peers which + * have available buffer space. + * + * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order + * to allow us to interact with peers again, you should call [`PeerManager::process_events`] + * after this. + * + * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high + * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events + */ + public void resolve(org.ldk.structs.NetworkGraph graph, org.ldk.structs.P2PGossipSync gossip, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) { + bindings.UtxoFuture_resolve(this.ptr, graph == null ? 0 : graph.ptr, gossip == null ? 0 : gossip.ptr, result != null ? result.ptr : 0); + GC.KeepAlive(this); + GC.KeepAlive(graph); + GC.KeepAlive(gossip); + GC.KeepAlive(result); + if (this != null) { this.ptrs_to.AddLast(graph); }; + if (this != null) { this.ptrs_to.AddLast(gossip); }; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UtxoLookup.cs b/c_sharp/src/org/ldk/structs/UtxoLookup.cs new file mode 100644 index 00000000..ebb18f7a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UtxoLookup.cs @@ -0,0 +1,69 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs. + */ +public class UtxoLookup : CommonBase { + internal readonly bindings.LDKUtxoLookup bindings_instance; + internal UtxoLookup(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private UtxoLookup(bindings.LDKUtxoLookup arg) : base(bindings.LDKUtxoLookup_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~UtxoLookup() { + if (ptr != 0) { bindings.UtxoLookup_free(ptr); } + } + + public interface UtxoLookupInterface { + /** + * Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. + * Returns an error if `genesis_hash` is for a different chain or if such a transaction output + * is unknown. + * + * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id + */ + UtxoResult get_utxo(byte[] _genesis_hash, long _short_channel_id); + } + private class LDKUtxoLookupHolder { internal UtxoLookup held; } + private class LDKUtxoLookupImpl : bindings.LDKUtxoLookup { + internal LDKUtxoLookupImpl(UtxoLookupInterface arg, LDKUtxoLookupHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private UtxoLookupInterface arg; + private LDKUtxoLookupHolder impl_holder; + public long get_utxo(byte[] _genesis_hash, long _short_channel_id) { + UtxoResult ret = arg.get_utxo(_genesis_hash, _short_channel_id); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; + return result; + } + } + public static UtxoLookup new_impl(UtxoLookupInterface arg) { + LDKUtxoLookupHolder impl_holder = new LDKUtxoLookupHolder(); + impl_holder.held = new UtxoLookup(new LDKUtxoLookupImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. + * Returns an error if `genesis_hash` is for a different chain or if such a transaction output + * is unknown. + * + * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id + */ + public UtxoResult get_utxo(byte[] genesis_hash, long short_channel_id) { + long ret = bindings.UtxoLookup_get_utxo(this.ptr, InternalUtils.check_arr_len(genesis_hash, 32), short_channel_id); + GC.KeepAlive(this); + GC.KeepAlive(genesis_hash); + GC.KeepAlive(short_channel_id); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UtxoResult.cs b/c_sharp/src/org/ldk/structs/UtxoResult.cs new file mode 100644 index 00000000..18c93278 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UtxoResult.cs @@ -0,0 +1,92 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously, + * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async` + * variant. + */ +public class UtxoResult : CommonBase { + protected UtxoResult(object _dummy, long ptr) : base(ptr) { } + ~UtxoResult() { + if (ptr != 0) { bindings.UtxoResult_free(ptr); } + } + + internal static UtxoResult constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKUtxoResult_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new UtxoResult_Sync(ptr); + case 1: return new UtxoResult_Async(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A UtxoResult of type Sync */ + public class UtxoResult_Sync : UtxoResult { + public Result_TxOutUtxoLookupErrorZ sync; + internal UtxoResult_Sync(long ptr) : base(null, ptr) { + long sync = bindings.LDKUtxoResult_Sync_get_sync(ptr); + Result_TxOutUtxoLookupErrorZ sync_hu_conv = Result_TxOutUtxoLookupErrorZ.constr_from_ptr(sync); + this.sync = sync_hu_conv; + } + } + /** A UtxoResult of type Async */ + public class UtxoResult_Async : UtxoResult { + public UtxoFuture async; + internal UtxoResult_Async(long ptr) : base(null, ptr) { + long async = bindings.LDKUtxoResult_Async_get_async(ptr); + org.ldk.structs.UtxoFuture async_hu_conv = null; if (async < 0 || async > 4096) { async_hu_conv = new org.ldk.structs.UtxoFuture(null, async); } + if (async_hu_conv != null) { async_hu_conv.ptrs_to.AddLast(this); }; + this.async = async_hu_conv; + } + } + internal long clone_ptr() { + long ret = bindings.UtxoResult_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the UtxoResult + */ + public UtxoResult clone() { + long ret = bindings.UtxoResult_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Sync-variant UtxoResult + */ + public static UtxoResult sync(org.ldk.structs.Result_TxOutUtxoLookupErrorZ a) { + long ret = bindings.UtxoResult_sync(a != null ? a.ptr : 0); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Async-variant UtxoResult + */ + public static UtxoResult async(org.ldk.structs.UtxoFuture a) { + long ret = bindings.UtxoResult_async(a == null ? 0 : a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Wallet.cs b/c_sharp/src/org/ldk/structs/Wallet.cs new file mode 100644 index 00000000..11d73edf --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Wallet.cs @@ -0,0 +1,50 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would + * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double + * spends may happen. + */ +public class Wallet : CommonBase { + internal Wallet(object _dummy, long ptr) : base(ptr) { } + ~Wallet() { + if (ptr != 0) { bindings.Wallet_free(ptr); } + } + + /** + * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation + * of [`CoinSelectionSource`]. + */ + public static Wallet of(org.ldk.structs.WalletSource source, org.ldk.structs.Logger logger) { + long ret = bindings.Wallet_new(source.ptr, logger.ptr); + GC.KeepAlive(source); + GC.KeepAlive(logger); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Wallet ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Wallet(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + return ret_hu_conv; + } + + /** + * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is + */ + public CoinSelectionSource as_CoinSelectionSource() { + long ret = bindings.Wallet_as_CoinSelectionSource(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + CoinSelectionSource ret_hu_conv = new CoinSelectionSource(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/WalletSource.cs b/c_sharp/src/org/ldk/structs/WalletSource.cs new file mode 100644 index 00000000..4c918282 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/WalletSource.cs @@ -0,0 +1,107 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to + * provide a default implementation to [`CoinSelectionSource`]. + */ +public class WalletSource : CommonBase { + internal readonly bindings.LDKWalletSource bindings_instance; + internal WalletSource(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + private WalletSource(bindings.LDKWalletSource arg) : base(bindings.LDKWalletSource_new(arg)) { + this.ptrs_to.AddLast(arg); + this.bindings_instance = arg; + } + ~WalletSource() { + if (ptr != 0) { bindings.WalletSource_free(ptr); } + } + + public interface WalletSourceInterface { + /** + * Returns all UTXOs, with at least 1 confirmation each, that are available to spend. + */ + Result_CVec_UtxoZNoneZ list_confirmed_utxos(); + /** + * Returns a script to use for change above dust resulting from a successful coin selection + * attempt. + */ + Result_ScriptNoneZ get_change_script(); + /** + * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within + * the transaction known to the wallet (i.e., any provided via + * [`WalletSource::list_confirmed_utxos`]). + */ + Result_TransactionNoneZ sign_tx(byte[] _tx); + } + private class LDKWalletSourceHolder { internal WalletSource held; } + private class LDKWalletSourceImpl : bindings.LDKWalletSource { + internal LDKWalletSourceImpl(WalletSourceInterface arg, LDKWalletSourceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private WalletSourceInterface arg; + private LDKWalletSourceHolder impl_holder; + public long list_confirmed_utxos() { + Result_CVec_UtxoZNoneZ ret = arg.list_confirmed_utxos(); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long get_change_script() { + Result_ScriptNoneZ ret = arg.get_change_script(); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + public long sign_tx(byte[] _tx) { + Result_TransactionNoneZ ret = arg.sign_tx(_tx); + GC.KeepAlive(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + } + public static WalletSource new_impl(WalletSourceInterface arg) { + LDKWalletSourceHolder impl_holder = new LDKWalletSourceHolder(); + impl_holder.held = new WalletSource(new LDKWalletSourceImpl(arg, impl_holder)); + return impl_holder.held; + } + /** + * Returns all UTXOs, with at least 1 confirmation each, that are available to spend. + */ + public Result_CVec_UtxoZNoneZ list_confirmed_utxos() { + long ret = bindings.WalletSource_list_confirmed_utxos(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Returns a script to use for change above dust resulting from a successful coin selection + * attempt. + */ + public Result_ScriptNoneZ get_change_script() { + long ret = bindings.WalletSource_get_change_script(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScriptNoneZ ret_hu_conv = Result_ScriptNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within + * the transaction known to the wallet (i.e., any provided via + * [`WalletSource::list_confirmed_utxos`]). + */ + public Result_TransactionNoneZ sign_tx(byte[] tx) { + long ret = bindings.WalletSource_sign_tx(this.ptr, tx); + GC.KeepAlive(this); + GC.KeepAlive(tx); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/WarningMessage.cs b/c_sharp/src/org/ldk/structs/WarningMessage.cs index aa7882cd..955d60b1 100644 --- a/c_sharp/src/org/ldk/structs/WarningMessage.cs +++ b/c_sharp/src/org/ldk/structs/WarningMessage.cs @@ -7,7 +7,9 @@ namespace org { namespace ldk { namespace structs { /** - * A warning message to be sent or received from a peer + * A [`warning`] message to be sent to or received from a peer. + * + * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages */ public class WarningMessage : CommonBase { internal WarningMessage(object _dummy, long ptr) : base(ptr) { } @@ -39,6 +41,7 @@ public class WarningMessage : CommonBase { /** * A possibly human-readable warning description. + * * The string should be sanitized before it is used (e.g. emitted to logs or printed to * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in * the terminal emulator or the logging subsystem. @@ -51,6 +54,7 @@ public class WarningMessage : CommonBase { /** * A possibly human-readable warning description. + * * The string should be sanitized before it is used (e.g. emitted to logs or printed to * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in * the terminal emulator or the logging subsystem. diff --git a/c_sharp/src/org/ldk/structs/Watch.cs b/c_sharp/src/org/ldk/structs/Watch.cs index 39a6f5d0..4fc936e0 100644 --- a/c_sharp/src/org/ldk/structs/Watch.cs +++ b/c_sharp/src/org/ldk/structs/Watch.cs @@ -93,7 +93,6 @@ public class Watch : CommonBase { org.ldk.structs.OutPoint _funding_txo_hu_conv = null; if (_funding_txo < 0 || _funding_txo > 4096) { _funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, _funding_txo); } if (_funding_txo_hu_conv != null) { _funding_txo_hu_conv.ptrs_to.AddLast(this); }; org.ldk.structs.ChannelMonitorUpdate _update_hu_conv = null; if (_update < 0 || _update > 4096) { _update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, _update); } - if (_update_hu_conv != null) { _update_hu_conv.ptrs_to.AddLast(this); }; ChannelMonitorUpdateStatus ret = arg.update_channel(_funding_txo_hu_conv, _update_hu_conv); GC.KeepAlive(arg); return ret; diff --git a/c_sharp/src/org/ldk/structs/WatchedOutput.cs b/c_sharp/src/org/ldk/structs/WatchedOutput.cs index df06e0bb..da8e2771 100644 --- a/c_sharp/src/org/ldk/structs/WatchedOutput.cs +++ b/c_sharp/src/org/ldk/structs/WatchedOutput.cs @@ -27,24 +27,24 @@ public class WatchedOutput : CommonBase { /** * First block where the transaction output may have been spent. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public byte[] get_block_hash() { - byte[] ret = bindings.WatchedOutput_get_block_hash(this.ptr); + public Option_BlockHashZ get_block_hash() { + long ret = bindings.WatchedOutput_get_block_hash(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_BlockHashZ ret_hu_conv = org.ldk.structs.Option_BlockHashZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * First block where the transaction output may have been spent. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_block_hash(byte[] val) { - bindings.WatchedOutput_set_block_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); + public void set_block_hash(org.ldk.structs.Option_BlockHashZ val) { + bindings.WatchedOutput_set_block_hash(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -90,14 +90,15 @@ public class WatchedOutput : CommonBase { /** * Constructs a new WatchedOutput given each field */ - public static WatchedOutput of(byte[] block_hash_arg, org.ldk.structs.OutPoint outpoint_arg, byte[] script_pubkey_arg) { - long ret = bindings.WatchedOutput_new(InternalUtils.check_arr_len(block_hash_arg, 32), outpoint_arg == null ? 0 : outpoint_arg.ptr, script_pubkey_arg); + public static WatchedOutput of(org.ldk.structs.Option_BlockHashZ block_hash_arg, org.ldk.structs.OutPoint outpoint_arg, byte[] script_pubkey_arg) { + long ret = bindings.WatchedOutput_new(block_hash_arg.ptr, outpoint_arg == null ? 0 : outpoint_arg.ptr, script_pubkey_arg); GC.KeepAlive(block_hash_arg); GC.KeepAlive(outpoint_arg); GC.KeepAlive(script_pubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WatchedOutput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(block_hash_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); }; return ret_hu_conv; } @@ -138,7 +139,7 @@ public class WatchedOutput : CommonBase { return this.eq((WatchedOutput)o); } /** - * Checks if two WatchedOutputs contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the WatchedOutput. */ public long hash() { long ret = bindings.WatchedOutput_hash(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs b/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs new file mode 100644 index 00000000..71f6f125 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs @@ -0,0 +1,100 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A writeable signer. + * + * There will always be two instances of a signer per channel, one occupied by the + * [`ChannelManager`] and another by the channel's [`ChannelMonitor`]. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + */ +public class WriteableEcdsaChannelSigner : CommonBase { + internal readonly bindings.LDKWriteableEcdsaChannelSigner bindings_instance; + internal WriteableEcdsaChannelSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + 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())) { + this.ptrs_to.AddLast(arg); + this.ptrs_to.AddLast(EcdsaChannelSigner); + this.ptrs_to.AddLast(ChannelSigner); + this.bindings_instance = arg; + } + ~WriteableEcdsaChannelSigner() { + if (ptr != 0) { bindings.WriteableEcdsaChannelSigner_free(ptr); } + } + + public interface WriteableEcdsaChannelSignerInterface { + /** + * Serialize the object into a byte array + */ + byte[] write(); + } + private class LDKWriteableEcdsaChannelSignerHolder { internal WriteableEcdsaChannelSigner held; } + private class LDKWriteableEcdsaChannelSignerImpl : bindings.LDKWriteableEcdsaChannelSigner { + internal LDKWriteableEcdsaChannelSignerImpl(WriteableEcdsaChannelSignerInterface arg, LDKWriteableEcdsaChannelSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private WriteableEcdsaChannelSignerInterface arg; + private LDKWriteableEcdsaChannelSignerHolder impl_holder; + public byte[] write() { + byte[] ret = arg.write(); + GC.KeepAlive(arg); + return ret; + } + } + public static WriteableEcdsaChannelSigner new_impl(WriteableEcdsaChannelSignerInterface arg, EcdsaChannelSigner.EcdsaChannelSignerInterface EcdsaChannelSigner_impl, ChannelSigner.ChannelSignerInterface ChannelSigner_impl, ChannelPublicKeys pubkeys) { + LDKWriteableEcdsaChannelSignerHolder impl_holder = new LDKWriteableEcdsaChannelSignerHolder(); + 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); + return impl_holder.held; + } + + /** + * Gets the underlying EcdsaChannelSigner. + */ + public EcdsaChannelSigner get_ecdsa_channel_signer() { + EcdsaChannelSigner res = new EcdsaChannelSigner(null, bindings.LDKWriteableEcdsaChannelSigner_get_EcdsaChannelSigner(this.ptr)); + this.ptrs_to.AddLast(res); + return res; + } + + + /** + * Gets the underlying ChannelSigner. + */ + public ChannelSigner get_channel_signer() { + ChannelSigner res = new ChannelSigner(null, bindings.LDKWriteableEcdsaChannelSigner_get_ChannelSigner(this.ptr)); + this.ptrs_to.AddLast(res); + return res; + } + + /** + * Serialize the object into a byte array + */ + public byte[] write() { + byte[] ret = bindings.WriteableEcdsaChannelSigner_write(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.WriteableEcdsaChannelSigner_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of a WriteableEcdsaChannelSigner + */ + public WriteableEcdsaChannelSigner clone() { + long ret = bindings.WriteableEcdsaChannelSigner_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + WriteableEcdsaChannelSigner ret_hu_conv = new WriteableEcdsaChannelSigner(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } }