From 113c309379f487d3de0f42eea4a550c758f7834a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 29 Jun 2026 15:17:14 +0000 Subject: [PATCH 1/2] Update CI Pins --- .github/workflows/build.yml | 84 ++++++++++++++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b8f186d..81bd3174 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,12 @@ jobs: git checkout origin/0.2-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" cd .. git clone https://github.com/lightningdevkit/ldk-c-bindings cd ldk-c-bindings @@ -50,11 +56,18 @@ jobs: cd lightning-c-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" - name: Pin proc-macro and quote to meet MSRV run: | cd ldk-c-bindings/c-bindings-gen cargo update -p quote --precise "1.0.30" --verbose cargo update -p proc-macro2 --precise "1.0.65" --verbose + cargo update -p unicode-ident --precise 1.0.22 - name: Rebuild C bindings without STD run: | cd ldk-c-bindings @@ -149,6 +162,12 @@ jobs: git checkout origin/0.2-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" cd .. git clone https://github.com/lightningdevkit/ldk-c-bindings cd ldk-c-bindings @@ -156,11 +175,18 @@ jobs: cd lightning-c-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" - name: Pin proc-macro and quote to meet MSRV run: | cd ldk-c-bindings/c-bindings-gen cargo update -p quote --precise "1.0.30" --verbose cargo update -p proc-macro2 --precise "1.0.65" --verbose + cargo update -p unicode-ident --precise 1.0.22 - name: Rebuild C bindings with STD run: | cd ldk-c-bindings @@ -202,15 +228,11 @@ jobs: git clone https://github.com/lightningdevkit/rust-lightning cd rust-lightning git checkout origin/0.2-bindings - cargo update -p syn --precise "2.0.106" --verbose - cargo update -p quote --precise "1.0.41" --verbose cd .. git clone https://github.com/lightningdevkit/ldk-c-bindings cd ldk-c-bindings git checkout 0.2 cd lightning-c-bindings - cargo update -p syn --precise "2.0.106" --verbose - cargo update -p quote --precise "1.0.41" --verbose - name: Fetch MacOS SDK run: | curl -o Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz @@ -259,8 +281,6 @@ jobs: git clean -f -x -d git reset --hard cd lightning-c-bindings - cargo update -p syn --precise "2.0.106" --verbose - cargo update -p quote --precise "1.0.41" --verbose cd ../.. export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)" export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64" @@ -393,6 +413,12 @@ jobs: git checkout origin/0.2-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" cd .. git clone https://github.com/lightningdevkit/ldk-c-bindings cd ldk-c-bindings @@ -400,11 +426,18 @@ jobs: cd lightning-c-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" - name: Pin proc-macro and quote to meet MSRV run: | cd ldk-c-bindings/c-bindings-gen cargo update -p quote --precise "1.0.30" --verbose cargo update -p proc-macro2 --precise "1.0.65" --verbose + cargo update -p unicode-ident --precise 1.0.22 - name: Rebuild C bindings, and check the sample app builds + links run: | cd ldk-c-bindings @@ -459,6 +492,12 @@ jobs: git checkout origin/0.2-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" cd .. git clone https://github.com/lightningdevkit/ldk-c-bindings cd ldk-c-bindings @@ -466,11 +505,18 @@ jobs: cd lightning-c-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" - name: Pin proc-macro and quote to meet MSRV run: | cd ldk-c-bindings/c-bindings-gen cargo update -p quote --precise "1.0.30" --verbose cargo update -p proc-macro2 --precise "1.0.65" --verbose + cargo update -p unicode-ident --precise 1.0.22 - name: Rebuild C bindings, and check the sample app builds + links run: | cd ldk-c-bindings @@ -591,6 +637,12 @@ jobs: git checkout origin/0.2-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" cd .. git clone https://github.com/lightningdevkit/ldk-c-bindings cd ldk-c-bindings @@ -598,11 +650,18 @@ jobs: cd lightning-c-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" - name: Pin proc-macro and quote to meet MSRV run: | cd ldk-c-bindings/c-bindings-gen cargo update -p quote --precise "1.0.30" --verbose cargo update -p proc-macro2 --precise "1.0.65" --verbose + cargo update -p unicode-ident --precise 1.0.22 - name: Fetch MacOS SDK run: | curl -o Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz @@ -733,6 +792,12 @@ jobs: git checkout origin/0.2-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" cd .. git clone https://github.com/lightningdevkit/ldk-c-bindings cd ldk-c-bindings @@ -740,11 +805,18 @@ jobs: cd lightning-c-bindings cargo update -p syn --precise "2.0.106" --verbose cargo update -p quote --precise "1.0.41" --verbose + cargo update -p libc --precise 0.2.183 --verbose + cargo update -p serde_json --precise "1.0.145" --verbose + cargo update -p proc-macro2 --precise "1.0.103" --verbose + cargo update -p itoa --precise 1.0.15 + cargo update -p unicode-ident --precise 1.0.22 + cargo update -p ryu --precise "1.0.20" - name: Pin proc-macro and quote to meet MSRV run: | cd ldk-c-bindings/c-bindings-gen cargo update -p quote --precise "1.0.30" --verbose cargo update -p proc-macro2 --precise "1.0.65" --verbose + cargo update -p unicode-ident --precise 1.0.22 - name: Checkout Android AAR binaries and artifacts run: | # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract: From 3517f3e3abc8bfbf2782842f2ebfd0d60f16adb1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 1 Jul 2026 17:14:22 +0000 Subject: [PATCH 2/2] Update auto-generated bindings to 0.2.4 --- c_sharp/bindings.c | 638 +++++++++--------- c_sharp/bindings.c.body | 638 +++++++++--------- c_sharp/src/org/ldk/impl/bindings.cs | 30 +- c_sharp/src/org/ldk/structs/Bolt11Invoice.cs | 9 +- c_sharp/src/org/ldk/structs/ChannelManager.cs | 6 + .../org/ldk/structs/ChannelTypeFeatures.cs | 13 +- c_sharp/src/org/ldk/structs/Event.cs | 3 +- c_sharp/src/org/ldk/structs/InitFeatures.cs | 13 +- c_sharp/src/org/ldk/structs/NodeFeatures.cs | 13 +- .../src/org/ldk/structs/OffersMessageFlow.cs | 6 +- .../src/org/ldk/structs/RapidGossipSync.cs | 12 + c_sharp/src/org/ldk/structs/UtilMethods.cs | 2 +- src/main/java/org/ldk/impl/bindings.java | 30 +- .../java/org/ldk/structs/Bolt11Invoice.java | 9 +- .../java/org/ldk/structs/ChannelManager.java | 6 + .../org/ldk/structs/ChannelTypeFeatures.java | 13 +- src/main/java/org/ldk/structs/Event.java | 3 +- .../java/org/ldk/structs/InitFeatures.java | 13 +- .../java/org/ldk/structs/NodeFeatures.java | 13 +- .../org/ldk/structs/OffersMessageFlow.java | 6 +- .../java/org/ldk/structs/RapidGossipSync.java | 12 + src/main/jni/bindings.c | 54 +- src/main/jni/bindings.c.body | 54 +- src/main/jni/org_ldk_impl_bindings.h | 44 +- ts/bindings.c | 54 +- ts/bindings.c.body | 54 +- ts/bindings.mts | 63 +- ts/structs/Bolt11Invoice.mts | 9 +- ts/structs/ChannelManager.mts | 6 + ts/structs/ChannelTypeFeatures.mts | 12 +- ts/structs/Event.mts | 3 +- ts/structs/InitFeatures.mts | 12 +- ts/structs/NodeFeatures.mts | 12 +- ts/structs/OffersMessageFlow.mts | 4 +- ts/structs/RapidGossipSync.mts | 4 + 35 files changed, 1126 insertions(+), 747 deletions(-) diff --git a/c_sharp/bindings.c b/c_sharp/bindings.c index c73ed4df..1b92391e 100644 --- a/c_sharp/bindings.c +++ b/c_sharp/bindings.c @@ -359,66 +359,6 @@ static inline uint64_t tag_ptr(const void* ptr, bool is_owned) { } } -static inline LDKBalanceSource LDKBalanceSource_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKBalanceSource_HolderForceClosed; - case 1: return LDKBalanceSource_CounterpartyForceClosed; - case 2: return LDKBalanceSource_CoopClose; - case 3: return LDKBalanceSource_Htlc; - default: abort(); - } -} -static inline int32_t LDKBalanceSource_to_cs(LDKBalanceSource val) { - switch (val) { - case LDKBalanceSource_HolderForceClosed: return 0; - case LDKBalanceSource_CounterpartyForceClosed: return 1; - case LDKBalanceSource_CoopClose: return 2; - case LDKBalanceSource_Htlc: return 3; - default: abort(); - } -} -static inline LDKBlindedFailure LDKBlindedFailure_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKBlindedFailure_FromIntroductionNode; - case 1: return LDKBlindedFailure_FromBlindedNode; - default: abort(); - } -} -static inline int32_t LDKBlindedFailure_to_cs(LDKBlindedFailure val) { - switch (val) { - case LDKBlindedFailure_FromIntroductionNode: return 0; - case LDKBlindedFailure_FromBlindedNode: return 1; - default: abort(); - } -} -static inline LDKBolt11SemanticError LDKBolt11SemanticError_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKBolt11SemanticError_NoPaymentHash; - case 1: return LDKBolt11SemanticError_MultiplePaymentHashes; - case 2: return LDKBolt11SemanticError_NoDescription; - case 3: return LDKBolt11SemanticError_MultipleDescriptions; - case 4: return LDKBolt11SemanticError_NoPaymentSecret; - case 5: return LDKBolt11SemanticError_MultiplePaymentSecrets; - case 6: return LDKBolt11SemanticError_InvalidFeatures; - case 7: return LDKBolt11SemanticError_InvalidSignature; - case 8: return LDKBolt11SemanticError_ImpreciseAmount; - default: abort(); - } -} -static inline int32_t LDKBolt11SemanticError_to_cs(LDKBolt11SemanticError val) { - switch (val) { - case LDKBolt11SemanticError_NoPaymentHash: return 0; - case LDKBolt11SemanticError_MultiplePaymentHashes: return 1; - case LDKBolt11SemanticError_NoDescription: return 2; - case LDKBolt11SemanticError_MultipleDescriptions: return 3; - case LDKBolt11SemanticError_NoPaymentSecret: return 4; - case LDKBolt11SemanticError_MultiplePaymentSecrets: return 5; - case LDKBolt11SemanticError_InvalidFeatures: return 6; - case LDKBolt11SemanticError_InvalidSignature: return 7; - case LDKBolt11SemanticError_ImpreciseAmount: return 8; - default: abort(); - } -} static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_cs(int32_t ord) { switch (ord) { case 0: return LDKBolt12SemanticError_AlreadyExpired; @@ -493,17 +433,49 @@ static inline int32_t LDKBolt12SemanticError_to_cs(LDKBolt12SemanticError val) { default: abort(); } } -static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_cs(int32_t ord) { +static inline LDKIOError LDKIOError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKCOption_NoneZ_Some; - case 1: return LDKCOption_NoneZ_None; + case 0: return LDKIOError_NotFound; + case 1: return LDKIOError_PermissionDenied; + case 2: return LDKIOError_ConnectionRefused; + case 3: return LDKIOError_ConnectionReset; + case 4: return LDKIOError_ConnectionAborted; + case 5: return LDKIOError_NotConnected; + case 6: return LDKIOError_AddrInUse; + case 7: return LDKIOError_AddrNotAvailable; + case 8: return LDKIOError_BrokenPipe; + case 9: return LDKIOError_AlreadyExists; + case 10: return LDKIOError_WouldBlock; + case 11: return LDKIOError_InvalidInput; + case 12: return LDKIOError_InvalidData; + case 13: return LDKIOError_TimedOut; + case 14: return LDKIOError_WriteZero; + case 15: return LDKIOError_Interrupted; + case 16: return LDKIOError_Other; + case 17: return LDKIOError_UnexpectedEof; default: abort(); } } -static inline int32_t LDKCOption_NoneZ_to_cs(LDKCOption_NoneZ val) { +static inline int32_t LDKIOError_to_cs(LDKIOError val) { switch (val) { - case LDKCOption_NoneZ_Some: return 0; - case LDKCOption_NoneZ_None: return 1; + case LDKIOError_NotFound: return 0; + case LDKIOError_PermissionDenied: return 1; + case LDKIOError_ConnectionRefused: return 2; + case LDKIOError_ConnectionReset: return 3; + case LDKIOError_ConnectionAborted: return 4; + case LDKIOError_NotConnected: return 5; + case LDKIOError_AddrInUse: return 6; + case LDKIOError_AddrNotAvailable: return 7; + case LDKIOError_BrokenPipe: return 8; + case LDKIOError_AlreadyExists: return 9; + case LDKIOError_WouldBlock: return 10; + case LDKIOError_InvalidInput: return 11; + case LDKIOError_InvalidData: return 12; + case LDKIOError_TimedOut: return 13; + case LDKIOError_WriteZero: return 14; + case LDKIOError_Interrupted: return 15; + case LDKIOError_Other: return 16; + case LDKIOError_UnexpectedEof: return 17; default: abort(); } } @@ -523,49 +495,121 @@ static inline int32_t LDKChannelMonitorUpdateStatus_to_cs(LDKChannelMonitorUpdat default: abort(); } } -static inline LDKChannelShutdownState LDKChannelShutdownState_from_cs(int32_t ord) { +static inline LDKShortChannelIdError LDKShortChannelIdError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKChannelShutdownState_NotShuttingDown; - case 1: return LDKChannelShutdownState_ShutdownInitiated; - case 2: return LDKChannelShutdownState_ResolvingHTLCs; - case 3: return LDKChannelShutdownState_NegotiatingClosingFee; - case 4: return LDKChannelShutdownState_ShutdownComplete; + case 0: return LDKShortChannelIdError_BlockOverflow; + case 1: return LDKShortChannelIdError_TxIndexOverflow; + case 2: return LDKShortChannelIdError_VoutIndexOverflow; default: abort(); } } -static inline int32_t LDKChannelShutdownState_to_cs(LDKChannelShutdownState val) { +static inline int32_t LDKShortChannelIdError_to_cs(LDKShortChannelIdError val) { switch (val) { - case LDKChannelShutdownState_NotShuttingDown: return 0; - case LDKChannelShutdownState_ShutdownInitiated: return 1; - case LDKChannelShutdownState_ResolvingHTLCs: return 2; - case LDKChannelShutdownState_NegotiatingClosingFee: return 3; - case LDKChannelShutdownState_ShutdownComplete: return 4; + case LDKShortChannelIdError_BlockOverflow: return 0; + case LDKShortChannelIdError_TxIndexOverflow: return 1; + case LDKShortChannelIdError_VoutIndexOverflow: return 2; default: abort(); } } -static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { +static inline LDKSecp256k1Error LDKSecp256k1Error_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKConfirmationTarget_MaximumFeeEstimate; - case 1: return LDKConfirmationTarget_UrgentOnChainSweep; - case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; - case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; - case 4: return LDKConfirmationTarget_AnchorChannelFee; - case 5: return LDKConfirmationTarget_NonAnchorChannelFee; - case 6: return LDKConfirmationTarget_ChannelCloseMinimum; - case 7: return LDKConfirmationTarget_OutputSpendingFee; + case 0: return LDKSecp256k1Error_IncorrectSignature; + case 1: return LDKSecp256k1Error_InvalidMessage; + case 2: return LDKSecp256k1Error_InvalidPublicKey; + case 3: return LDKSecp256k1Error_InvalidSignature; + case 4: return LDKSecp256k1Error_InvalidSecretKey; + case 5: return LDKSecp256k1Error_InvalidSharedSecret; + case 6: return LDKSecp256k1Error_InvalidRecoveryId; + case 7: return LDKSecp256k1Error_InvalidTweak; + case 8: return LDKSecp256k1Error_NotEnoughMemory; + case 9: return LDKSecp256k1Error_InvalidPublicKeySum; + case 10: return LDKSecp256k1Error_InvalidParityValue; + case 11: return LDKSecp256k1Error_InvalidEllSwift; default: abort(); } } -static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { +static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { switch (val) { - case LDKConfirmationTarget_MaximumFeeEstimate: return 0; - case LDKConfirmationTarget_UrgentOnChainSweep: return 1; - case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 2; - case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 3; - case LDKConfirmationTarget_AnchorChannelFee: return 4; - case LDKConfirmationTarget_NonAnchorChannelFee: return 5; - case LDKConfirmationTarget_ChannelCloseMinimum: return 6; - case LDKConfirmationTarget_OutputSpendingFee: return 7; + case LDKSecp256k1Error_IncorrectSignature: return 0; + case LDKSecp256k1Error_InvalidMessage: return 1; + case LDKSecp256k1Error_InvalidPublicKey: return 2; + case LDKSecp256k1Error_InvalidSignature: return 3; + case LDKSecp256k1Error_InvalidSecretKey: return 4; + case LDKSecp256k1Error_InvalidSharedSecret: return 5; + case LDKSecp256k1Error_InvalidRecoveryId: return 6; + case LDKSecp256k1Error_InvalidTweak: return 7; + case LDKSecp256k1Error_NotEnoughMemory: return 8; + case LDKSecp256k1Error_InvalidPublicKeySum: return 9; + case LDKSecp256k1Error_InvalidParityValue: return 10; + case LDKSecp256k1Error_InvalidEllSwift: return 11; + default: abort(); + } +} +static inline LDKUtxoLookupError LDKUtxoLookupError_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKUtxoLookupError_UnknownChain; + case 1: return LDKUtxoLookupError_UnknownTx; + default: abort(); + } +} +static inline int32_t LDKUtxoLookupError_to_cs(LDKUtxoLookupError val) { + switch (val) { + case LDKUtxoLookupError_UnknownChain: return 0; + case LDKUtxoLookupError_UnknownTx: return 1; + default: abort(); + } +} +static inline LDKLevel LDKLevel_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKLevel_Gossip; + case 1: return LDKLevel_Trace; + case 2: return LDKLevel_Debug; + case 3: return LDKLevel_Info; + case 4: return LDKLevel_Warn; + case 5: return LDKLevel_Error; + default: abort(); + } +} +static inline int32_t LDKLevel_to_cs(LDKLevel val) { + switch (val) { + case LDKLevel_Gossip: return 0; + case LDKLevel_Trace: return 1; + case LDKLevel_Debug: return 2; + case LDKLevel_Info: return 3; + case LDKLevel_Warn: return 4; + case LDKLevel_Error: return 5; + default: abort(); + } +} +static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKCOption_NoneZ_Some; + case 1: return LDKCOption_NoneZ_None; + default: abort(); + } +} +static inline int32_t LDKCOption_NoneZ_to_cs(LDKCOption_NoneZ val) { + switch (val) { + case LDKCOption_NoneZ_Some: return 0; + case LDKCOption_NoneZ_None: return 1; + default: abort(); + } +} +static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKRetryableSendFailure_PaymentExpired; + case 1: return LDKRetryableSendFailure_RouteNotFound; + case 2: return LDKRetryableSendFailure_DuplicatePayment; + case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; + default: abort(); + } +} +static inline int32_t LDKRetryableSendFailure_to_cs(LDKRetryableSendFailure val) { + switch (val) { + case LDKRetryableSendFailure_PaymentExpired: return 0; + case LDKRetryableSendFailure_RouteNotFound: return 1; + case LDKRetryableSendFailure_DuplicatePayment: return 2; + case LDKRetryableSendFailure_OnionPacketSizeExceeded: return 3; default: abort(); } } @@ -591,115 +635,93 @@ static inline int32_t LDKCreationError_to_cs(LDKCreationError val) { default: abort(); } } -static inline LDKCurrency LDKCurrency_from_cs(int32_t ord) { +static inline LDKBlindedFailure LDKBlindedFailure_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKCurrency_Bitcoin; - case 1: return LDKCurrency_BitcoinTestnet; - case 2: return LDKCurrency_Regtest; - case 3: return LDKCurrency_Simnet; - case 4: return LDKCurrency_Signet; + case 0: return LDKBlindedFailure_FromIntroductionNode; + case 1: return LDKBlindedFailure_FromBlindedNode; default: abort(); } } -static inline int32_t LDKCurrency_to_cs(LDKCurrency val) { +static inline int32_t LDKBlindedFailure_to_cs(LDKBlindedFailure val) { switch (val) { - case LDKCurrency_Bitcoin: return 0; - case LDKCurrency_BitcoinTestnet: return 1; - case LDKCurrency_Regtest: return 2; - case LDKCurrency_Simnet: return 3; - case LDKCurrency_Signet: return 4; + case LDKBlindedFailure_FromIntroductionNode: return 0; + case LDKBlindedFailure_FromBlindedNode: return 1; default: abort(); } } -static inline LDKDirection LDKDirection_from_cs(int32_t ord) { +static inline LDKRecipient LDKRecipient_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKDirection_NodeOne; - case 1: return LDKDirection_NodeTwo; + case 0: return LDKRecipient_Node; + case 1: return LDKRecipient_PhantomNode; default: abort(); } } -static inline int32_t LDKDirection_to_cs(LDKDirection val) { +static inline int32_t LDKRecipient_to_cs(LDKRecipient val) { switch (val) { - case LDKDirection_NodeOne: return 0; - case LDKDirection_NodeTwo: return 1; + case LDKRecipient_Node: return 0; + case LDKRecipient_PhantomNode: return 1; default: abort(); } } -static inline LDKFundingLockedFlags LDKFundingLockedFlags_from_cs(int32_t ord) { +static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKFundingLockedFlags_AnnouncementSignatures; + case 0: return LDKConfirmationTarget_MaximumFeeEstimate; + case 1: return LDKConfirmationTarget_UrgentOnChainSweep; + case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; + case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; + case 4: return LDKConfirmationTarget_AnchorChannelFee; + case 5: return LDKConfirmationTarget_NonAnchorChannelFee; + case 6: return LDKConfirmationTarget_ChannelCloseMinimum; + case 7: return LDKConfirmationTarget_OutputSpendingFee; default: abort(); } } -static inline int32_t LDKFundingLockedFlags_to_cs(LDKFundingLockedFlags val) { +static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { switch (val) { - case LDKFundingLockedFlags_AnnouncementSignatures: return 0; + case LDKConfirmationTarget_MaximumFeeEstimate: return 0; + case LDKConfirmationTarget_UrgentOnChainSweep: return 1; + case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 2; + case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 3; + case LDKConfirmationTarget_AnchorChannelFee: return 4; + case LDKConfirmationTarget_NonAnchorChannelFee: return 5; + case LDKConfirmationTarget_ChannelCloseMinimum: return 6; + case LDKConfirmationTarget_OutputSpendingFee: return 7; default: abort(); } } -static inline LDKHTLCClaim LDKHTLCClaim_from_cs(int32_t ord) { +static inline LDKBalanceSource LDKBalanceSource_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKHTLCClaim_OfferedTimeout; - case 1: return LDKHTLCClaim_OfferedPreimage; - case 2: return LDKHTLCClaim_AcceptedTimeout; - case 3: return LDKHTLCClaim_AcceptedPreimage; - case 4: return LDKHTLCClaim_Revocation; + case 0: return LDKBalanceSource_HolderForceClosed; + case 1: return LDKBalanceSource_CounterpartyForceClosed; + case 2: return LDKBalanceSource_CoopClose; + case 3: return LDKBalanceSource_Htlc; default: abort(); } } -static inline int32_t LDKHTLCClaim_to_cs(LDKHTLCClaim val) { +static inline int32_t LDKBalanceSource_to_cs(LDKBalanceSource val) { switch (val) { - case LDKHTLCClaim_OfferedTimeout: return 0; - case LDKHTLCClaim_OfferedPreimage: return 1; - case LDKHTLCClaim_AcceptedTimeout: return 2; - case LDKHTLCClaim_AcceptedPreimage: return 3; - case LDKHTLCClaim_Revocation: return 4; + case LDKBalanceSource_HolderForceClosed: return 0; + case LDKBalanceSource_CounterpartyForceClosed: return 1; + case LDKBalanceSource_CoopClose: return 2; + case LDKBalanceSource_Htlc: return 3; default: abort(); } } -static inline LDKIOError LDKIOError_from_cs(int32_t ord) { +static inline LDKSocketAddressParseError LDKSocketAddressParseError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKIOError_NotFound; - case 1: return LDKIOError_PermissionDenied; - case 2: return LDKIOError_ConnectionRefused; - case 3: return LDKIOError_ConnectionReset; - case 4: return LDKIOError_ConnectionAborted; - case 5: return LDKIOError_NotConnected; - case 6: return LDKIOError_AddrInUse; - case 7: return LDKIOError_AddrNotAvailable; - case 8: return LDKIOError_BrokenPipe; - case 9: return LDKIOError_AlreadyExists; - case 10: return LDKIOError_WouldBlock; - case 11: return LDKIOError_InvalidInput; - case 12: return LDKIOError_InvalidData; - case 13: return LDKIOError_TimedOut; - case 14: return LDKIOError_WriteZero; - case 15: return LDKIOError_Interrupted; - case 16: return LDKIOError_Other; - case 17: return LDKIOError_UnexpectedEof; + case 0: return LDKSocketAddressParseError_SocketAddrParse; + case 1: return LDKSocketAddressParseError_InvalidInput; + case 2: return LDKSocketAddressParseError_InvalidPort; + case 3: return LDKSocketAddressParseError_InvalidOnionV3; default: abort(); } } -static inline int32_t LDKIOError_to_cs(LDKIOError val) { +static inline int32_t LDKSocketAddressParseError_to_cs(LDKSocketAddressParseError val) { switch (val) { - case LDKIOError_NotFound: return 0; - case LDKIOError_PermissionDenied: return 1; - case LDKIOError_ConnectionRefused: return 2; - case LDKIOError_ConnectionReset: return 3; - case LDKIOError_ConnectionAborted: return 4; - case LDKIOError_NotConnected: return 5; - case LDKIOError_AddrInUse: return 6; - case LDKIOError_AddrNotAvailable: return 7; - case LDKIOError_BrokenPipe: return 8; - case LDKIOError_AlreadyExists: return 9; - case LDKIOError_WouldBlock: return 10; - case LDKIOError_InvalidInput: return 11; - case LDKIOError_InvalidData: return 12; - case LDKIOError_TimedOut: return 13; - case LDKIOError_WriteZero: return 14; - case LDKIOError_Interrupted: return 15; - case LDKIOError_Other: return 16; - case LDKIOError_UnexpectedEof: return 17; + case LDKSocketAddressParseError_SocketAddrParse: return 0; + case LDKSocketAddressParseError_InvalidInput: return 1; + case LDKSocketAddressParseError_InvalidPort: return 2; + case LDKSocketAddressParseError_InvalidOnionV3: return 3; default: abort(); } } @@ -721,75 +743,61 @@ static inline int32_t LDKInboundHTLCStateDetails_to_cs(LDKInboundHTLCStateDetail default: abort(); } } -static inline LDKLevel LDKLevel_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKLevel_Gossip; - case 1: return LDKLevel_Trace; - case 2: return LDKLevel_Debug; - case 3: return LDKLevel_Info; - case 4: return LDKLevel_Warn; - case 5: return LDKLevel_Error; - default: abort(); - } -} -static inline int32_t LDKLevel_to_cs(LDKLevel val) { - switch (val) { - case LDKLevel_Gossip: return 0; - case LDKLevel_Trace: return 1; - case LDKLevel_Debug: return 2; - case LDKLevel_Info: return 3; - case LDKLevel_Warn: return 4; - case LDKLevel_Error: return 5; - default: abort(); - } -} -static inline LDKNetwork LDKNetwork_from_cs(int32_t ord) { +static inline LDKOutboundHTLCStateDetails LDKOutboundHTLCStateDetails_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKNetwork_Bitcoin; - case 1: return LDKNetwork_Testnet3; - case 2: return LDKNetwork_Testnet4; - case 3: return LDKNetwork_Regtest; - case 4: return LDKNetwork_Signet; + case 0: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKOutboundHTLCStateDetails_Committed; + case 2: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess; + case 3: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure; default: abort(); } } -static inline int32_t LDKNetwork_to_cs(LDKNetwork val) { +static inline int32_t LDKOutboundHTLCStateDetails_to_cs(LDKOutboundHTLCStateDetails val) { switch (val) { - case LDKNetwork_Bitcoin: return 0; - case LDKNetwork_Testnet3: return 1; - case LDKNetwork_Testnet4: return 2; - case LDKNetwork_Regtest: return 3; - case LDKNetwork_Signet: return 4; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKOutboundHTLCStateDetails_Committed: return 1; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess: return 2; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure: return 3; default: abort(); } } -static inline LDKNextFundingFlag LDKNextFundingFlag_from_cs(int32_t ord) { +static inline LDKChannelShutdownState LDKChannelShutdownState_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKNextFundingFlag_CommitmentSigned; + case 0: return LDKChannelShutdownState_NotShuttingDown; + case 1: return LDKChannelShutdownState_ShutdownInitiated; + case 2: return LDKChannelShutdownState_ResolvingHTLCs; + case 3: return LDKChannelShutdownState_NegotiatingClosingFee; + case 4: return LDKChannelShutdownState_ShutdownComplete; default: abort(); } } -static inline int32_t LDKNextFundingFlag_to_cs(LDKNextFundingFlag val) { +static inline int32_t LDKChannelShutdownState_to_cs(LDKChannelShutdownState val) { switch (val) { - case LDKNextFundingFlag_CommitmentSigned: return 0; + case LDKChannelShutdownState_NotShuttingDown: return 0; + case LDKChannelShutdownState_ShutdownInitiated: return 1; + case LDKChannelShutdownState_ResolvingHTLCs: return 2; + case LDKChannelShutdownState_NegotiatingClosingFee: return 3; + case LDKChannelShutdownState_ShutdownComplete: return 4; default: abort(); } } -static inline LDKOutboundHTLCStateDetails LDKOutboundHTLCStateDetails_from_cs(int32_t ord) { +static inline LDKHTLCClaim LDKHTLCClaim_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; - case 1: return LDKOutboundHTLCStateDetails_Committed; - case 2: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess; - case 3: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure; + case 0: return LDKHTLCClaim_OfferedTimeout; + case 1: return LDKHTLCClaim_OfferedPreimage; + case 2: return LDKHTLCClaim_AcceptedTimeout; + case 3: return LDKHTLCClaim_AcceptedPreimage; + case 4: return LDKHTLCClaim_Revocation; default: abort(); } } -static inline int32_t LDKOutboundHTLCStateDetails_to_cs(LDKOutboundHTLCStateDetails val) { +static inline int32_t LDKHTLCClaim_to_cs(LDKHTLCClaim val) { switch (val) { - case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; - case LDKOutboundHTLCStateDetails_Committed: return 1; - case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess: return 2; - case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure: return 3; + case LDKHTLCClaim_OfferedTimeout: return 0; + case LDKHTLCClaim_OfferedPreimage: return 1; + case LDKHTLCClaim_AcceptedTimeout: return 2; + case LDKHTLCClaim_AcceptedPreimage: return 3; + case LDKHTLCClaim_Revocation: return 4; default: abort(); } } @@ -823,135 +831,127 @@ static inline int32_t LDKPaymentFailureReason_to_cs(LDKPaymentFailureReason val) default: abort(); } } -static inline LDKRecipient LDKRecipient_from_cs(int32_t ord) { +static inline LDKSiPrefix LDKSiPrefix_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKRecipient_Node; - case 1: return LDKRecipient_PhantomNode; + case 0: return LDKSiPrefix_Milli; + case 1: return LDKSiPrefix_Micro; + case 2: return LDKSiPrefix_Nano; + case 3: return LDKSiPrefix_Pico; default: abort(); } } -static inline int32_t LDKRecipient_to_cs(LDKRecipient val) { +static inline int32_t LDKSiPrefix_to_cs(LDKSiPrefix val) { switch (val) { - case LDKRecipient_Node: return 0; - case LDKRecipient_PhantomNode: return 1; + case LDKSiPrefix_Milli: return 0; + case LDKSiPrefix_Micro: return 1; + case LDKSiPrefix_Nano: return 2; + case LDKSiPrefix_Pico: return 3; default: abort(); } } -static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_cs(int32_t ord) { +static inline LDKBolt11SemanticError LDKBolt11SemanticError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKRetryableSendFailure_PaymentExpired; - case 1: return LDKRetryableSendFailure_RouteNotFound; - case 2: return LDKRetryableSendFailure_DuplicatePayment; - case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; + case 0: return LDKBolt11SemanticError_NoPaymentHash; + case 1: return LDKBolt11SemanticError_MultiplePaymentHashes; + case 2: return LDKBolt11SemanticError_NoDescription; + case 3: return LDKBolt11SemanticError_MultipleDescriptions; + case 4: return LDKBolt11SemanticError_NoPaymentSecret; + case 5: return LDKBolt11SemanticError_MultiplePaymentSecrets; + case 6: return LDKBolt11SemanticError_InvalidFeatures; + case 7: return LDKBolt11SemanticError_InvalidSignature; + case 8: return LDKBolt11SemanticError_ImpreciseAmount; default: abort(); } } -static inline int32_t LDKRetryableSendFailure_to_cs(LDKRetryableSendFailure val) { +static inline int32_t LDKBolt11SemanticError_to_cs(LDKBolt11SemanticError val) { switch (val) { - case LDKRetryableSendFailure_PaymentExpired: return 0; - case LDKRetryableSendFailure_RouteNotFound: return 1; - case LDKRetryableSendFailure_DuplicatePayment: return 2; - case LDKRetryableSendFailure_OnionPacketSizeExceeded: return 3; + case LDKBolt11SemanticError_NoPaymentHash: return 0; + case LDKBolt11SemanticError_MultiplePaymentHashes: return 1; + case LDKBolt11SemanticError_NoDescription: return 2; + case LDKBolt11SemanticError_MultipleDescriptions: return 3; + case LDKBolt11SemanticError_NoPaymentSecret: return 4; + case LDKBolt11SemanticError_MultiplePaymentSecrets: return 5; + case LDKBolt11SemanticError_InvalidFeatures: return 6; + case LDKBolt11SemanticError_InvalidSignature: return 7; + case LDKBolt11SemanticError_ImpreciseAmount: return 8; default: abort(); } } -static inline LDKSecp256k1Error LDKSecp256k1Error_from_cs(int32_t ord) { +static inline LDKDirection LDKDirection_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKSecp256k1Error_IncorrectSignature; - case 1: return LDKSecp256k1Error_InvalidMessage; - case 2: return LDKSecp256k1Error_InvalidPublicKey; - case 3: return LDKSecp256k1Error_InvalidSignature; - case 4: return LDKSecp256k1Error_InvalidSecretKey; - case 5: return LDKSecp256k1Error_InvalidSharedSecret; - case 6: return LDKSecp256k1Error_InvalidRecoveryId; - case 7: return LDKSecp256k1Error_InvalidTweak; - case 8: return LDKSecp256k1Error_NotEnoughMemory; - case 9: return LDKSecp256k1Error_InvalidPublicKeySum; - case 10: return LDKSecp256k1Error_InvalidParityValue; - case 11: return LDKSecp256k1Error_InvalidEllSwift; + case 0: return LDKDirection_NodeOne; + case 1: return LDKDirection_NodeTwo; default: abort(); } } -static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { +static inline int32_t LDKDirection_to_cs(LDKDirection val) { switch (val) { - case LDKSecp256k1Error_IncorrectSignature: return 0; - case LDKSecp256k1Error_InvalidMessage: return 1; - case LDKSecp256k1Error_InvalidPublicKey: return 2; - case LDKSecp256k1Error_InvalidSignature: return 3; - case LDKSecp256k1Error_InvalidSecretKey: return 4; - case LDKSecp256k1Error_InvalidSharedSecret: return 5; - case LDKSecp256k1Error_InvalidRecoveryId: return 6; - case LDKSecp256k1Error_InvalidTweak: return 7; - case LDKSecp256k1Error_NotEnoughMemory: return 8; - case LDKSecp256k1Error_InvalidPublicKeySum: return 9; - case LDKSecp256k1Error_InvalidParityValue: return 10; - case LDKSecp256k1Error_InvalidEllSwift: return 11; + case LDKDirection_NodeOne: return 0; + case LDKDirection_NodeTwo: return 1; default: abort(); } } -static inline LDKShortChannelIdError LDKShortChannelIdError_from_cs(int32_t ord) { +static inline LDKNetwork LDKNetwork_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKShortChannelIdError_BlockOverflow; - case 1: return LDKShortChannelIdError_TxIndexOverflow; - case 2: return LDKShortChannelIdError_VoutIndexOverflow; + case 0: return LDKNetwork_Bitcoin; + case 1: return LDKNetwork_Testnet3; + case 2: return LDKNetwork_Testnet4; + case 3: return LDKNetwork_Regtest; + case 4: return LDKNetwork_Signet; default: abort(); } } -static inline int32_t LDKShortChannelIdError_to_cs(LDKShortChannelIdError val) { +static inline int32_t LDKNetwork_to_cs(LDKNetwork val) { switch (val) { - case LDKShortChannelIdError_BlockOverflow: return 0; - case LDKShortChannelIdError_TxIndexOverflow: return 1; - case LDKShortChannelIdError_VoutIndexOverflow: return 2; + case LDKNetwork_Bitcoin: return 0; + case LDKNetwork_Testnet3: return 1; + case LDKNetwork_Testnet4: return 2; + case LDKNetwork_Regtest: return 3; + case LDKNetwork_Signet: return 4; default: abort(); } } -static inline LDKSiPrefix LDKSiPrefix_from_cs(int32_t ord) { +static inline LDKNextFundingFlag LDKNextFundingFlag_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKSiPrefix_Milli; - case 1: return LDKSiPrefix_Micro; - case 2: return LDKSiPrefix_Nano; - case 3: return LDKSiPrefix_Pico; + case 0: return LDKNextFundingFlag_CommitmentSigned; default: abort(); } } -static inline int32_t LDKSiPrefix_to_cs(LDKSiPrefix val) { +static inline int32_t LDKNextFundingFlag_to_cs(LDKNextFundingFlag val) { switch (val) { - case LDKSiPrefix_Milli: return 0; - case LDKSiPrefix_Micro: return 1; - case LDKSiPrefix_Nano: return 2; - case LDKSiPrefix_Pico: return 3; + case LDKNextFundingFlag_CommitmentSigned: return 0; default: abort(); } } -static inline LDKSocketAddressParseError LDKSocketAddressParseError_from_cs(int32_t ord) { +static inline LDKFundingLockedFlags LDKFundingLockedFlags_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKSocketAddressParseError_SocketAddrParse; - case 1: return LDKSocketAddressParseError_InvalidInput; - case 2: return LDKSocketAddressParseError_InvalidPort; - case 3: return LDKSocketAddressParseError_InvalidOnionV3; + case 0: return LDKFundingLockedFlags_AnnouncementSignatures; default: abort(); } } -static inline int32_t LDKSocketAddressParseError_to_cs(LDKSocketAddressParseError val) { +static inline int32_t LDKFundingLockedFlags_to_cs(LDKFundingLockedFlags val) { switch (val) { - case LDKSocketAddressParseError_SocketAddrParse: return 0; - case LDKSocketAddressParseError_InvalidInput: return 1; - case LDKSocketAddressParseError_InvalidPort: return 2; - case LDKSocketAddressParseError_InvalidOnionV3: return 3; + case LDKFundingLockedFlags_AnnouncementSignatures: return 0; default: abort(); } } -static inline LDKUtxoLookupError LDKUtxoLookupError_from_cs(int32_t ord) { +static inline LDKCurrency LDKCurrency_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKUtxoLookupError_UnknownChain; - case 1: return LDKUtxoLookupError_UnknownTx; + case 0: return LDKCurrency_Bitcoin; + case 1: return LDKCurrency_BitcoinTestnet; + case 2: return LDKCurrency_Regtest; + case 3: return LDKCurrency_Simnet; + case 4: return LDKCurrency_Signet; default: abort(); } } -static inline int32_t LDKUtxoLookupError_to_cs(LDKUtxoLookupError val) { +static inline int32_t LDKCurrency_to_cs(LDKCurrency val) { switch (val) { - case LDKUtxoLookupError_UnknownChain: return 0; - case LDKUtxoLookupError_UnknownTx: return 1; + case LDKCurrency_Bitcoin: return 0; + case LDKCurrency_BitcoinTestnet: return 1; + case LDKCurrency_Regtest: return 2; + case LDKCurrency_Simnet: return 3; + case LDKCurrency_Signet: return 4; default: abort(); } } @@ -84267,7 +84267,7 @@ int64_t CS_LDK_OffersMessageFlow_set_paths_to_static_invoice_server(int64_t thi return tag_ptr(ret_conv, true); } -void CS_LDK_OffersMessageFlow_best_block_updated(int64_t this_arg, uint8_tArray header, uint32_t _height) { +void CS_LDK_OffersMessageFlow_best_block_updated(int64_t this_arg, uint8_tArray header, uint32_t height) { LDKOffersMessageFlow this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -84277,7 +84277,7 @@ void CS_LDK_OffersMessageFlow_best_block_updated(int64_t this_arg, uint8_tArray CHECK(header->arr_len == 80); memcpy(header_arr, header->elems, 80); FREE(header); uint8_t (*header_ref)[80] = &header_arr; - OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, _height); + OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, height); } int64_t CS_LDK_OffersMessageFlow_blinded_paths_for_async_recipient(int64_t this_arg, uint8_tArray recipient_id, int64_t relative_expiry, int64_tArray peers) { @@ -104959,22 +104959,22 @@ void CS_LDK_InitFeatures_set_zero_conf_required(int64_t this_arg) { InitFeatures_set_zero_conf_required(&this_arg_conv); } -void CS_LDK_InitFeatures_supports_zero_conf(int64_t this_arg) { +void CS_LDK_InitFeatures_clear_zero_conf(int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_supports_zero_conf(&this_arg_conv); + InitFeatures_clear_zero_conf(&this_arg_conv); } -jboolean CS_LDK_InitFeatures_requires_zero_conf(int64_t this_arg) { +jboolean CS_LDK_InitFeatures_supports_zero_conf(int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -104996,22 +104996,22 @@ void CS_LDK_NodeFeatures_set_zero_conf_required(int64_t this_arg) { NodeFeatures_set_zero_conf_required(&this_arg_conv); } -void CS_LDK_NodeFeatures_supports_zero_conf(int64_t this_arg) { +void CS_LDK_NodeFeatures_clear_zero_conf(int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_supports_zero_conf(&this_arg_conv); + NodeFeatures_clear_zero_conf(&this_arg_conv); } -jboolean CS_LDK_NodeFeatures_requires_zero_conf(int64_t this_arg) { +jboolean CS_LDK_NodeFeatures_supports_zero_conf(int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -105033,13 +105033,43 @@ void CS_LDK_ChannelTypeFeatures_set_zero_conf_required(int64_t this_arg) { ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -void CS_LDK_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { +void CS_LDK_ChannelTypeFeatures_clear_zero_conf(int64_t this_arg) { LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + ChannelTypeFeatures_clear_zero_conf(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_zero_conf(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_zero_conf(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } jboolean CS_LDK_ChannelTypeFeatures_requires_zero_conf(int64_t this_arg) { diff --git a/c_sharp/bindings.c.body b/c_sharp/bindings.c.body index 6f197c33..9b0b44f6 100644 --- a/c_sharp/bindings.c.body +++ b/c_sharp/bindings.c.body @@ -355,66 +355,6 @@ static inline uint64_t tag_ptr(const void* ptr, bool is_owned) { } } -static inline LDKBalanceSource LDKBalanceSource_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKBalanceSource_HolderForceClosed; - case 1: return LDKBalanceSource_CounterpartyForceClosed; - case 2: return LDKBalanceSource_CoopClose; - case 3: return LDKBalanceSource_Htlc; - default: abort(); - } -} -static inline int32_t LDKBalanceSource_to_cs(LDKBalanceSource val) { - switch (val) { - case LDKBalanceSource_HolderForceClosed: return 0; - case LDKBalanceSource_CounterpartyForceClosed: return 1; - case LDKBalanceSource_CoopClose: return 2; - case LDKBalanceSource_Htlc: return 3; - default: abort(); - } -} -static inline LDKBlindedFailure LDKBlindedFailure_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKBlindedFailure_FromIntroductionNode; - case 1: return LDKBlindedFailure_FromBlindedNode; - default: abort(); - } -} -static inline int32_t LDKBlindedFailure_to_cs(LDKBlindedFailure val) { - switch (val) { - case LDKBlindedFailure_FromIntroductionNode: return 0; - case LDKBlindedFailure_FromBlindedNode: return 1; - default: abort(); - } -} -static inline LDKBolt11SemanticError LDKBolt11SemanticError_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKBolt11SemanticError_NoPaymentHash; - case 1: return LDKBolt11SemanticError_MultiplePaymentHashes; - case 2: return LDKBolt11SemanticError_NoDescription; - case 3: return LDKBolt11SemanticError_MultipleDescriptions; - case 4: return LDKBolt11SemanticError_NoPaymentSecret; - case 5: return LDKBolt11SemanticError_MultiplePaymentSecrets; - case 6: return LDKBolt11SemanticError_InvalidFeatures; - case 7: return LDKBolt11SemanticError_InvalidSignature; - case 8: return LDKBolt11SemanticError_ImpreciseAmount; - default: abort(); - } -} -static inline int32_t LDKBolt11SemanticError_to_cs(LDKBolt11SemanticError val) { - switch (val) { - case LDKBolt11SemanticError_NoPaymentHash: return 0; - case LDKBolt11SemanticError_MultiplePaymentHashes: return 1; - case LDKBolt11SemanticError_NoDescription: return 2; - case LDKBolt11SemanticError_MultipleDescriptions: return 3; - case LDKBolt11SemanticError_NoPaymentSecret: return 4; - case LDKBolt11SemanticError_MultiplePaymentSecrets: return 5; - case LDKBolt11SemanticError_InvalidFeatures: return 6; - case LDKBolt11SemanticError_InvalidSignature: return 7; - case LDKBolt11SemanticError_ImpreciseAmount: return 8; - default: abort(); - } -} static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_cs(int32_t ord) { switch (ord) { case 0: return LDKBolt12SemanticError_AlreadyExpired; @@ -489,17 +429,49 @@ static inline int32_t LDKBolt12SemanticError_to_cs(LDKBolt12SemanticError val) { default: abort(); } } -static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_cs(int32_t ord) { +static inline LDKIOError LDKIOError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKCOption_NoneZ_Some; - case 1: return LDKCOption_NoneZ_None; + case 0: return LDKIOError_NotFound; + case 1: return LDKIOError_PermissionDenied; + case 2: return LDKIOError_ConnectionRefused; + case 3: return LDKIOError_ConnectionReset; + case 4: return LDKIOError_ConnectionAborted; + case 5: return LDKIOError_NotConnected; + case 6: return LDKIOError_AddrInUse; + case 7: return LDKIOError_AddrNotAvailable; + case 8: return LDKIOError_BrokenPipe; + case 9: return LDKIOError_AlreadyExists; + case 10: return LDKIOError_WouldBlock; + case 11: return LDKIOError_InvalidInput; + case 12: return LDKIOError_InvalidData; + case 13: return LDKIOError_TimedOut; + case 14: return LDKIOError_WriteZero; + case 15: return LDKIOError_Interrupted; + case 16: return LDKIOError_Other; + case 17: return LDKIOError_UnexpectedEof; default: abort(); } } -static inline int32_t LDKCOption_NoneZ_to_cs(LDKCOption_NoneZ val) { +static inline int32_t LDKIOError_to_cs(LDKIOError val) { switch (val) { - case LDKCOption_NoneZ_Some: return 0; - case LDKCOption_NoneZ_None: return 1; + case LDKIOError_NotFound: return 0; + case LDKIOError_PermissionDenied: return 1; + case LDKIOError_ConnectionRefused: return 2; + case LDKIOError_ConnectionReset: return 3; + case LDKIOError_ConnectionAborted: return 4; + case LDKIOError_NotConnected: return 5; + case LDKIOError_AddrInUse: return 6; + case LDKIOError_AddrNotAvailable: return 7; + case LDKIOError_BrokenPipe: return 8; + case LDKIOError_AlreadyExists: return 9; + case LDKIOError_WouldBlock: return 10; + case LDKIOError_InvalidInput: return 11; + case LDKIOError_InvalidData: return 12; + case LDKIOError_TimedOut: return 13; + case LDKIOError_WriteZero: return 14; + case LDKIOError_Interrupted: return 15; + case LDKIOError_Other: return 16; + case LDKIOError_UnexpectedEof: return 17; default: abort(); } } @@ -519,49 +491,121 @@ static inline int32_t LDKChannelMonitorUpdateStatus_to_cs(LDKChannelMonitorUpdat default: abort(); } } -static inline LDKChannelShutdownState LDKChannelShutdownState_from_cs(int32_t ord) { +static inline LDKShortChannelIdError LDKShortChannelIdError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKChannelShutdownState_NotShuttingDown; - case 1: return LDKChannelShutdownState_ShutdownInitiated; - case 2: return LDKChannelShutdownState_ResolvingHTLCs; - case 3: return LDKChannelShutdownState_NegotiatingClosingFee; - case 4: return LDKChannelShutdownState_ShutdownComplete; + case 0: return LDKShortChannelIdError_BlockOverflow; + case 1: return LDKShortChannelIdError_TxIndexOverflow; + case 2: return LDKShortChannelIdError_VoutIndexOverflow; default: abort(); } } -static inline int32_t LDKChannelShutdownState_to_cs(LDKChannelShutdownState val) { +static inline int32_t LDKShortChannelIdError_to_cs(LDKShortChannelIdError val) { switch (val) { - case LDKChannelShutdownState_NotShuttingDown: return 0; - case LDKChannelShutdownState_ShutdownInitiated: return 1; - case LDKChannelShutdownState_ResolvingHTLCs: return 2; - case LDKChannelShutdownState_NegotiatingClosingFee: return 3; - case LDKChannelShutdownState_ShutdownComplete: return 4; + case LDKShortChannelIdError_BlockOverflow: return 0; + case LDKShortChannelIdError_TxIndexOverflow: return 1; + case LDKShortChannelIdError_VoutIndexOverflow: return 2; default: abort(); } } -static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { +static inline LDKSecp256k1Error LDKSecp256k1Error_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKConfirmationTarget_MaximumFeeEstimate; - case 1: return LDKConfirmationTarget_UrgentOnChainSweep; - case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; - case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; - case 4: return LDKConfirmationTarget_AnchorChannelFee; - case 5: return LDKConfirmationTarget_NonAnchorChannelFee; - case 6: return LDKConfirmationTarget_ChannelCloseMinimum; - case 7: return LDKConfirmationTarget_OutputSpendingFee; + case 0: return LDKSecp256k1Error_IncorrectSignature; + case 1: return LDKSecp256k1Error_InvalidMessage; + case 2: return LDKSecp256k1Error_InvalidPublicKey; + case 3: return LDKSecp256k1Error_InvalidSignature; + case 4: return LDKSecp256k1Error_InvalidSecretKey; + case 5: return LDKSecp256k1Error_InvalidSharedSecret; + case 6: return LDKSecp256k1Error_InvalidRecoveryId; + case 7: return LDKSecp256k1Error_InvalidTweak; + case 8: return LDKSecp256k1Error_NotEnoughMemory; + case 9: return LDKSecp256k1Error_InvalidPublicKeySum; + case 10: return LDKSecp256k1Error_InvalidParityValue; + case 11: return LDKSecp256k1Error_InvalidEllSwift; default: abort(); } } -static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { +static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { switch (val) { - case LDKConfirmationTarget_MaximumFeeEstimate: return 0; - case LDKConfirmationTarget_UrgentOnChainSweep: return 1; - case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 2; - case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 3; - case LDKConfirmationTarget_AnchorChannelFee: return 4; - case LDKConfirmationTarget_NonAnchorChannelFee: return 5; - case LDKConfirmationTarget_ChannelCloseMinimum: return 6; - case LDKConfirmationTarget_OutputSpendingFee: return 7; + case LDKSecp256k1Error_IncorrectSignature: return 0; + case LDKSecp256k1Error_InvalidMessage: return 1; + case LDKSecp256k1Error_InvalidPublicKey: return 2; + case LDKSecp256k1Error_InvalidSignature: return 3; + case LDKSecp256k1Error_InvalidSecretKey: return 4; + case LDKSecp256k1Error_InvalidSharedSecret: return 5; + case LDKSecp256k1Error_InvalidRecoveryId: return 6; + case LDKSecp256k1Error_InvalidTweak: return 7; + case LDKSecp256k1Error_NotEnoughMemory: return 8; + case LDKSecp256k1Error_InvalidPublicKeySum: return 9; + case LDKSecp256k1Error_InvalidParityValue: return 10; + case LDKSecp256k1Error_InvalidEllSwift: return 11; + default: abort(); + } +} +static inline LDKUtxoLookupError LDKUtxoLookupError_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKUtxoLookupError_UnknownChain; + case 1: return LDKUtxoLookupError_UnknownTx; + default: abort(); + } +} +static inline int32_t LDKUtxoLookupError_to_cs(LDKUtxoLookupError val) { + switch (val) { + case LDKUtxoLookupError_UnknownChain: return 0; + case LDKUtxoLookupError_UnknownTx: return 1; + default: abort(); + } +} +static inline LDKLevel LDKLevel_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKLevel_Gossip; + case 1: return LDKLevel_Trace; + case 2: return LDKLevel_Debug; + case 3: return LDKLevel_Info; + case 4: return LDKLevel_Warn; + case 5: return LDKLevel_Error; + default: abort(); + } +} +static inline int32_t LDKLevel_to_cs(LDKLevel val) { + switch (val) { + case LDKLevel_Gossip: return 0; + case LDKLevel_Trace: return 1; + case LDKLevel_Debug: return 2; + case LDKLevel_Info: return 3; + case LDKLevel_Warn: return 4; + case LDKLevel_Error: return 5; + default: abort(); + } +} +static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKCOption_NoneZ_Some; + case 1: return LDKCOption_NoneZ_None; + default: abort(); + } +} +static inline int32_t LDKCOption_NoneZ_to_cs(LDKCOption_NoneZ val) { + switch (val) { + case LDKCOption_NoneZ_Some: return 0; + case LDKCOption_NoneZ_None: return 1; + default: abort(); + } +} +static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKRetryableSendFailure_PaymentExpired; + case 1: return LDKRetryableSendFailure_RouteNotFound; + case 2: return LDKRetryableSendFailure_DuplicatePayment; + case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; + default: abort(); + } +} +static inline int32_t LDKRetryableSendFailure_to_cs(LDKRetryableSendFailure val) { + switch (val) { + case LDKRetryableSendFailure_PaymentExpired: return 0; + case LDKRetryableSendFailure_RouteNotFound: return 1; + case LDKRetryableSendFailure_DuplicatePayment: return 2; + case LDKRetryableSendFailure_OnionPacketSizeExceeded: return 3; default: abort(); } } @@ -587,115 +631,93 @@ static inline int32_t LDKCreationError_to_cs(LDKCreationError val) { default: abort(); } } -static inline LDKCurrency LDKCurrency_from_cs(int32_t ord) { +static inline LDKBlindedFailure LDKBlindedFailure_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKCurrency_Bitcoin; - case 1: return LDKCurrency_BitcoinTestnet; - case 2: return LDKCurrency_Regtest; - case 3: return LDKCurrency_Simnet; - case 4: return LDKCurrency_Signet; + case 0: return LDKBlindedFailure_FromIntroductionNode; + case 1: return LDKBlindedFailure_FromBlindedNode; default: abort(); } } -static inline int32_t LDKCurrency_to_cs(LDKCurrency val) { +static inline int32_t LDKBlindedFailure_to_cs(LDKBlindedFailure val) { switch (val) { - case LDKCurrency_Bitcoin: return 0; - case LDKCurrency_BitcoinTestnet: return 1; - case LDKCurrency_Regtest: return 2; - case LDKCurrency_Simnet: return 3; - case LDKCurrency_Signet: return 4; + case LDKBlindedFailure_FromIntroductionNode: return 0; + case LDKBlindedFailure_FromBlindedNode: return 1; default: abort(); } } -static inline LDKDirection LDKDirection_from_cs(int32_t ord) { +static inline LDKRecipient LDKRecipient_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKDirection_NodeOne; - case 1: return LDKDirection_NodeTwo; + case 0: return LDKRecipient_Node; + case 1: return LDKRecipient_PhantomNode; default: abort(); } } -static inline int32_t LDKDirection_to_cs(LDKDirection val) { +static inline int32_t LDKRecipient_to_cs(LDKRecipient val) { switch (val) { - case LDKDirection_NodeOne: return 0; - case LDKDirection_NodeTwo: return 1; + case LDKRecipient_Node: return 0; + case LDKRecipient_PhantomNode: return 1; default: abort(); } } -static inline LDKFundingLockedFlags LDKFundingLockedFlags_from_cs(int32_t ord) { +static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKFundingLockedFlags_AnnouncementSignatures; + case 0: return LDKConfirmationTarget_MaximumFeeEstimate; + case 1: return LDKConfirmationTarget_UrgentOnChainSweep; + case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; + case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; + case 4: return LDKConfirmationTarget_AnchorChannelFee; + case 5: return LDKConfirmationTarget_NonAnchorChannelFee; + case 6: return LDKConfirmationTarget_ChannelCloseMinimum; + case 7: return LDKConfirmationTarget_OutputSpendingFee; default: abort(); } } -static inline int32_t LDKFundingLockedFlags_to_cs(LDKFundingLockedFlags val) { +static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { switch (val) { - case LDKFundingLockedFlags_AnnouncementSignatures: return 0; + case LDKConfirmationTarget_MaximumFeeEstimate: return 0; + case LDKConfirmationTarget_UrgentOnChainSweep: return 1; + case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 2; + case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 3; + case LDKConfirmationTarget_AnchorChannelFee: return 4; + case LDKConfirmationTarget_NonAnchorChannelFee: return 5; + case LDKConfirmationTarget_ChannelCloseMinimum: return 6; + case LDKConfirmationTarget_OutputSpendingFee: return 7; default: abort(); } } -static inline LDKHTLCClaim LDKHTLCClaim_from_cs(int32_t ord) { +static inline LDKBalanceSource LDKBalanceSource_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKHTLCClaim_OfferedTimeout; - case 1: return LDKHTLCClaim_OfferedPreimage; - case 2: return LDKHTLCClaim_AcceptedTimeout; - case 3: return LDKHTLCClaim_AcceptedPreimage; - case 4: return LDKHTLCClaim_Revocation; + case 0: return LDKBalanceSource_HolderForceClosed; + case 1: return LDKBalanceSource_CounterpartyForceClosed; + case 2: return LDKBalanceSource_CoopClose; + case 3: return LDKBalanceSource_Htlc; default: abort(); } } -static inline int32_t LDKHTLCClaim_to_cs(LDKHTLCClaim val) { +static inline int32_t LDKBalanceSource_to_cs(LDKBalanceSource val) { switch (val) { - case LDKHTLCClaim_OfferedTimeout: return 0; - case LDKHTLCClaim_OfferedPreimage: return 1; - case LDKHTLCClaim_AcceptedTimeout: return 2; - case LDKHTLCClaim_AcceptedPreimage: return 3; - case LDKHTLCClaim_Revocation: return 4; + case LDKBalanceSource_HolderForceClosed: return 0; + case LDKBalanceSource_CounterpartyForceClosed: return 1; + case LDKBalanceSource_CoopClose: return 2; + case LDKBalanceSource_Htlc: return 3; default: abort(); } } -static inline LDKIOError LDKIOError_from_cs(int32_t ord) { +static inline LDKSocketAddressParseError LDKSocketAddressParseError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKIOError_NotFound; - case 1: return LDKIOError_PermissionDenied; - case 2: return LDKIOError_ConnectionRefused; - case 3: return LDKIOError_ConnectionReset; - case 4: return LDKIOError_ConnectionAborted; - case 5: return LDKIOError_NotConnected; - case 6: return LDKIOError_AddrInUse; - case 7: return LDKIOError_AddrNotAvailable; - case 8: return LDKIOError_BrokenPipe; - case 9: return LDKIOError_AlreadyExists; - case 10: return LDKIOError_WouldBlock; - case 11: return LDKIOError_InvalidInput; - case 12: return LDKIOError_InvalidData; - case 13: return LDKIOError_TimedOut; - case 14: return LDKIOError_WriteZero; - case 15: return LDKIOError_Interrupted; - case 16: return LDKIOError_Other; - case 17: return LDKIOError_UnexpectedEof; + case 0: return LDKSocketAddressParseError_SocketAddrParse; + case 1: return LDKSocketAddressParseError_InvalidInput; + case 2: return LDKSocketAddressParseError_InvalidPort; + case 3: return LDKSocketAddressParseError_InvalidOnionV3; default: abort(); } } -static inline int32_t LDKIOError_to_cs(LDKIOError val) { +static inline int32_t LDKSocketAddressParseError_to_cs(LDKSocketAddressParseError val) { switch (val) { - case LDKIOError_NotFound: return 0; - case LDKIOError_PermissionDenied: return 1; - case LDKIOError_ConnectionRefused: return 2; - case LDKIOError_ConnectionReset: return 3; - case LDKIOError_ConnectionAborted: return 4; - case LDKIOError_NotConnected: return 5; - case LDKIOError_AddrInUse: return 6; - case LDKIOError_AddrNotAvailable: return 7; - case LDKIOError_BrokenPipe: return 8; - case LDKIOError_AlreadyExists: return 9; - case LDKIOError_WouldBlock: return 10; - case LDKIOError_InvalidInput: return 11; - case LDKIOError_InvalidData: return 12; - case LDKIOError_TimedOut: return 13; - case LDKIOError_WriteZero: return 14; - case LDKIOError_Interrupted: return 15; - case LDKIOError_Other: return 16; - case LDKIOError_UnexpectedEof: return 17; + case LDKSocketAddressParseError_SocketAddrParse: return 0; + case LDKSocketAddressParseError_InvalidInput: return 1; + case LDKSocketAddressParseError_InvalidPort: return 2; + case LDKSocketAddressParseError_InvalidOnionV3: return 3; default: abort(); } } @@ -717,75 +739,61 @@ static inline int32_t LDKInboundHTLCStateDetails_to_cs(LDKInboundHTLCStateDetail default: abort(); } } -static inline LDKLevel LDKLevel_from_cs(int32_t ord) { - switch (ord) { - case 0: return LDKLevel_Gossip; - case 1: return LDKLevel_Trace; - case 2: return LDKLevel_Debug; - case 3: return LDKLevel_Info; - case 4: return LDKLevel_Warn; - case 5: return LDKLevel_Error; - default: abort(); - } -} -static inline int32_t LDKLevel_to_cs(LDKLevel val) { - switch (val) { - case LDKLevel_Gossip: return 0; - case LDKLevel_Trace: return 1; - case LDKLevel_Debug: return 2; - case LDKLevel_Info: return 3; - case LDKLevel_Warn: return 4; - case LDKLevel_Error: return 5; - default: abort(); - } -} -static inline LDKNetwork LDKNetwork_from_cs(int32_t ord) { +static inline LDKOutboundHTLCStateDetails LDKOutboundHTLCStateDetails_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKNetwork_Bitcoin; - case 1: return LDKNetwork_Testnet3; - case 2: return LDKNetwork_Testnet4; - case 3: return LDKNetwork_Regtest; - case 4: return LDKNetwork_Signet; + case 0: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKOutboundHTLCStateDetails_Committed; + case 2: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess; + case 3: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure; default: abort(); } } -static inline int32_t LDKNetwork_to_cs(LDKNetwork val) { +static inline int32_t LDKOutboundHTLCStateDetails_to_cs(LDKOutboundHTLCStateDetails val) { switch (val) { - case LDKNetwork_Bitcoin: return 0; - case LDKNetwork_Testnet3: return 1; - case LDKNetwork_Testnet4: return 2; - case LDKNetwork_Regtest: return 3; - case LDKNetwork_Signet: return 4; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKOutboundHTLCStateDetails_Committed: return 1; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess: return 2; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure: return 3; default: abort(); } } -static inline LDKNextFundingFlag LDKNextFundingFlag_from_cs(int32_t ord) { +static inline LDKChannelShutdownState LDKChannelShutdownState_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKNextFundingFlag_CommitmentSigned; + case 0: return LDKChannelShutdownState_NotShuttingDown; + case 1: return LDKChannelShutdownState_ShutdownInitiated; + case 2: return LDKChannelShutdownState_ResolvingHTLCs; + case 3: return LDKChannelShutdownState_NegotiatingClosingFee; + case 4: return LDKChannelShutdownState_ShutdownComplete; default: abort(); } } -static inline int32_t LDKNextFundingFlag_to_cs(LDKNextFundingFlag val) { +static inline int32_t LDKChannelShutdownState_to_cs(LDKChannelShutdownState val) { switch (val) { - case LDKNextFundingFlag_CommitmentSigned: return 0; + case LDKChannelShutdownState_NotShuttingDown: return 0; + case LDKChannelShutdownState_ShutdownInitiated: return 1; + case LDKChannelShutdownState_ResolvingHTLCs: return 2; + case LDKChannelShutdownState_NegotiatingClosingFee: return 3; + case LDKChannelShutdownState_ShutdownComplete: return 4; default: abort(); } } -static inline LDKOutboundHTLCStateDetails LDKOutboundHTLCStateDetails_from_cs(int32_t ord) { +static inline LDKHTLCClaim LDKHTLCClaim_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; - case 1: return LDKOutboundHTLCStateDetails_Committed; - case 2: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess; - case 3: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure; + case 0: return LDKHTLCClaim_OfferedTimeout; + case 1: return LDKHTLCClaim_OfferedPreimage; + case 2: return LDKHTLCClaim_AcceptedTimeout; + case 3: return LDKHTLCClaim_AcceptedPreimage; + case 4: return LDKHTLCClaim_Revocation; default: abort(); } } -static inline int32_t LDKOutboundHTLCStateDetails_to_cs(LDKOutboundHTLCStateDetails val) { +static inline int32_t LDKHTLCClaim_to_cs(LDKHTLCClaim val) { switch (val) { - case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; - case LDKOutboundHTLCStateDetails_Committed: return 1; - case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess: return 2; - case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure: return 3; + case LDKHTLCClaim_OfferedTimeout: return 0; + case LDKHTLCClaim_OfferedPreimage: return 1; + case LDKHTLCClaim_AcceptedTimeout: return 2; + case LDKHTLCClaim_AcceptedPreimage: return 3; + case LDKHTLCClaim_Revocation: return 4; default: abort(); } } @@ -819,135 +827,127 @@ static inline int32_t LDKPaymentFailureReason_to_cs(LDKPaymentFailureReason val) default: abort(); } } -static inline LDKRecipient LDKRecipient_from_cs(int32_t ord) { +static inline LDKSiPrefix LDKSiPrefix_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKRecipient_Node; - case 1: return LDKRecipient_PhantomNode; + case 0: return LDKSiPrefix_Milli; + case 1: return LDKSiPrefix_Micro; + case 2: return LDKSiPrefix_Nano; + case 3: return LDKSiPrefix_Pico; default: abort(); } } -static inline int32_t LDKRecipient_to_cs(LDKRecipient val) { +static inline int32_t LDKSiPrefix_to_cs(LDKSiPrefix val) { switch (val) { - case LDKRecipient_Node: return 0; - case LDKRecipient_PhantomNode: return 1; + case LDKSiPrefix_Milli: return 0; + case LDKSiPrefix_Micro: return 1; + case LDKSiPrefix_Nano: return 2; + case LDKSiPrefix_Pico: return 3; default: abort(); } } -static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_cs(int32_t ord) { +static inline LDKBolt11SemanticError LDKBolt11SemanticError_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKRetryableSendFailure_PaymentExpired; - case 1: return LDKRetryableSendFailure_RouteNotFound; - case 2: return LDKRetryableSendFailure_DuplicatePayment; - case 3: return LDKRetryableSendFailure_OnionPacketSizeExceeded; + case 0: return LDKBolt11SemanticError_NoPaymentHash; + case 1: return LDKBolt11SemanticError_MultiplePaymentHashes; + case 2: return LDKBolt11SemanticError_NoDescription; + case 3: return LDKBolt11SemanticError_MultipleDescriptions; + case 4: return LDKBolt11SemanticError_NoPaymentSecret; + case 5: return LDKBolt11SemanticError_MultiplePaymentSecrets; + case 6: return LDKBolt11SemanticError_InvalidFeatures; + case 7: return LDKBolt11SemanticError_InvalidSignature; + case 8: return LDKBolt11SemanticError_ImpreciseAmount; default: abort(); } } -static inline int32_t LDKRetryableSendFailure_to_cs(LDKRetryableSendFailure val) { +static inline int32_t LDKBolt11SemanticError_to_cs(LDKBolt11SemanticError val) { switch (val) { - case LDKRetryableSendFailure_PaymentExpired: return 0; - case LDKRetryableSendFailure_RouteNotFound: return 1; - case LDKRetryableSendFailure_DuplicatePayment: return 2; - case LDKRetryableSendFailure_OnionPacketSizeExceeded: return 3; + case LDKBolt11SemanticError_NoPaymentHash: return 0; + case LDKBolt11SemanticError_MultiplePaymentHashes: return 1; + case LDKBolt11SemanticError_NoDescription: return 2; + case LDKBolt11SemanticError_MultipleDescriptions: return 3; + case LDKBolt11SemanticError_NoPaymentSecret: return 4; + case LDKBolt11SemanticError_MultiplePaymentSecrets: return 5; + case LDKBolt11SemanticError_InvalidFeatures: return 6; + case LDKBolt11SemanticError_InvalidSignature: return 7; + case LDKBolt11SemanticError_ImpreciseAmount: return 8; default: abort(); } } -static inline LDKSecp256k1Error LDKSecp256k1Error_from_cs(int32_t ord) { +static inline LDKDirection LDKDirection_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKSecp256k1Error_IncorrectSignature; - case 1: return LDKSecp256k1Error_InvalidMessage; - case 2: return LDKSecp256k1Error_InvalidPublicKey; - case 3: return LDKSecp256k1Error_InvalidSignature; - case 4: return LDKSecp256k1Error_InvalidSecretKey; - case 5: return LDKSecp256k1Error_InvalidSharedSecret; - case 6: return LDKSecp256k1Error_InvalidRecoveryId; - case 7: return LDKSecp256k1Error_InvalidTweak; - case 8: return LDKSecp256k1Error_NotEnoughMemory; - case 9: return LDKSecp256k1Error_InvalidPublicKeySum; - case 10: return LDKSecp256k1Error_InvalidParityValue; - case 11: return LDKSecp256k1Error_InvalidEllSwift; + case 0: return LDKDirection_NodeOne; + case 1: return LDKDirection_NodeTwo; default: abort(); } } -static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { +static inline int32_t LDKDirection_to_cs(LDKDirection val) { switch (val) { - case LDKSecp256k1Error_IncorrectSignature: return 0; - case LDKSecp256k1Error_InvalidMessage: return 1; - case LDKSecp256k1Error_InvalidPublicKey: return 2; - case LDKSecp256k1Error_InvalidSignature: return 3; - case LDKSecp256k1Error_InvalidSecretKey: return 4; - case LDKSecp256k1Error_InvalidSharedSecret: return 5; - case LDKSecp256k1Error_InvalidRecoveryId: return 6; - case LDKSecp256k1Error_InvalidTweak: return 7; - case LDKSecp256k1Error_NotEnoughMemory: return 8; - case LDKSecp256k1Error_InvalidPublicKeySum: return 9; - case LDKSecp256k1Error_InvalidParityValue: return 10; - case LDKSecp256k1Error_InvalidEllSwift: return 11; + case LDKDirection_NodeOne: return 0; + case LDKDirection_NodeTwo: return 1; default: abort(); } } -static inline LDKShortChannelIdError LDKShortChannelIdError_from_cs(int32_t ord) { +static inline LDKNetwork LDKNetwork_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKShortChannelIdError_BlockOverflow; - case 1: return LDKShortChannelIdError_TxIndexOverflow; - case 2: return LDKShortChannelIdError_VoutIndexOverflow; + case 0: return LDKNetwork_Bitcoin; + case 1: return LDKNetwork_Testnet3; + case 2: return LDKNetwork_Testnet4; + case 3: return LDKNetwork_Regtest; + case 4: return LDKNetwork_Signet; default: abort(); } } -static inline int32_t LDKShortChannelIdError_to_cs(LDKShortChannelIdError val) { +static inline int32_t LDKNetwork_to_cs(LDKNetwork val) { switch (val) { - case LDKShortChannelIdError_BlockOverflow: return 0; - case LDKShortChannelIdError_TxIndexOverflow: return 1; - case LDKShortChannelIdError_VoutIndexOverflow: return 2; + case LDKNetwork_Bitcoin: return 0; + case LDKNetwork_Testnet3: return 1; + case LDKNetwork_Testnet4: return 2; + case LDKNetwork_Regtest: return 3; + case LDKNetwork_Signet: return 4; default: abort(); } } -static inline LDKSiPrefix LDKSiPrefix_from_cs(int32_t ord) { +static inline LDKNextFundingFlag LDKNextFundingFlag_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKSiPrefix_Milli; - case 1: return LDKSiPrefix_Micro; - case 2: return LDKSiPrefix_Nano; - case 3: return LDKSiPrefix_Pico; + case 0: return LDKNextFundingFlag_CommitmentSigned; default: abort(); } } -static inline int32_t LDKSiPrefix_to_cs(LDKSiPrefix val) { +static inline int32_t LDKNextFundingFlag_to_cs(LDKNextFundingFlag val) { switch (val) { - case LDKSiPrefix_Milli: return 0; - case LDKSiPrefix_Micro: return 1; - case LDKSiPrefix_Nano: return 2; - case LDKSiPrefix_Pico: return 3; + case LDKNextFundingFlag_CommitmentSigned: return 0; default: abort(); } } -static inline LDKSocketAddressParseError LDKSocketAddressParseError_from_cs(int32_t ord) { +static inline LDKFundingLockedFlags LDKFundingLockedFlags_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKSocketAddressParseError_SocketAddrParse; - case 1: return LDKSocketAddressParseError_InvalidInput; - case 2: return LDKSocketAddressParseError_InvalidPort; - case 3: return LDKSocketAddressParseError_InvalidOnionV3; + case 0: return LDKFundingLockedFlags_AnnouncementSignatures; default: abort(); } } -static inline int32_t LDKSocketAddressParseError_to_cs(LDKSocketAddressParseError val) { +static inline int32_t LDKFundingLockedFlags_to_cs(LDKFundingLockedFlags val) { switch (val) { - case LDKSocketAddressParseError_SocketAddrParse: return 0; - case LDKSocketAddressParseError_InvalidInput: return 1; - case LDKSocketAddressParseError_InvalidPort: return 2; - case LDKSocketAddressParseError_InvalidOnionV3: return 3; + case LDKFundingLockedFlags_AnnouncementSignatures: return 0; default: abort(); } } -static inline LDKUtxoLookupError LDKUtxoLookupError_from_cs(int32_t ord) { +static inline LDKCurrency LDKCurrency_from_cs(int32_t ord) { switch (ord) { - case 0: return LDKUtxoLookupError_UnknownChain; - case 1: return LDKUtxoLookupError_UnknownTx; + case 0: return LDKCurrency_Bitcoin; + case 1: return LDKCurrency_BitcoinTestnet; + case 2: return LDKCurrency_Regtest; + case 3: return LDKCurrency_Simnet; + case 4: return LDKCurrency_Signet; default: abort(); } } -static inline int32_t LDKUtxoLookupError_to_cs(LDKUtxoLookupError val) { +static inline int32_t LDKCurrency_to_cs(LDKCurrency val) { switch (val) { - case LDKUtxoLookupError_UnknownChain: return 0; - case LDKUtxoLookupError_UnknownTx: return 1; + case LDKCurrency_Bitcoin: return 0; + case LDKCurrency_BitcoinTestnet: return 1; + case LDKCurrency_Regtest: return 2; + case LDKCurrency_Simnet: return 3; + case LDKCurrency_Signet: return 4; default: abort(); } } @@ -84263,7 +84263,7 @@ int64_t CS_LDK_OffersMessageFlow_set_paths_to_static_invoice_server(int64_t thi return tag_ptr(ret_conv, true); } -void CS_LDK_OffersMessageFlow_best_block_updated(int64_t this_arg, uint8_tArray header, uint32_t _height) { +void CS_LDK_OffersMessageFlow_best_block_updated(int64_t this_arg, uint8_tArray header, uint32_t height) { LDKOffersMessageFlow this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -84273,7 +84273,7 @@ void CS_LDK_OffersMessageFlow_best_block_updated(int64_t this_arg, uint8_tArray CHECK(header->arr_len == 80); memcpy(header_arr, header->elems, 80); FREE(header); uint8_t (*header_ref)[80] = &header_arr; - OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, _height); + OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, height); } int64_t CS_LDK_OffersMessageFlow_blinded_paths_for_async_recipient(int64_t this_arg, uint8_tArray recipient_id, int64_t relative_expiry, int64_tArray peers) { @@ -104955,22 +104955,22 @@ void CS_LDK_InitFeatures_set_zero_conf_required(int64_t this_arg) { InitFeatures_set_zero_conf_required(&this_arg_conv); } -void CS_LDK_InitFeatures_supports_zero_conf(int64_t this_arg) { +void CS_LDK_InitFeatures_clear_zero_conf(int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_supports_zero_conf(&this_arg_conv); + InitFeatures_clear_zero_conf(&this_arg_conv); } -jboolean CS_LDK_InitFeatures_requires_zero_conf(int64_t this_arg) { +jboolean CS_LDK_InitFeatures_supports_zero_conf(int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -104992,22 +104992,22 @@ void CS_LDK_NodeFeatures_set_zero_conf_required(int64_t this_arg) { NodeFeatures_set_zero_conf_required(&this_arg_conv); } -void CS_LDK_NodeFeatures_supports_zero_conf(int64_t this_arg) { +void CS_LDK_NodeFeatures_clear_zero_conf(int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_supports_zero_conf(&this_arg_conv); + NodeFeatures_clear_zero_conf(&this_arg_conv); } -jboolean CS_LDK_NodeFeatures_requires_zero_conf(int64_t this_arg) { +jboolean CS_LDK_NodeFeatures_supports_zero_conf(int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -105029,13 +105029,43 @@ void CS_LDK_ChannelTypeFeatures_set_zero_conf_required(int64_t this_arg) { ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -void CS_LDK_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { +void CS_LDK_ChannelTypeFeatures_clear_zero_conf(int64_t this_arg) { LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + ChannelTypeFeatures_clear_zero_conf(&this_arg_conv); +} + +jboolean CS_LDK_ChannelTypeFeatures_supports_zero_conf(int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_zero_conf(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_zero_conf(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } jboolean CS_LDK_ChannelTypeFeatures_requires_zero_conf(int64_t this_arg) { diff --git a/c_sharp/src/org/ldk/impl/bindings.cs b/c_sharp/src/org/ldk/impl/bindings.cs index 53118202..4704ba4f 100644 --- a/c_sharp/src/org/ldk/impl/bindings.cs +++ b/c_sharp/src/org/ldk/impl/bindings.cs @@ -14463,8 +14463,8 @@ public static long[] LDKScore_new(LDKScore impl, long ScoreLookUp, long ScoreUpd [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageFlow_with_async_payments_offers_cache")] public static extern long OffersMessageFlow_with_async_payments_offers_cache(long _this_arg, long _async_receive_offer_cache); // MUST_USE_RES struct LDKCResult_NoneNoneZ OffersMessageFlow_set_paths_to_static_invoice_server(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, struct LDKCVec_BlindedMessagePathZ paths_to_static_invoice_server, struct LDKCVec_MessageForwardNodeZ peers); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageFlow_set_paths_to_static_invoice_server")] public static extern long OffersMessageFlow_set_paths_to_static_invoice_server(long _this_arg, long _paths_to_static_invoice_server, long _peers); - // void OffersMessageFlow_best_block_updated(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t _height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageFlow_best_block_updated")] public static extern void OffersMessageFlow_best_block_updated(long _this_arg, long _header, int __height); + // void OffersMessageFlow_best_block_updated(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageFlow_best_block_updated")] public static extern void OffersMessageFlow_best_block_updated(long _this_arg, long _header, int _height); // MUST_USE_RES struct LDKCResult_CVec_BlindedMessagePathZNoneZ OffersMessageFlow_blinded_paths_for_async_recipient(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, struct LDKCVec_u8Z recipient_id, struct LDKCOption_u64Z relative_expiry, struct LDKCVec_MessageForwardNodeZ peers); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageFlow_blinded_paths_for_async_recipient")] public static extern long OffersMessageFlow_blinded_paths_for_async_recipient(long _this_arg, long _recipient_id, long _relative_expiry, long _peers); // void InvreqResponseInstructions_free(struct LDKInvreqResponseInstructions this_ptr); @@ -17821,24 +17821,30 @@ public static long[] LDKScore_new(LDKScore impl, long ScoreLookUp, long ScoreUpd [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); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_zero_conf_required")] public static extern void InitFeatures_set_zero_conf_required(long _this_arg); - // void InitFeatures_supports_zero_conf(struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_zero_conf")] public static extern void InitFeatures_supports_zero_conf(long _this_arg); - // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_zero_conf")] public static extern bool InitFeatures_requires_zero_conf(long _this_arg); + // void InitFeatures_clear_zero_conf(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_clear_zero_conf")] public static extern void InitFeatures_clear_zero_conf(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_zero_conf")] public static extern bool InitFeatures_supports_zero_conf(long _this_arg); // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_zero_conf_optional")] public static extern void NodeFeatures_set_zero_conf_optional(long _this_arg); // void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_zero_conf_required")] public static extern void NodeFeatures_set_zero_conf_required(long _this_arg); - // void NodeFeatures_supports_zero_conf(struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_zero_conf")] public static extern void NodeFeatures_supports_zero_conf(long _this_arg); - // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_zero_conf")] public static extern bool NodeFeatures_requires_zero_conf(long _this_arg); + // void NodeFeatures_clear_zero_conf(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_clear_zero_conf")] public static extern void NodeFeatures_clear_zero_conf(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_zero_conf")] public static extern bool NodeFeatures_supports_zero_conf(long _this_arg); // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_zero_conf_optional")] public static extern void ChannelTypeFeatures_set_zero_conf_optional(long _this_arg); // void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_set_zero_conf_required")] public static extern void ChannelTypeFeatures_set_zero_conf_required(long _this_arg); - // void ChannelTypeFeatures_supports_zero_conf(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_zero_conf")] public static extern void ChannelTypeFeatures_supports_zero_conf(long _this_arg); + // void ChannelTypeFeatures_clear_zero_conf(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_clear_zero_conf")] public static extern void ChannelTypeFeatures_clear_zero_conf(long _this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_supports_zero_conf")] public static extern bool ChannelTypeFeatures_supports_zero_conf(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_zero_conf")] public static extern bool InitFeatures_requires_zero_conf(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_zero_conf")] public static extern bool NodeFeatures_requires_zero_conf(long _this_arg); // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelTypeFeatures_requires_zero_conf")] public static extern bool ChannelTypeFeatures_requires_zero_conf(long _this_arg); // void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); diff --git a/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs index fd04bd38..ba5ba1e3 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs @@ -213,7 +213,10 @@ public org.ldk.structs.Bolt11InvoiceFeatures features() { } /** - * Recover the payee's public key (only to be used if none was included in the invoice) + * Get the invoice's payee public key. + * + * This uses the explicitly included payee public key, if present, otherwise it recovers the + * payee public key from the signature. Prefer [`Self::get_payee_pub_key`] for clarity. */ public byte[] recover_payee_pub_key() { long ret = bindings.Bolt11Invoice_recover_payee_pub_key(this.ptr); @@ -224,8 +227,8 @@ public byte[] recover_payee_pub_key() { } /** - * Recover the payee's public key if one was included in the invoice, otherwise return the - * recovered public key from the signature + * Get the invoice's payee public key, preferring an explicitly included payee public key and + * falling back to recovering the key from the signature. */ public byte[] get_payee_pub_key() { long ret = bindings.Bolt11Invoice_get_payee_pub_key(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/ChannelManager.cs b/c_sharp/src/org/ldk/structs/ChannelManager.cs index 5ca49d6e..7bdc411c 100644 --- a/c_sharp/src/org/ldk/structs/ChannelManager.cs +++ b/c_sharp/src/org/ldk/structs/ChannelManager.cs @@ -1087,6 +1087,12 @@ public void force_close_all_channels_broadcasting_latest_txn(string error_messag * the channel. This will spend the channel's funding transaction output, effectively replacing * it with a new one. * + * # Required Feature Flags + * + * Initiating a splice requires that the channel counterparty supports splicing. Any + * channel (no matter the type) can be spliced, as long as the counterparty is currently + * connected. + * * # Arguments * * Provide a `contribution` to determine if value is spliced in or out. The splice initiator is diff --git a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs index 72193b7d..0a1bc4e2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs @@ -483,14 +483,23 @@ public void set_zero_conf_required() { /** * Unsets this feature. */ - public void supports_zero_conf() { - bindings.ChannelTypeFeatures_supports_zero_conf(this.ptr); + public void clear_zero_conf() { + bindings.ChannelTypeFeatures_clear_zero_conf(this.ptr); GC.KeepAlive(this); } /** * Checks if this feature is supported. */ + public bool supports_zero_conf() { + bool ret = bindings.ChannelTypeFeatures_supports_zero_conf(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ public bool requires_zero_conf() { bool ret = bindings.ChannelTypeFeatures_requires_zero_conf(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/Event.cs b/c_sharp/src/org/ldk/structs/Event.cs index c8542c71..97eff025 100644 --- a/c_sharp/src/org/ldk/structs/Event.cs +++ b/c_sharp/src/org/ldk/structs/Event.cs @@ -480,7 +480,8 @@ public class Event_PaymentSent : Event { * If the recipient or an intermediate node misbehaves and gives us free money, this may * overstate the amount paid, though this is unlikely. * - * This is only `None` for payments initiated on LDK versions prior to 0.0.103. + * This is only `None` for payments abandoned but ultimately claimed when using LDK versions + * prior to 0.3, 0.2.3, or 0.1.10. * * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees */ diff --git a/c_sharp/src/org/ldk/structs/InitFeatures.cs b/c_sharp/src/org/ldk/structs/InitFeatures.cs index d14094f2..cc8fd933 100644 --- a/c_sharp/src/org/ldk/structs/InitFeatures.cs +++ b/c_sharp/src/org/ldk/structs/InitFeatures.cs @@ -1062,14 +1062,23 @@ public void set_zero_conf_required() { /** * Unsets this feature. */ - public void supports_zero_conf() { - bindings.InitFeatures_supports_zero_conf(this.ptr); + public void clear_zero_conf() { + bindings.InitFeatures_clear_zero_conf(this.ptr); GC.KeepAlive(this); } /** * Checks if this feature is supported. */ + public bool supports_zero_conf() { + bool ret = bindings.InitFeatures_supports_zero_conf(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ public bool requires_zero_conf() { bool ret = bindings.InitFeatures_requires_zero_conf(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/NodeFeatures.cs b/c_sharp/src/org/ldk/structs/NodeFeatures.cs index a417ad8b..5352a1ac 100644 --- a/c_sharp/src/org/ldk/structs/NodeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/NodeFeatures.cs @@ -1029,14 +1029,23 @@ public void set_zero_conf_required() { /** * Unsets this feature. */ - public void supports_zero_conf() { - bindings.NodeFeatures_supports_zero_conf(this.ptr); + public void clear_zero_conf() { + bindings.NodeFeatures_clear_zero_conf(this.ptr); GC.KeepAlive(this); } /** * Checks if this feature is supported. */ + public bool supports_zero_conf() { + bool ret = bindings.NodeFeatures_supports_zero_conf(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ public bool requires_zero_conf() { bool ret = bindings.NodeFeatures_requires_zero_conf(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/OffersMessageFlow.cs b/c_sharp/src/org/ldk/structs/OffersMessageFlow.cs index 8ae17888..1a0f33c4 100644 --- a/c_sharp/src/org/ldk/structs/OffersMessageFlow.cs +++ b/c_sharp/src/org/ldk/structs/OffersMessageFlow.cs @@ -105,11 +105,11 @@ public org.ldk.structs.Result_NoneNoneZ set_paths_to_static_invoice_server(Blind * Must be called whenever a new chain tip becomes available. May be skipped * for intermediary blocks. */ - public void best_block_updated(byte[] header, int _height) { - bindings.OffersMessageFlow_best_block_updated(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), _height); + public void best_block_updated(byte[] header, int height) { + bindings.OffersMessageFlow_best_block_updated(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), height); GC.KeepAlive(this); GC.KeepAlive(header); - GC.KeepAlive(_height); + GC.KeepAlive(height); } /** diff --git a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs index 3cd98168..7f2c106f 100644 --- a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs +++ b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs @@ -38,6 +38,10 @@ public static org.ldk.structs.RapidGossipSync of(org.ldk.structs.NetworkGraph ne * Sync gossip data from a file. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * + * You should consider the gossip data source as semi-trusted. It is generally the case that it + * can DoS the client either by omitting data which leads to pathfinding failure or by bloating + * the graph such that it leads to eventual OOM on the client. + * * `network_graph`: The network graph to apply the updates to * * `sync_path`: Path to the file where the gossip update data is located @@ -55,6 +59,10 @@ public org.ldk.structs.Result_u32GraphSyncErrorZ sync_network_graph_with_file_pa * Update network graph from binary data. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * + * You should consider the gossip data source as semi-trusted. It is generally the case that it + * can DoS the client either by omitting data which leads to pathfinding failure or by bloating + * the graph such that it leads to eventual OOM on the client. + * * `update_data`: `&[u8]` binary stream that comprises the update data */ public org.ldk.structs.Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) { @@ -70,6 +78,10 @@ public org.ldk.structs.Result_u32GraphSyncErrorZ update_network_graph(byte[] upd * Update network graph from binary data. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * + * You should consider the gossip data source as semi-trusted. It is generally the case that it + * can DoS the client either by omitting data which leads to pathfinding failure or by bloating + * the graph such that it leads to eventual OOM on the client. + * * `update_data`: `&[u8]` binary stream that comprises the update data * `current_time_unix`: `Option` optional current timestamp to verify data age */ diff --git a/c_sharp/src/org/ldk/structs/UtilMethods.cs b/c_sharp/src/org/ldk/structs/UtilMethods.cs index c69fad06..f6ae032a 100644 --- a/c_sharp/src/org/ldk/structs/UtilMethods.cs +++ b/c_sharp/src/org/ldk/structs/UtilMethods.cs @@ -30,7 +30,7 @@ public static org.ldk.util.UInt128 U128_new(byte[] le_bytes) { } /** - * Constructs a new COption_NoneZ containing a + * Constructs a new COption_NoneZ containing a */ public static COption_NoneZ COption_NoneZ_some() { COption_NoneZ ret = bindings.COption_NoneZ_some(); diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index d435ae95..a178d1cf 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -15754,8 +15754,8 @@ public final static class ScriptHash extends LDKFallback { public static native long OffersMessageFlow_with_async_payments_offers_cache(long this_arg, long async_receive_offer_cache); // MUST_USE_RES struct LDKCResult_NoneNoneZ OffersMessageFlow_set_paths_to_static_invoice_server(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, struct LDKCVec_BlindedMessagePathZ paths_to_static_invoice_server, struct LDKCVec_MessageForwardNodeZ peers); public static native long OffersMessageFlow_set_paths_to_static_invoice_server(long this_arg, long[] paths_to_static_invoice_server, long[] peers); - // void OffersMessageFlow_best_block_updated(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t _height); - public static native void OffersMessageFlow_best_block_updated(long this_arg, byte[] header, int _height); + // void OffersMessageFlow_best_block_updated(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height); + public static native void OffersMessageFlow_best_block_updated(long this_arg, byte[] header, int height); // MUST_USE_RES struct LDKCResult_CVec_BlindedMessagePathZNoneZ OffersMessageFlow_blinded_paths_for_async_recipient(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, struct LDKCVec_u8Z recipient_id, struct LDKCOption_u64Z relative_expiry, struct LDKCVec_MessageForwardNodeZ peers); public static native long OffersMessageFlow_blinded_paths_for_async_recipient(long this_arg, byte[] recipient_id, long relative_expiry, long[] peers); // void InvreqResponseInstructions_free(struct LDKInvreqResponseInstructions this_ptr); @@ -19112,24 +19112,30 @@ public final static class ScriptHash extends LDKFallback { public static native void InitFeatures_set_zero_conf_optional(long this_arg); // void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg); public static native void InitFeatures_set_zero_conf_required(long this_arg); - // void InitFeatures_supports_zero_conf(struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native void InitFeatures_supports_zero_conf(long this_arg); - // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); - public static native boolean InitFeatures_requires_zero_conf(long this_arg); + // void InitFeatures_clear_zero_conf(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_clear_zero_conf(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_zero_conf(long this_arg); // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); public static native void NodeFeatures_set_zero_conf_optional(long this_arg); // void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); public static native void NodeFeatures_set_zero_conf_required(long this_arg); - // void NodeFeatures_supports_zero_conf(struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native void NodeFeatures_supports_zero_conf(long this_arg); - // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); - public static native boolean NodeFeatures_requires_zero_conf(long this_arg); + // void NodeFeatures_clear_zero_conf(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_clear_zero_conf(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_zero_conf(long this_arg); // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); public static native void ChannelTypeFeatures_set_zero_conf_optional(long this_arg); // void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); public static native void ChannelTypeFeatures_set_zero_conf_required(long this_arg); - // void ChannelTypeFeatures_supports_zero_conf(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); - public static native void ChannelTypeFeatures_supports_zero_conf(long this_arg); + // void ChannelTypeFeatures_clear_zero_conf(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_clear_zero_conf(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_zero_conf(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_zero_conf(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_zero_conf(long this_arg); // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); public static native boolean ChannelTypeFeatures_requires_zero_conf(long this_arg); // void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); diff --git a/src/main/java/org/ldk/structs/Bolt11Invoice.java b/src/main/java/org/ldk/structs/Bolt11Invoice.java index d93c975c..a2266b2e 100644 --- a/src/main/java/org/ldk/structs/Bolt11Invoice.java +++ b/src/main/java/org/ldk/structs/Bolt11Invoice.java @@ -212,7 +212,10 @@ public Bolt11InvoiceFeatures features() { } /** - * Recover the payee's public key (only to be used if none was included in the invoice) + * Get the invoice's payee public key. + * + * This uses the explicitly included payee public key, if present, otherwise it recovers the + * payee public key from the signature. Prefer [`Self::get_payee_pub_key`] for clarity. */ public byte[] recover_payee_pub_key() { byte[] ret = bindings.Bolt11Invoice_recover_payee_pub_key(this.ptr); @@ -221,8 +224,8 @@ public byte[] recover_payee_pub_key() { } /** - * Recover the payee's public key if one was included in the invoice, otherwise return the - * recovered public key from the signature + * Get the invoice's payee public key, preferring an explicitly included payee public key and + * falling back to recovering the key from the signature. */ public byte[] get_payee_pub_key() { byte[] ret = bindings.Bolt11Invoice_get_payee_pub_key(this.ptr); diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index 81959dd2..320c0811 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -1084,6 +1084,12 @@ public void force_close_all_channels_broadcasting_latest_txn(java.lang.String er * the channel. This will spend the channel's funding transaction output, effectively replacing * it with a new one. * + * # Required Feature Flags + * + * Initiating a splice requires that the channel counterparty supports splicing. Any + * channel (no matter the type) can be spliced, as long as the counterparty is currently + * connected. + * * # Arguments * * Provide a `contribution` to determine if value is spliced in or out. The splice initiator is diff --git a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java index 2dc6393e..ddedc226 100644 --- a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java @@ -482,14 +482,23 @@ public void set_zero_conf_required() { /** * Unsets this feature. */ - public void supports_zero_conf() { - bindings.ChannelTypeFeatures_supports_zero_conf(this.ptr); + public void clear_zero_conf() { + bindings.ChannelTypeFeatures_clear_zero_conf(this.ptr); Reference.reachabilityFence(this); } /** * Checks if this feature is supported. */ + public boolean supports_zero_conf() { + boolean ret = bindings.ChannelTypeFeatures_supports_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ public boolean requires_zero_conf() { boolean ret = bindings.ChannelTypeFeatures_requires_zero_conf(this.ptr); Reference.reachabilityFence(this); diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index a1cd5591..7afc1a02 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -654,7 +654,8 @@ public final static class PaymentSent extends Event { * If the recipient or an intermediate node misbehaves and gives us free money, this may * overstate the amount paid, though this is unlikely. * - * This is only `None` for payments initiated on LDK versions prior to 0.0.103. + * This is only `None` for payments abandoned but ultimately claimed when using LDK versions + * prior to 0.3, 0.2.3, or 0.1.10. * * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees */ diff --git a/src/main/java/org/ldk/structs/InitFeatures.java b/src/main/java/org/ldk/structs/InitFeatures.java index ddeb49f9..46b4cb27 100644 --- a/src/main/java/org/ldk/structs/InitFeatures.java +++ b/src/main/java/org/ldk/structs/InitFeatures.java @@ -1061,14 +1061,23 @@ public void set_zero_conf_required() { /** * Unsets this feature. */ - public void supports_zero_conf() { - bindings.InitFeatures_supports_zero_conf(this.ptr); + public void clear_zero_conf() { + bindings.InitFeatures_clear_zero_conf(this.ptr); Reference.reachabilityFence(this); } /** * Checks if this feature is supported. */ + public boolean supports_zero_conf() { + boolean ret = bindings.InitFeatures_supports_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ public boolean requires_zero_conf() { boolean ret = bindings.InitFeatures_requires_zero_conf(this.ptr); Reference.reachabilityFence(this); diff --git a/src/main/java/org/ldk/structs/NodeFeatures.java b/src/main/java/org/ldk/structs/NodeFeatures.java index 633ed851..35478a89 100644 --- a/src/main/java/org/ldk/structs/NodeFeatures.java +++ b/src/main/java/org/ldk/structs/NodeFeatures.java @@ -1028,14 +1028,23 @@ public void set_zero_conf_required() { /** * Unsets this feature. */ - public void supports_zero_conf() { - bindings.NodeFeatures_supports_zero_conf(this.ptr); + public void clear_zero_conf() { + bindings.NodeFeatures_clear_zero_conf(this.ptr); Reference.reachabilityFence(this); } /** * Checks if this feature is supported. */ + public boolean supports_zero_conf() { + boolean ret = bindings.NodeFeatures_supports_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ public boolean requires_zero_conf() { boolean ret = bindings.NodeFeatures_requires_zero_conf(this.ptr); Reference.reachabilityFence(this); diff --git a/src/main/java/org/ldk/structs/OffersMessageFlow.java b/src/main/java/org/ldk/structs/OffersMessageFlow.java index 2fcc0fd2..c7a79af0 100644 --- a/src/main/java/org/ldk/structs/OffersMessageFlow.java +++ b/src/main/java/org/ldk/structs/OffersMessageFlow.java @@ -110,11 +110,11 @@ public Result_NoneNoneZ set_paths_to_static_invoice_server(BlindedMessagePath[] * Must be called whenever a new chain tip becomes available. May be skipped * for intermediary blocks. */ - public void best_block_updated(byte[] header, int _height) { - bindings.OffersMessageFlow_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), _height); + public void best_block_updated(byte[] header, int height) { + bindings.OffersMessageFlow_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height); Reference.reachabilityFence(this); Reference.reachabilityFence(header); - Reference.reachabilityFence(_height); + Reference.reachabilityFence(height); } /** diff --git a/src/main/java/org/ldk/structs/RapidGossipSync.java b/src/main/java/org/ldk/structs/RapidGossipSync.java index bc28d25f..7f5b12c7 100644 --- a/src/main/java/org/ldk/structs/RapidGossipSync.java +++ b/src/main/java/org/ldk/structs/RapidGossipSync.java @@ -43,6 +43,10 @@ public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph, org * Sync gossip data from a file. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * + * You should consider the gossip data source as semi-trusted. It is generally the case that it + * can DoS the client either by omitting data which leads to pathfinding failure or by bloating + * the graph such that it leads to eventual OOM on the client. + * * `network_graph`: The network graph to apply the updates to * * `sync_path`: Path to the file where the gossip update data is located @@ -60,6 +64,10 @@ public Result_u32GraphSyncErrorZ sync_network_graph_with_file_path(java.lang.Str * Update network graph from binary data. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * + * You should consider the gossip data source as semi-trusted. It is generally the case that it + * can DoS the client either by omitting data which leads to pathfinding failure or by bloating + * the graph such that it leads to eventual OOM on the client. + * * `update_data`: `&[u8]` binary stream that comprises the update data */ public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) { @@ -75,6 +83,10 @@ public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) { * Update network graph from binary data. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * + * You should consider the gossip data source as semi-trusted. It is generally the case that it + * can DoS the client either by omitting data which leads to pathfinding failure or by bloating + * the graph such that it leads to eventual OOM on the client. + * * `update_data`: `&[u8]` binary stream that comprises the update data * `current_time_unix`: `Option` optional current timestamp to verify data age */ diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 8e90be66..3292d85c 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -90833,7 +90833,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1set_1pat return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, uint8_tArray header, uint32_t _height) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, uint8_tArray header, uint32_t height) { LDKOffersMessageFlow this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -90843,7 +90843,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1best_1block CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); uint8_t (*header_ref)[80] = &header_arr; - OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, _height); + OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, height); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1blinded_1paths_1for_1async_1recipient(JNIEnv *env, jclass clz, int64_t this_arg, uint8_tArray recipient_id, int64_t relative_expiry, int64_tArray peers) { @@ -111519,22 +111519,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_ InitFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_supports_zero_conf(&this_arg_conv); + InitFeatures_clear_zero_conf(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -111556,22 +111556,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_ NodeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_supports_zero_conf(&this_arg_conv); + NodeFeatures_clear_zero_conf(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -111593,13 +111593,43 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_zero_conf(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index f32af02c..9d2d4369 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -90829,7 +90829,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1set_1pat return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, uint8_tArray header, uint32_t _height) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, uint8_tArray header, uint32_t height) { LDKOffersMessageFlow this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -90839,7 +90839,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1best_1block CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); uint8_t (*header_ref)[80] = &header_arr; - OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, _height); + OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, height); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersMessageFlow_1blinded_1paths_1for_1async_1recipient(JNIEnv *env, jclass clz, int64_t this_arg, uint8_tArray recipient_id, int64_t relative_expiry, int64_tArray peers) { @@ -111515,22 +111515,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_ InitFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_supports_zero_conf(&this_arg_conv); + InitFeatures_clear_zero_conf(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -111552,22 +111552,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_ NodeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_supports_zero_conf(&this_arg_conv); + NodeFeatures_clear_zero_conf(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -111589,13 +111589,43 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_zero_conf(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index ae552a23..6a36d2f4 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -65473,18 +65473,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_ /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_supports_zero_conf + * Method: InitFeatures_clear_zero_conf * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clear_1zero_1conf (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_zero_conf + * Method: InitFeatures_supports_zero_conf * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf (JNIEnv *, jclass, jlong); /* @@ -65505,18 +65505,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_ /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_supports_zero_conf + * Method: NodeFeatures_clear_zero_conf * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clear_1zero_1conf (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_zero_conf + * Method: NodeFeatures_supports_zero_conf * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf (JNIEnv *, jclass, jlong); /* @@ -65537,10 +65537,34 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_supports_zero_conf + * Method: ChannelTypeFeatures_clear_zero_conf * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clear_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_supports_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_zero_conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf (JNIEnv *, jclass, jlong); /* diff --git a/ts/bindings.c b/ts/bindings.c index 16486f4b..5e915c42 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -83812,7 +83812,7 @@ uint64_t __attribute__((export_name("TS_OffersMessageFlow_set_paths_to_static_i return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_OffersMessageFlow_best_block_updated"))) TS_OffersMessageFlow_best_block_updated(uint64_t this_arg, uint8_tArray header, uint32_t _height) { +void __attribute__((export_name("TS_OffersMessageFlow_best_block_updated"))) TS_OffersMessageFlow_best_block_updated(uint64_t this_arg, uint8_tArray header, uint32_t height) { LDKOffersMessageFlow this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -83822,7 +83822,7 @@ void __attribute__((export_name("TS_OffersMessageFlow_best_block_updated"))) TS CHECK(header->arr_len == 80); memcpy(header_arr, header->elems, 80); FREE(header); uint8_t (*header_ref)[80] = &header_arr; - OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, _height); + OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, height); } uint64_t __attribute__((export_name("TS_OffersMessageFlow_blinded_paths_for_async_recipient"))) TS_OffersMessageFlow_blinded_paths_for_async_recipient(uint64_t this_arg, uint8_tArray recipient_id, uint64_t relative_expiry, uint64_tArray peers) { @@ -104342,22 +104342,22 @@ void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_ InitFeatures_set_zero_conf_required(&this_arg_conv); } -void __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) { +void __attribute__((export_name("TS_InitFeatures_clear_zero_conf"))) TS_InitFeatures_clear_zero_conf(uint64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_supports_zero_conf(&this_arg_conv); + InitFeatures_clear_zero_conf(&this_arg_conv); } -jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) { +jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -104379,22 +104379,22 @@ void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_ NodeFeatures_set_zero_conf_required(&this_arg_conv); } -void __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) { +void __attribute__((export_name("TS_NodeFeatures_clear_zero_conf"))) TS_NodeFeatures_clear_zero_conf(uint64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_supports_zero_conf(&this_arg_conv); + NodeFeatures_clear_zero_conf(&this_arg_conv); } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) { +jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -104416,13 +104416,43 @@ void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required" ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -void __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) { +void __attribute__((export_name("TS_ChannelTypeFeatures_clear_zero_conf"))) TS_ChannelTypeFeatures_clear_zero_conf(uint64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_zero_conf(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) { LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(uint64_t this_arg) { diff --git a/ts/bindings.c.body b/ts/bindings.c.body index ddebcb29..5f98544f 100644 --- a/ts/bindings.c.body +++ b/ts/bindings.c.body @@ -83810,7 +83810,7 @@ uint64_t __attribute__((export_name("TS_OffersMessageFlow_set_paths_to_static_i return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_OffersMessageFlow_best_block_updated"))) TS_OffersMessageFlow_best_block_updated(uint64_t this_arg, uint8_tArray header, uint32_t _height) { +void __attribute__((export_name("TS_OffersMessageFlow_best_block_updated"))) TS_OffersMessageFlow_best_block_updated(uint64_t this_arg, uint8_tArray header, uint32_t height) { LDKOffersMessageFlow this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -83820,7 +83820,7 @@ void __attribute__((export_name("TS_OffersMessageFlow_best_block_updated"))) TS CHECK(header->arr_len == 80); memcpy(header_arr, header->elems, 80); FREE(header); uint8_t (*header_ref)[80] = &header_arr; - OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, _height); + OffersMessageFlow_best_block_updated(&this_arg_conv, header_ref, height); } uint64_t __attribute__((export_name("TS_OffersMessageFlow_blinded_paths_for_async_recipient"))) TS_OffersMessageFlow_blinded_paths_for_async_recipient(uint64_t this_arg, uint8_tArray recipient_id, uint64_t relative_expiry, uint64_tArray peers) { @@ -104340,22 +104340,22 @@ void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_ InitFeatures_set_zero_conf_required(&this_arg_conv); } -void __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) { +void __attribute__((export_name("TS_InitFeatures_clear_zero_conf"))) TS_InitFeatures_clear_zero_conf(uint64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - InitFeatures_supports_zero_conf(&this_arg_conv); + InitFeatures_clear_zero_conf(&this_arg_conv); } -jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) { +jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -104377,22 +104377,22 @@ void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_ NodeFeatures_set_zero_conf_required(&this_arg_conv); } -void __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) { +void __attribute__((export_name("TS_NodeFeatures_clear_zero_conf"))) TS_NodeFeatures_clear_zero_conf(uint64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - NodeFeatures_supports_zero_conf(&this_arg_conv); + NodeFeatures_clear_zero_conf(&this_arg_conv); } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) { +jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } @@ -104414,13 +104414,43 @@ void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required" ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -void __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) { +void __attribute__((export_name("TS_ChannelTypeFeatures_clear_zero_conf"))) TS_ChannelTypeFeatures_clear_zero_conf(uint64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelTypeFeatures_clear_zero_conf(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) { LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(uint64_t this_arg) { diff --git a/ts/bindings.mts b/ts/bindings.mts index 49056fd5..ad74ee74 100644 --- a/ts/bindings.mts +++ b/ts/bindings.mts @@ -65080,13 +65080,13 @@ export function OffersMessageFlow_set_paths_to_static_invoice_server(this_arg: b const nativeResponseValue = wasm.TS_OffersMessageFlow_set_paths_to_static_invoice_server(this_arg, paths_to_static_invoice_server, peers); return nativeResponseValue; } - // void OffersMessageFlow_best_block_updated(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t _height); + // void OffersMessageFlow_best_block_updated(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height); /* @internal */ -export function OffersMessageFlow_best_block_updated(this_arg: bigint, header: number, _height: number): void { +export function OffersMessageFlow_best_block_updated(this_arg: bigint, header: number, height: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TS_OffersMessageFlow_best_block_updated(this_arg, header, _height); + const nativeResponseValue = wasm.TS_OffersMessageFlow_best_block_updated(this_arg, header, height); // debug statements here } // MUST_USE_RES struct LDKCResult_CVec_BlindedMessagePathZNoneZ OffersMessageFlow_blinded_paths_for_async_recipient(const struct LDKOffersMessageFlow *NONNULL_PTR this_arg, struct LDKCVec_u8Z recipient_id, struct LDKCOption_u64Z relative_expiry, struct LDKCVec_MessageForwardNodeZ peers); @@ -80101,22 +80101,22 @@ export function InitFeatures_set_zero_conf_required(this_arg: bigint): void { const nativeResponseValue = wasm.TS_InitFeatures_set_zero_conf_required(this_arg); // debug statements here } - // void InitFeatures_supports_zero_conf(struct LDKInitFeatures *NONNULL_PTR this_arg); + // void InitFeatures_clear_zero_conf(struct LDKInitFeatures *NONNULL_PTR this_arg); /* @internal */ -export function InitFeatures_supports_zero_conf(this_arg: bigint): void { +export function InitFeatures_clear_zero_conf(this_arg: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TS_InitFeatures_supports_zero_conf(this_arg); + const nativeResponseValue = wasm.TS_InitFeatures_clear_zero_conf(this_arg); // debug statements here } - // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); /* @internal */ -export function InitFeatures_requires_zero_conf(this_arg: bigint): boolean { +export function InitFeatures_supports_zero_conf(this_arg: bigint): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TS_InitFeatures_requires_zero_conf(this_arg); + const nativeResponseValue = wasm.TS_InitFeatures_supports_zero_conf(this_arg); return nativeResponseValue; } // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); @@ -80137,22 +80137,22 @@ export function NodeFeatures_set_zero_conf_required(this_arg: bigint): void { const nativeResponseValue = wasm.TS_NodeFeatures_set_zero_conf_required(this_arg); // debug statements here } - // void NodeFeatures_supports_zero_conf(struct LDKNodeFeatures *NONNULL_PTR this_arg); + // void NodeFeatures_clear_zero_conf(struct LDKNodeFeatures *NONNULL_PTR this_arg); /* @internal */ -export function NodeFeatures_supports_zero_conf(this_arg: bigint): void { +export function NodeFeatures_clear_zero_conf(this_arg: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TS_NodeFeatures_supports_zero_conf(this_arg); + const nativeResponseValue = wasm.TS_NodeFeatures_clear_zero_conf(this_arg); // debug statements here } - // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); /* @internal */ -export function NodeFeatures_requires_zero_conf(this_arg: bigint): boolean { +export function NodeFeatures_supports_zero_conf(this_arg: bigint): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TS_NodeFeatures_requires_zero_conf(this_arg); + const nativeResponseValue = wasm.TS_NodeFeatures_supports_zero_conf(this_arg); return nativeResponseValue; } // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); @@ -80173,14 +80173,41 @@ export function ChannelTypeFeatures_set_zero_conf_required(this_arg: bigint): vo const nativeResponseValue = wasm.TS_ChannelTypeFeatures_set_zero_conf_required(this_arg); // debug statements here } - // void ChannelTypeFeatures_supports_zero_conf(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + // void ChannelTypeFeatures_clear_zero_conf(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); /* @internal */ -export function ChannelTypeFeatures_supports_zero_conf(this_arg: bigint): void { +export function ChannelTypeFeatures_clear_zero_conf(this_arg: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TS_ChannelTypeFeatures_supports_zero_conf(this_arg); + const nativeResponseValue = wasm.TS_ChannelTypeFeatures_clear_zero_conf(this_arg); // debug statements here +} + // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); +/* @internal */ +export function ChannelTypeFeatures_supports_zero_conf(this_arg: bigint): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TS_ChannelTypeFeatures_supports_zero_conf(this_arg); + return nativeResponseValue; +} + // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); +/* @internal */ +export function InitFeatures_requires_zero_conf(this_arg: bigint): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TS_InitFeatures_requires_zero_conf(this_arg); + return nativeResponseValue; +} + // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); +/* @internal */ +export function NodeFeatures_requires_zero_conf(this_arg: bigint): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TS_NodeFeatures_requires_zero_conf(this_arg); + return nativeResponseValue; } // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); /* @internal */ diff --git a/ts/structs/Bolt11Invoice.mts b/ts/structs/Bolt11Invoice.mts index ee906eaf..a4fd99b5 100644 --- a/ts/structs/Bolt11Invoice.mts +++ b/ts/structs/Bolt11Invoice.mts @@ -1004,7 +1004,10 @@ export class Bolt11Invoice extends CommonBase { } /** - * Recover the payee's public key (only to be used if none was included in the invoice) + * Get the invoice's payee public key. + * + * This uses the explicitly included payee public key, if present, otherwise it recovers the + * payee public key from the signature. Prefer [`Self::get_payee_pub_key`] for clarity. */ public recover_payee_pub_key(): Uint8Array { const ret: number = bindings.Bolt11Invoice_recover_payee_pub_key(this.ptr); @@ -1013,8 +1016,8 @@ export class Bolt11Invoice extends CommonBase { } /** - * Recover the payee's public key if one was included in the invoice, otherwise return the - * recovered public key from the signature + * Get the invoice's payee public key, preferring an explicitly included payee public key and + * falling back to recovering the key from the signature. */ public get_payee_pub_key(): Uint8Array { const ret: number = bindings.Bolt11Invoice_get_payee_pub_key(this.ptr); diff --git a/ts/structs/ChannelManager.mts b/ts/structs/ChannelManager.mts index 37be9054..427c5b76 100644 --- a/ts/structs/ChannelManager.mts +++ b/ts/structs/ChannelManager.mts @@ -1869,6 +1869,12 @@ export class ChannelManager extends CommonBase { * the channel. This will spend the channel's funding transaction output, effectively replacing * it with a new one. * + * # Required Feature Flags + * + * Initiating a splice requires that the channel counterparty supports splicing. Any + * channel (no matter the type) can be spliced, as long as the counterparty is currently + * connected. + * * # Arguments * * Provide a `contribution` to determine if value is spliced in or out. The splice initiator is diff --git a/ts/structs/ChannelTypeFeatures.mts b/ts/structs/ChannelTypeFeatures.mts index 33d57ee1..39091177 100644 --- a/ts/structs/ChannelTypeFeatures.mts +++ b/ts/structs/ChannelTypeFeatures.mts @@ -1252,13 +1252,21 @@ export class ChannelTypeFeatures extends CommonBase { /** * Unsets this feature. */ - public supports_zero_conf(): void { - bindings.ChannelTypeFeatures_supports_zero_conf(this.ptr); + public clear_zero_conf(): void { + bindings.ChannelTypeFeatures_clear_zero_conf(this.ptr); } /** * Checks if this feature is supported. */ + public supports_zero_conf(): boolean { + const ret: boolean = bindings.ChannelTypeFeatures_supports_zero_conf(this.ptr); + return ret; + } + + /** + * Checks if this feature is required. + */ public requires_zero_conf(): boolean { const ret: boolean = bindings.ChannelTypeFeatures_requires_zero_conf(this.ptr); return ret; diff --git a/ts/structs/Event.mts b/ts/structs/Event.mts index 3188b7ed..d6a953c6 100644 --- a/ts/structs/Event.mts +++ b/ts/structs/Event.mts @@ -1644,7 +1644,8 @@ export class Event_PaymentSent extends Event { * If the recipient or an intermediate node misbehaves and gives us free money, this may * overstate the amount paid, though this is unlikely. * - * This is only `None` for payments initiated on LDK versions prior to 0.0.103. + * This is only `None` for payments abandoned but ultimately claimed when using LDK versions + * prior to 0.3, 0.2.3, or 0.1.10. * * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees */ diff --git a/ts/structs/InitFeatures.mts b/ts/structs/InitFeatures.mts index 1f2bcb86..5ab03c29 100644 --- a/ts/structs/InitFeatures.mts +++ b/ts/structs/InitFeatures.mts @@ -1760,13 +1760,21 @@ export class InitFeatures extends CommonBase { /** * Unsets this feature. */ - public supports_zero_conf(): void { - bindings.InitFeatures_supports_zero_conf(this.ptr); + public clear_zero_conf(): void { + bindings.InitFeatures_clear_zero_conf(this.ptr); } /** * Checks if this feature is supported. */ + public supports_zero_conf(): boolean { + const ret: boolean = bindings.InitFeatures_supports_zero_conf(this.ptr); + return ret; + } + + /** + * Checks if this feature is required. + */ public requires_zero_conf(): boolean { const ret: boolean = bindings.InitFeatures_requires_zero_conf(this.ptr); return ret; diff --git a/ts/structs/NodeFeatures.mts b/ts/structs/NodeFeatures.mts index 2bf40fc9..e83237b1 100644 --- a/ts/structs/NodeFeatures.mts +++ b/ts/structs/NodeFeatures.mts @@ -1731,13 +1731,21 @@ export class NodeFeatures extends CommonBase { /** * Unsets this feature. */ - public supports_zero_conf(): void { - bindings.NodeFeatures_supports_zero_conf(this.ptr); + public clear_zero_conf(): void { + bindings.NodeFeatures_clear_zero_conf(this.ptr); } /** * Checks if this feature is supported. */ + public supports_zero_conf(): boolean { + const ret: boolean = bindings.NodeFeatures_supports_zero_conf(this.ptr); + return ret; + } + + /** + * Checks if this feature is required. + */ public requires_zero_conf(): boolean { const ret: boolean = bindings.NodeFeatures_requires_zero_conf(this.ptr); return ret; diff --git a/ts/structs/OffersMessageFlow.mts b/ts/structs/OffersMessageFlow.mts index b307f9f1..2a681513 100644 --- a/ts/structs/OffersMessageFlow.mts +++ b/ts/structs/OffersMessageFlow.mts @@ -913,8 +913,8 @@ export class OffersMessageFlow extends CommonBase { * Must be called whenever a new chain tip becomes available. May be skipped * for intermediary blocks. */ - public best_block_updated(header: Uint8Array, _height: number): void { - bindings.OffersMessageFlow_best_block_updated(this.ptr, bindings.encodeUint8Array(header), _height); + public best_block_updated(header: Uint8Array, height: number): void { + bindings.OffersMessageFlow_best_block_updated(this.ptr, bindings.encodeUint8Array(header), height); } /** diff --git a/ts/structs/RapidGossipSync.mts b/ts/structs/RapidGossipSync.mts index cfd0946a..2953bd96 100644 --- a/ts/structs/RapidGossipSync.mts +++ b/ts/structs/RapidGossipSync.mts @@ -868,6 +868,10 @@ export class RapidGossipSync extends CommonBase { * Update network graph from binary data. * Returns the last sync timestamp to be used the next time rapid sync data is queried. * + * You should consider the gossip data source as semi-trusted. It is generally the case that it + * can DoS the client either by omitting data which leads to pathfinding failure or by bloating + * the graph such that it leads to eventual OOM on the client. + * * `update_data`: `&[u8]` binary stream that comprises the update data * `current_time_unix`: `Option` optional current timestamp to verify data age */