diff --git a/.github/workflows/precompile_binaries.yml b/.github/workflows/precompile_binaries.yml index 4ef54fd..c2442a8 100644 --- a/.github/workflows/precompile_binaries.yml +++ b/.github/workflows/precompile_binaries.yml @@ -1,6 +1,6 @@ on: push: - branches: [main, v0.2.2-dev] + branches: [v0.2.2-dev, main] name: Precompile Binaries @@ -13,6 +13,7 @@ jobs: os: - ubuntu-20.04 - macOS-latest + - windows-latest steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 @@ -32,8 +33,17 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: 'stable' + - name: Configure git with access token + run: | + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.CARGOKIT_PRIVATE_KEY }} + - name: Install GTK + if: (matrix.os == 'ubuntu-20.04') + run: sudo apt-get update && sudo apt-get install libgtk-3-dev - name: Precompile (with iOS) - if: (matrix.os == 'macOS-latest') + if: (matrix.os == 'macOS-latest') || (matrix.os == 'windows-latest') run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter working-directory: cargokit/build_tool env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c9a88d..16f6ba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,29 +1,25 @@ ## [0.2.2-dev] Updated Rust and Flutter dependencies. #### APIs added -- Expose `nextEventAsync()`, `config()`, `status()`, `receiveVariableAmountPaymentViaJitChannel` & `receivePaymentViaJitChannel` in `Node` -#### API changed -- Replaced `totalOnchainBalanceSats()` & `spendableOnchainBalanceSats()` with `listBalances()`. -- `connectOpenChannel` returns a `UserChannelId` object. -- `updateChannelConfig` & `closeChannel` accepts a `UserChannelId` object instead of `ChannelId` - -## [0.2.1] -Updated Rust and Flutter dependencies. +- Expose `isRunning()` in `Node` class. #### API changed - Renamed `waitUntilNextHandled()` to `waitNextHandled`. -- Renamed `listeningAddress()` to `listeningAddresses` -- Upgraded `BuilderException` to handle Invalid SocketAddress. +- Renamed `listeningAddress()` to `listeningAddresses`. +- Upgraded `BuilderException` to handle invalid `socketAddress` & `trustedPeers. +- Upgraded `NodeException` to handle invalid `txid`. #### Fixed - Functions hang indefinitely on iOs devices - Android support bug resolved +- Thread `frb_workerpool` panic on `SocketAddress`, `PublicKey`, `Address` `Bolt11Invoice`, `Config` and `Txid`. ## [0.2.0] Updated `Rust` and `Flutter` dependencies. -Invalid `BuilderException` bug resolved +## [0.1.3] +Updated `Rust` and `Flutter` dependencies. +Invalid `BuilderException` bug resolved #### APIs added - Expose `generate()` in `Mnemonic` class. - #### API changed - Remove `generateEntropyMnemonic()`. diff --git a/cargokit/build_tool/lib/src/options.dart b/cargokit/build_tool/lib/src/options.dart index 7937dca..b2c0f7a 100644 --- a/cargokit/build_tool/lib/src/options.dart +++ b/cargokit/build_tool/lib/src/options.dart @@ -298,7 +298,10 @@ class CargokitUserOptions { } userProjectDir = userProjectDir.parent; } - return CargokitUserOptions._(); + return CargokitUserOptions( + usePrecompiledBinaries: true, + verboseLogging: false, + ); } final bool usePrecompiledBinaries; diff --git a/cargokit_options.yaml b/example/cargokit_options.yaml similarity index 100% rename from cargokit_options.yaml rename to example/cargokit_options.yaml diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 9625e10..7c56964 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 8c02e83..0bbacec 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -20,7 +20,7 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider_foundation/darwin" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 ldk_node: 5b3cacf9e7a5d5ae0d5c24e133af5c37c3da338b path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 1abeb51..9210016 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -159,7 +159,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -346,7 +346,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -424,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -473,7 +473,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -576,7 +576,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -648,7 +648,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a6b826d..5e31d3d 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { String displayText = ""; ldk.SocketAddress? bobAddr; ldk.Bolt11Invoice? invoice; - ldk.UserChannelId? userChannelId; + ldk.ChannelId? channelId; // Replace this with your local esplora url String esploraUrl = @@ -63,7 +63,7 @@ class _MyAppState extends State { closeChannel() async { await aliceNode.closeChannel( - userChannelId: userChannelId!, counterpartyNodeId: bobNodeId!); + channelId: channelId!, counterpartyNodeId: bobNodeId!); } Future initAliceNode() async { @@ -81,7 +81,7 @@ class _MyAppState extends State { final res = await aliceNode.nodeId(); setState(() { aliceNodeId = res; - displayText = "${aliceNodeId?.hexCode} started successfully"; + displayText = "${aliceNodeId?.hex} started successfully"; }); } @@ -113,16 +113,18 @@ class _MyAppState extends State { } totalOnchainBalanceSats() async { - final alice = await aliceNode.listBalances(); - final bob = await bobNode.listBalances(); + final alice = await aliceNode.totalOnchainBalanceSats(); + final bob = await bobNode.totalOnchainBalanceSats(); if (kDebugMode) { - print("alice's balance: ${alice.totalOnchainBalanceSats}"); - print("alice's spendable balance: ${alice.spendableOnchainBalanceSats}"); - print("bob's balance: ${bob.totalOnchainBalanceSats}"); - print("bob's spendable balance: ${bob.spendableOnchainBalanceSats}"); + print("alice's balance: $alice"); + print( + "alice's spendable balance: ${await aliceNode.spendableOnchainBalanceSats()}"); + print("bob's balance: $bob"); + print( + "bob's spendable balance: ${await bobNode.spendableOnchainBalanceSats()}"); } setState(() { - aliceBalance = alice.spendableOnchainBalanceSats; + aliceBalance = alice; }); } @@ -140,8 +142,7 @@ class _MyAppState extends State { if (res.isNotEmpty) { print("======Channels========"); for (var e in res) { - print("nodeId: ${aliceNodeId!.hexCode}"); - print("userChannelId: ${e.userChannelId.data}"); + print("nodeId: ${aliceNodeId!.hex}"); print("channelId: ${e.channelId.data}"); print("isChannelReady: ${e.isChannelReady}"); print("isUsable: ${e.isUsable}"); @@ -211,10 +212,10 @@ class _MyAppState extends State { connectOpenChannel() async { final funding_amount_sat = 80000; final push_msat = (funding_amount_sat / 2) * 1000; - userChannelId = await aliceNode.connectOpenChannel( + await aliceNode.connectOpenChannel( channelAmountSats: funding_amount_sat, announceChannel: true, - address: bobAddr!, + socketAddress: bobAddr!, pushToCounterpartyMsat: push_msat.toInt(), nodeId: bobNodeId!); } @@ -232,6 +233,24 @@ class _MyAppState extends State { }); } + setChannelId() async { + final channelInfos = await aliceNode.listChannels(); + if (channelInfos.isNotEmpty) { + channelId = channelInfos.first.channelId; + if (kDebugMode) { + print(channelId?.data); + } + + setState(() { + displayText = channelId!.data.toString(); + }); + } else { + if (kDebugMode) { + print("No open channels available"); + } + } + } + stop() async { await bobNode.stop(); await aliceNode.stop(); @@ -443,6 +462,20 @@ class _MyAppState extends State { fontSize: 12, height: 1.5, fontWeight: FontWeight.w800))), + TextButton( + onPressed: () async { + await setChannelId(); + }, + child: Text( + 'Set channelId', + overflow: TextOverflow.clip, + textAlign: TextAlign.center, + style: GoogleFonts.nunito( + color: Colors.indigoAccent, + fontSize: 12, + height: 1.5, + fontWeight: FontWeight.w800), + )), TextButton( onPressed: () async { await receiveAndSendPayments(); @@ -512,7 +545,7 @@ class _MyAppState extends State { Text( aliceNodeId == null ? "Node not initialized" - : "@Id_:${aliceNodeId!.hexCode}", + : "@Id_:${aliceNodeId!.hex}", maxLines: 1, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, diff --git a/example/pubspec.lock b/example/pubspec.lock index 9d91f1f..46a111d 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -114,10 +114,10 @@ packages: dependency: transitive description: name: flutter_rust_bridge - sha256: c51fa002e57e64d13030269ed9cd43752173ee4c6f60ec1e9c41450d63c75bae + sha256: e9a8716b1ad2fc81c434f3e4bf84b86c578578678c57e568b44aea7acf210102 url: "https://pub.dev" source: hosted - version: "2.0.0-dev.28" + version: "2.0.0-dev.31" flutter_test: dependency: "direct dev" description: flutter @@ -178,6 +178,30 @@ packages: relative: true source: path version: "0.2.2-dev" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.dev" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.dev" + source: hosted + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" lints: dependency: transitive description: @@ -190,34 +214,34 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.12.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: "direct main" description: @@ -339,10 +363,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" typed_data: dependency: transitive description: @@ -367,6 +391,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + url: "https://pub.dev" + source: hosted + version: "14.2.1" web: dependency: transitive description: @@ -392,5 +424,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index db72404..a72914e 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -14,23 +14,11 @@ void store_dart_post_cobject(DartPostCObjectFnType ptr); // EXTRA END typedef struct _Dart_Handle* Dart_Handle; -typedef struct wire_cst_node_base { - uintptr_t ptr; -} wire_cst_node_base; - typedef struct wire_cst_list_prim_u_8_strict { uint8_t *ptr; int32_t len; } wire_cst_list_prim_u_8_strict; -typedef struct wire_cst_user_channel_id { - struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_user_channel_id; - -typedef struct wire_cst_public_key { - struct wire_cst_list_prim_u_8_strict *hex_code; -} wire_cst_public_key; - typedef struct wire_cst_SocketAddress_TcpIpV4 { struct wire_cst_list_prim_u_8_strict *addr; uint16_t port; @@ -70,55 +58,15 @@ typedef struct wire_cst_socket_address { union SocketAddressKind kind; } wire_cst_socket_address; -typedef struct wire_cst_MaxDustHTLCExposure_FixedLimitMsat { - uint64_t field0; -} wire_cst_MaxDustHTLCExposure_FixedLimitMsat; - -typedef struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { - uint64_t field0; -} wire_cst_MaxDustHTLCExposure_FeeRateMultiplier; - -typedef union MaxDustHTLCExposureKind { - struct wire_cst_MaxDustHTLCExposure_FixedLimitMsat FixedLimitMsat; - struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier FeeRateMultiplier; -} MaxDustHTLCExposureKind; - -typedef struct wire_cst_max_dust_htlc_exposure { - int32_t tag; - union MaxDustHTLCExposureKind kind; -} wire_cst_max_dust_htlc_exposure; - -typedef struct wire_cst_channel_config { - uint32_t forwarding_fee_proportional_millionths; - uint32_t forwarding_fee_base_msat; - uint16_t cltv_expiry_delta; - struct wire_cst_max_dust_htlc_exposure *max_dust_htlc_exposure; - uint64_t force_close_avoidance_max_fee_satoshis; - bool accept_underpaying_htlcs; -} wire_cst_channel_config; - -typedef struct wire_cst_payment_hash { - struct wire_cst_list_prim_u_8_strict *data; -} wire_cst_payment_hash; - -typedef struct wire_cst_address { - struct wire_cst_list_prim_u_8_strict *s; -} wire_cst_address; - -typedef struct wire_cst_bolt_11_invoice { - struct wire_cst_list_prim_u_8_strict *signed_raw_invoice; -} wire_cst_bolt_11_invoice; - -typedef struct wire_cst_list_prim_u_8_loose { - uint8_t *ptr; - int32_t len; -} wire_cst_list_prim_u_8_loose; - typedef struct wire_cst_list_socket_address { struct wire_cst_socket_address *ptr; int32_t len; } wire_cst_list_socket_address; +typedef struct wire_cst_public_key { + struct wire_cst_list_prim_u_8_strict *hex; +} wire_cst_public_key; + typedef struct wire_cst_list_public_key { struct wire_cst_public_key *ptr; int32_t len; @@ -159,12 +107,12 @@ typedef struct wire_cst_EntropySourceConfig_SeedBytes { struct wire_cst_list_prim_u_8_strict *field0; } wire_cst_EntropySourceConfig_SeedBytes; -typedef struct wire_cst_mnemonic_base { +typedef struct wire_cst_ldk_mnemonic { struct wire_cst_list_prim_u_8_strict *seed_phrase; -} wire_cst_mnemonic_base; +} wire_cst_ldk_mnemonic; typedef struct wire_cst_EntropySourceConfig_Bip39Mnemonic { - struct wire_cst_mnemonic_base *mnemonic; + struct wire_cst_ldk_mnemonic *mnemonic; struct wire_cst_list_prim_u_8_strict *passphrase; } wire_cst_EntropySourceConfig_Bip39Mnemonic; @@ -192,46 +140,64 @@ typedef struct wire_cst_gossip_source_config { union GossipSourceConfigKind kind; } wire_cst_gossip_source_config; -typedef struct wire_cst_record_socket_address_public_key_opt_string { - struct wire_cst_socket_address field0; - struct wire_cst_public_key field1; - struct wire_cst_list_prim_u_8_strict *field2; -} wire_cst_record_socket_address_public_key_opt_string; - -typedef struct wire_cst_liquidity_source_config { - struct wire_cst_record_socket_address_public_key_opt_string lsps2_service; -} wire_cst_liquidity_source_config; +typedef struct wire_cst_ldk_node { + uintptr_t ptr; +} wire_cst_ldk_node; typedef struct wire_cst_channel_id { struct wire_cst_list_prim_u_8_strict *data; } wire_cst_channel_id; -typedef struct wire_cst_ClosureReason_CounterpartyForceClosed { - struct wire_cst_list_prim_u_8_strict *peer_msg; -} wire_cst_ClosureReason_CounterpartyForceClosed; +typedef struct wire_cst_MaxDustHTLCExposure_FixedLimitMsat { + uint64_t field0; +} wire_cst_MaxDustHTLCExposure_FixedLimitMsat; -typedef struct wire_cst_ClosureReason_ProcessingError { - struct wire_cst_list_prim_u_8_strict *err; -} wire_cst_ClosureReason_ProcessingError; +typedef struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { + uint64_t field0; +} wire_cst_MaxDustHTLCExposure_FeeRateMultiplier; -typedef union ClosureReasonKind { - struct wire_cst_ClosureReason_CounterpartyForceClosed CounterpartyForceClosed; - struct wire_cst_ClosureReason_ProcessingError ProcessingError; -} ClosureReasonKind; +typedef union MaxDustHTLCExposureKind { + struct wire_cst_MaxDustHTLCExposure_FixedLimitMsat FixedLimitMsat; + struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier FeeRateMultiplier; +} MaxDustHTLCExposureKind; -typedef struct wire_cst_closure_reason { +typedef struct wire_cst_max_dust_htlc_exposure { int32_t tag; - union ClosureReasonKind kind; -} wire_cst_closure_reason; + union MaxDustHTLCExposureKind kind; +} wire_cst_max_dust_htlc_exposure; + +typedef struct wire_cst_channel_config { + uint32_t forwarding_fee_proportional_millionths; + uint32_t forwarding_fee_base_msat; + uint16_t cltv_expiry_delta; + struct wire_cst_max_dust_htlc_exposure max_dust_htlc_exposure; + uint64_t force_close_avoidance_max_fee_satoshis; + bool accept_underpaying_htlcs; +} wire_cst_channel_config; + +typedef struct wire_cst_payment_hash { + struct wire_cst_list_prim_u_8_strict *data; +} wire_cst_payment_hash; + +typedef struct wire_cst_address { + struct wire_cst_list_prim_u_8_strict *s; +} wire_cst_address; + +typedef struct wire_cst_bolt_11_invoice { + struct wire_cst_list_prim_u_8_strict *signed_raw_invoice; +} wire_cst_bolt_11_invoice; + +typedef struct wire_cst_list_prim_u_8_loose { + uint8_t *ptr; + int32_t len; +} wire_cst_list_prim_u_8_loose; typedef struct wire_cst_Event_PaymentSuccessful { struct wire_cst_payment_hash *payment_hash; - uint64_t *fee_paid_msat; } wire_cst_Event_PaymentSuccessful; typedef struct wire_cst_Event_PaymentFailed { struct wire_cst_payment_hash *payment_hash; - int32_t *reason; } wire_cst_Event_PaymentFailed; typedef struct wire_cst_Event_PaymentReceived { @@ -239,6 +205,22 @@ typedef struct wire_cst_Event_PaymentReceived { uint64_t amount_msat; } wire_cst_Event_PaymentReceived; +typedef struct wire_cst_user_channel_id { + uint64_t data; +} wire_cst_user_channel_id; + +typedef struct wire_cst_Event_ChannelReady { + struct wire_cst_channel_id *channel_id; + struct wire_cst_user_channel_id *user_channel_id; + struct wire_cst_public_key *counterparty_node_id; +} wire_cst_Event_ChannelReady; + +typedef struct wire_cst_Event_ChannelClosed { + struct wire_cst_channel_id *channel_id; + struct wire_cst_user_channel_id *user_channel_id; + struct wire_cst_public_key *counterparty_node_id; +} wire_cst_Event_ChannelClosed; + typedef struct wire_cst_txid { struct wire_cst_list_prim_u_8_strict *hash; } wire_cst_txid; @@ -256,26 +238,13 @@ typedef struct wire_cst_Event_ChannelPending { struct wire_cst_out_point *funding_txo; } wire_cst_Event_ChannelPending; -typedef struct wire_cst_Event_ChannelReady { - struct wire_cst_channel_id *channel_id; - struct wire_cst_user_channel_id *user_channel_id; - struct wire_cst_public_key *counterparty_node_id; -} wire_cst_Event_ChannelReady; - -typedef struct wire_cst_Event_ChannelClosed { - struct wire_cst_channel_id *channel_id; - struct wire_cst_user_channel_id *user_channel_id; - struct wire_cst_public_key *counterparty_node_id; - struct wire_cst_closure_reason *reason; -} wire_cst_Event_ChannelClosed; - typedef union EventKind { struct wire_cst_Event_PaymentSuccessful PaymentSuccessful; struct wire_cst_Event_PaymentFailed PaymentFailed; struct wire_cst_Event_PaymentReceived PaymentReceived; - struct wire_cst_Event_ChannelPending ChannelPending; struct wire_cst_Event_ChannelReady ChannelReady; struct wire_cst_Event_ChannelClosed ChannelClosed; + struct wire_cst_Event_ChannelPending ChannelPending; } EventKind; typedef struct wire_cst_event { @@ -303,11 +272,12 @@ typedef struct wire_cst_payment_details { typedef struct wire_cst_channel_details { struct wire_cst_channel_id channel_id; struct wire_cst_public_key counterparty_node_id; - struct wire_cst_out_point *funding_txo; + struct wire_cst_list_prim_u_8_strict *funding_txo; uint64_t channel_value_sats; uint64_t *unspendable_punishment_reserve; struct wire_cst_user_channel_id user_channel_id; uint32_t feerate_sat_per_1000_weight; + uint64_t balance_msat; uint64_t outbound_capacity_msat; uint64_t inbound_capacity_msat; uint32_t *confirmations_required; @@ -316,19 +286,6 @@ typedef struct wire_cst_channel_details { bool is_channel_ready; bool is_usable; bool is_public; - uint16_t *cltv_expiry_delta; - uint64_t counterparty_unspendable_punishment_reserve; - uint64_t *counterparty_outbound_htlc_minimum_msat; - uint64_t *counterparty_outbound_htlc_maximum_msat; - uint32_t *counterparty_forwarding_info_fee_base_msat; - uint32_t *counterparty_forwarding_info_fee_proportional_millionths; - uint16_t *counterparty_forwarding_info_cltv_expiry_delta; - uint64_t next_outbound_htlc_limit_msat; - uint64_t next_outbound_htlc_minimum_msat; - uint16_t *force_close_spend_delay; - uint64_t inbound_htlc_minimum_msat; - uint64_t *inbound_htlc_maximum_msat; - struct wire_cst_channel_config config; } wire_cst_channel_details; typedef struct wire_cst_list_channel_details { @@ -336,69 +293,6 @@ typedef struct wire_cst_list_channel_details { int32_t len; } wire_cst_list_channel_details; -typedef struct wire_cst_LightningBalance_ClaimableOnChannelClose { - struct wire_cst_channel_id *channel_id; - struct wire_cst_public_key *counterparty_node_id; - uint64_t amount_satoshis; -} wire_cst_LightningBalance_ClaimableOnChannelClose; - -typedef struct wire_cst_LightningBalance_ClaimableAwaitingConfirmations { - struct wire_cst_channel_id *channel_id; - struct wire_cst_public_key *counterparty_node_id; - uint64_t amount_satoshis; - uint32_t confirmation_height; -} wire_cst_LightningBalance_ClaimableAwaitingConfirmations; - -typedef struct wire_cst_LightningBalance_ContentiousClaimable { - struct wire_cst_channel_id *channel_id; - struct wire_cst_public_key *counterparty_node_id; - uint64_t amount_satoshis; - uint32_t timeout_height; - struct wire_cst_payment_hash *payment_hash; - struct wire_cst_payment_preimage *payment_preimage; -} wire_cst_LightningBalance_ContentiousClaimable; - -typedef struct wire_cst_LightningBalance_MaybeTimeoutClaimableHTLC { - struct wire_cst_channel_id *channel_id; - struct wire_cst_public_key *counterparty_node_id; - uint64_t amount_satoshis; - uint32_t claimable_height; - struct wire_cst_payment_hash *payment_hash; -} wire_cst_LightningBalance_MaybeTimeoutClaimableHTLC; - -typedef struct wire_cst_LightningBalance_MaybePreimageClaimableHTLC { - struct wire_cst_channel_id *channel_id; - struct wire_cst_public_key *counterparty_node_id; - uint64_t amount_satoshis; - uint32_t expiry_height; - struct wire_cst_payment_hash *payment_hash; -} wire_cst_LightningBalance_MaybePreimageClaimableHTLC; - -typedef struct wire_cst_LightningBalance_CounterpartyRevokedOutputClaimable { - struct wire_cst_channel_id *channel_id; - struct wire_cst_public_key *counterparty_node_id; - uint64_t amount_satoshis; -} wire_cst_LightningBalance_CounterpartyRevokedOutputClaimable; - -typedef union LightningBalanceKind { - struct wire_cst_LightningBalance_ClaimableOnChannelClose ClaimableOnChannelClose; - struct wire_cst_LightningBalance_ClaimableAwaitingConfirmations ClaimableAwaitingConfirmations; - struct wire_cst_LightningBalance_ContentiousClaimable ContentiousClaimable; - struct wire_cst_LightningBalance_MaybeTimeoutClaimableHTLC MaybeTimeoutClaimableHTLC; - struct wire_cst_LightningBalance_MaybePreimageClaimableHTLC MaybePreimageClaimableHTLC; - struct wire_cst_LightningBalance_CounterpartyRevokedOutputClaimable CounterpartyRevokedOutputClaimable; -} LightningBalanceKind; - -typedef struct wire_cst_lightning_balance { - int32_t tag; - union LightningBalanceKind kind; -} wire_cst_lightning_balance; - -typedef struct wire_cst_list_lightning_balance { - struct wire_cst_lightning_balance *ptr; - int32_t len; -} wire_cst_list_lightning_balance; - typedef struct wire_cst_list_payment_details { struct wire_cst_payment_details *ptr; int32_t len; @@ -415,221 +309,153 @@ typedef struct wire_cst_list_peer_details { int32_t len; } wire_cst_list_peer_details; -typedef struct wire_cst_PendingSweepBalance_PendingBroadcast { - struct wire_cst_channel_id *channel_id; - uint64_t amount_satoshis; -} wire_cst_PendingSweepBalance_PendingBroadcast; - -typedef struct wire_cst_PendingSweepBalance_BroadcastAwaitingConfirmation { - struct wire_cst_channel_id *channel_id; - uint32_t latest_broadcast_height; - struct wire_cst_txid *latest_spending_txid; - uint64_t amount_satoshis; -} wire_cst_PendingSweepBalance_BroadcastAwaitingConfirmation; +void frbgen_ldk_node_wire_build_with_sqlite_store(int64_t port_, + struct wire_cst_config *config, + struct wire_cst_chain_data_source_config *chain_data_source_config, + struct wire_cst_entropy_source_config *entropy_source_config, + struct wire_cst_gossip_source_config *gossip_source_config); -typedef struct wire_cst_PendingSweepBalance_AwaitingThresholdConfirmations { - struct wire_cst_channel_id *channel_id; - struct wire_cst_txid *latest_spending_txid; - struct wire_cst_list_prim_u_8_strict *confirmation_hash; - uint32_t confirmation_height; - uint64_t amount_satoshis; -} wire_cst_PendingSweepBalance_AwaitingThresholdConfirmations; - -typedef union PendingSweepBalanceKind { - struct wire_cst_PendingSweepBalance_PendingBroadcast PendingBroadcast; - struct wire_cst_PendingSweepBalance_BroadcastAwaitingConfirmation BroadcastAwaitingConfirmation; - struct wire_cst_PendingSweepBalance_AwaitingThresholdConfirmations AwaitingThresholdConfirmations; -} PendingSweepBalanceKind; - -typedef struct wire_cst_pending_sweep_balance { - int32_t tag; - union PendingSweepBalanceKind kind; -} wire_cst_pending_sweep_balance; +void frbgen_ldk_node_wire_ldk_mnemonic_generate(int64_t port_); -typedef struct wire_cst_list_pending_sweep_balance { - struct wire_cst_pending_sweep_balance *ptr; - int32_t len; -} wire_cst_list_pending_sweep_balance; - -typedef struct wire_cst_balance_details { - uint64_t total_onchain_balance_sats; - uint64_t spendable_onchain_balance_sats; - uint64_t total_lightning_balance_sats; - struct wire_cst_list_lightning_balance *lightning_balances; - struct wire_cst_list_pending_sweep_balance *pending_balances_from_channel_closures; -} wire_cst_balance_details; - -typedef struct wire_cst_best_block { - struct wire_cst_list_prim_u_8_strict *block_hash; - uint32_t height; -} wire_cst_best_block; - -typedef struct wire_cst_node_status { - bool is_running; - bool is_listening; - struct wire_cst_best_block current_best_block; - uint64_t *latest_wallet_sync_timestamp; - uint64_t *latest_onchain_wallet_sync_timestamp; - uint64_t *latest_fee_rate_cache_update_timestamp; - uint64_t *latest_rgs_snapshot_timestamp; - uint64_t *latest_node_announcement_broadcast_timestamp; -} wire_cst_node_status; - -void frbgen_ldk_node_wire_MnemonicBase_generate(int64_t port_); - -void frbgen_ldk_node_wire_NodeBase_close_channel(int64_t port_, - struct wire_cst_node_base *that, - struct wire_cst_user_channel_id *user_channel_id, +void frbgen_ldk_node_wire_ldk_node_close_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_channel_id *channel_id, struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_NodeBase_config(int64_t port_, struct wire_cst_node_base *that); - -void frbgen_ldk_node_wire_NodeBase_connect(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_connect(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_public_key *node_id, struct wire_cst_socket_address *address, bool persist); -void frbgen_ldk_node_wire_NodeBase_connect_open_channel(int64_t port_, - struct wire_cst_node_base *that, - struct wire_cst_socket_address *address, +void frbgen_ldk_node_wire_ldk_node_connect_open_channel(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_socket_address *socket_address, struct wire_cst_public_key *node_id, uint64_t channel_amount_sats, uint64_t *push_to_counterparty_msat, bool announce_channel, struct wire_cst_channel_config *channel_config); -void frbgen_ldk_node_wire_NodeBase_disconnect(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_disconnect(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_public_key *counterparty_node_id); -void frbgen_ldk_node_wire_NodeBase_event_handled(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_event_handled(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_list_balances(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_is_running(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_list_channels(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_list_channels(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_list_payments(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_list_payments(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_list_payments_with_filter(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_list_payments_with_filter(int64_t port_, + struct wire_cst_ldk_node *that, int32_t payment_direction); -void frbgen_ldk_node_wire_NodeBase_list_peers(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_list_peers(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_listening_addresses(int64_t port_, - struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_listening_addresses(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_new_onchain_address(int64_t port_, - struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_new_onchain_address(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_next_event(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_next_event(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_next_event_async(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_node_id(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_node_id(int64_t port_, struct wire_cst_node_base *that); - -void frbgen_ldk_node_wire_NodeBase_payment(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_payment(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_payment_hash *payment_hash); -void frbgen_ldk_node_wire_NodeBase_receive_payment(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_receive_payment(int64_t port_, + struct wire_cst_ldk_node *that, uint64_t amount_msat, struct wire_cst_list_prim_u_8_strict *description, uint32_t expiry_secs); -void frbgen_ldk_node_wire_NodeBase_receive_payment_via_jit_channel(int64_t port_, - struct wire_cst_node_base *that, - uint64_t amount_msat, - struct wire_cst_list_prim_u_8_strict *description, - uint32_t expiry_secs, - uint64_t *max_total_lsp_fee_limit_msat); - -void frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_receive_variable_amount_payment(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_list_prim_u_8_strict *description, uint32_t expiry_secs); -void frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment_via_jit_channel(int64_t port_, - struct wire_cst_node_base *that, - struct wire_cst_list_prim_u_8_strict *description, - uint32_t expiry_secs, - uint64_t *max_proportional_lsp_fee_limit_ppm_msat); - -void frbgen_ldk_node_wire_NodeBase_remove_payment(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_remove_payment(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_payment_hash *payment_hash); -void frbgen_ldk_node_wire_NodeBase_send_all_to_onchain_address(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_all_to_onchain_address(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_address *address); -void frbgen_ldk_node_wire_NodeBase_send_payment(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_payment(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_bolt_11_invoice *invoice); -void frbgen_ldk_node_wire_NodeBase_send_payment_probes(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_payment_probes(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_bolt_11_invoice *invoice); -void frbgen_ldk_node_wire_NodeBase_send_payment_probes_using_amount(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_payment_probes_using_amount(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_bolt_11_invoice *invoice, uint64_t amount_msat); -void frbgen_ldk_node_wire_NodeBase_send_payment_using_amount(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_payment_using_amount(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_bolt_11_invoice *invoice, uint64_t amount_msat); -void frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment(int64_t port_, + struct wire_cst_ldk_node *that, uint64_t amount_msat, struct wire_cst_public_key *node_id); -void frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment_probes(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes(int64_t port_, + struct wire_cst_ldk_node *that, uint64_t amount_msat, struct wire_cst_public_key *node_id); -void frbgen_ldk_node_wire_NodeBase_send_to_onchain_address(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_send_to_onchain_address(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_address *address, uint64_t amount_sats); -void frbgen_ldk_node_wire_NodeBase_sign_message(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_sign_message(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_list_prim_u_8_loose *msg); -void frbgen_ldk_node_wire_NodeBase_start(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_spendable_onchain_balance_sats(int64_t port_, + struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_status(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_start(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_stop(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_stop(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_sync_wallets(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_sync_wallets(int64_t port_, struct wire_cst_ldk_node *that); -void frbgen_ldk_node_wire_NodeBase_update_channel_config(int64_t port_, - struct wire_cst_node_base *that, - struct wire_cst_user_channel_id *user_channel_id, +void frbgen_ldk_node_wire_ldk_node_total_onchain_balance_sats(int64_t port_, + struct wire_cst_ldk_node *that); + +void frbgen_ldk_node_wire_ldk_node_update_channel_config(int64_t port_, + struct wire_cst_ldk_node *that, + struct wire_cst_channel_id *channel_id, struct wire_cst_public_key *counterparty_node_id, struct wire_cst_channel_config *channel_config); -void frbgen_ldk_node_wire_NodeBase_verify_signature(int64_t port_, - struct wire_cst_node_base *that, +void frbgen_ldk_node_wire_ldk_node_verify_signature(int64_t port_, + struct wire_cst_ldk_node *that, struct wire_cst_list_prim_u_8_loose *msg, struct wire_cst_list_prim_u_8_strict *sig, struct wire_cst_public_key *pkey); -void frbgen_ldk_node_wire_NodeBase_wait_next_event(int64_t port_, struct wire_cst_node_base *that); +void frbgen_ldk_node_wire_ldk_node_wait_next_event(int64_t port_, struct wire_cst_ldk_node *that); + +void frbgen_ldk_node_wire_socket_address_as_string(int64_t port_, + struct wire_cst_socket_address *that); -void frbgen_ldk_node_wire_finalize_builder(int64_t port_, - struct wire_cst_config *config, - struct wire_cst_chain_data_source_config *chain_data_source_config, - struct wire_cst_entropy_source_config *entropy_source_config, - struct wire_cst_gossip_source_config *gossip_source_config, - struct wire_cst_liquidity_source_config *liquidity_source_config); +void frbgen_ldk_node_wire_socket_address_from_str(int64_t port_, + struct wire_cst_list_prim_u_8_strict *address); void frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore(const void *ptr); @@ -645,8 +471,6 @@ struct wire_cst_channel_config *frbgen_ldk_node_cst_new_box_autoadd_channel_conf struct wire_cst_channel_id *frbgen_ldk_node_cst_new_box_autoadd_channel_id(void); -struct wire_cst_closure_reason *frbgen_ldk_node_cst_new_box_autoadd_closure_reason(void); - struct wire_cst_config *frbgen_ldk_node_cst_new_box_autoadd_config(void); struct wire_cst_entropy_source_config *frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config(void); @@ -655,20 +479,14 @@ struct wire_cst_event *frbgen_ldk_node_cst_new_box_autoadd_event(void); struct wire_cst_gossip_source_config *frbgen_ldk_node_cst_new_box_autoadd_gossip_source_config(void); -struct wire_cst_liquidity_source_config *frbgen_ldk_node_cst_new_box_autoadd_liquidity_source_config(void); - -struct wire_cst_max_dust_htlc_exposure *frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure(void); - -struct wire_cst_mnemonic_base *frbgen_ldk_node_cst_new_box_autoadd_mnemonic_base(void); +struct wire_cst_ldk_mnemonic *frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic(void); -struct wire_cst_node_base *frbgen_ldk_node_cst_new_box_autoadd_node_base(void); +struct wire_cst_ldk_node *frbgen_ldk_node_cst_new_box_autoadd_ldk_node(void); struct wire_cst_out_point *frbgen_ldk_node_cst_new_box_autoadd_out_point(void); struct wire_cst_payment_details *frbgen_ldk_node_cst_new_box_autoadd_payment_details(void); -int32_t *frbgen_ldk_node_cst_new_box_autoadd_payment_failure_reason(int32_t value); - struct wire_cst_payment_hash *frbgen_ldk_node_cst_new_box_autoadd_payment_hash(void); struct wire_cst_payment_preimage *frbgen_ldk_node_cst_new_box_autoadd_payment_preimage(void); @@ -679,10 +497,6 @@ struct wire_cst_public_key *frbgen_ldk_node_cst_new_box_autoadd_public_key(void) struct wire_cst_socket_address *frbgen_ldk_node_cst_new_box_autoadd_socket_address(void); -struct wire_cst_txid *frbgen_ldk_node_cst_new_box_autoadd_txid(void); - -uint16_t *frbgen_ldk_node_cst_new_box_autoadd_u_16(uint16_t value); - uint32_t *frbgen_ldk_node_cst_new_box_autoadd_u_32(uint32_t value); uint64_t *frbgen_ldk_node_cst_new_box_autoadd_u_64(uint64_t value); @@ -691,14 +505,10 @@ struct wire_cst_user_channel_id *frbgen_ldk_node_cst_new_box_autoadd_user_channe struct wire_cst_list_channel_details *frbgen_ldk_node_cst_new_list_channel_details(int32_t len); -struct wire_cst_list_lightning_balance *frbgen_ldk_node_cst_new_list_lightning_balance(int32_t len); - struct wire_cst_list_payment_details *frbgen_ldk_node_cst_new_list_payment_details(int32_t len); struct wire_cst_list_peer_details *frbgen_ldk_node_cst_new_list_peer_details(int32_t len); -struct wire_cst_list_pending_sweep_balance *frbgen_ldk_node_cst_new_list_pending_sweep_balance(int32_t len); - struct wire_cst_list_prim_u_8_loose *frbgen_ldk_node_cst_new_list_prim_u_8_loose(int32_t len); struct wire_cst_list_prim_u_8_strict *frbgen_ldk_node_cst_new_list_prim_u_8_strict(int32_t len); @@ -713,79 +523,70 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_chain_data_source_config); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_channel_config); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_channel_id); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_closure_reason); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_config); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_entropy_source_config); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_event); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_gossip_source_config); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_liquidity_source_config); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_mnemonic_base); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_node_base); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_ldk_node); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_out_point); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_payment_details); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_payment_failure_reason); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_payment_hash); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_payment_preimage); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_payment_secret); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_public_key); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_socket_address); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_txid); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_u_16); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_u_32); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_u_64); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_box_autoadd_user_channel_id); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_channel_details); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_lightning_balance); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_payment_details); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_peer_details); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_pending_sweep_balance); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_prim_u_8_loose); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_prim_u_8_strict); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_public_key); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_cst_new_list_socket_address); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_decrement_strong_count_RustOpaque_NodeSqliteStore); dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_MnemonicBase_generate); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_close_channel); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_config); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_connect); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_connect_open_channel); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_disconnect); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_event_handled); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_list_balances); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_list_channels); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_list_payments); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_list_payments_with_filter); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_list_peers); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_listening_addresses); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_new_onchain_address); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_next_event); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_next_event_async); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_node_id); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_receive_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_receive_payment_via_jit_channel); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment_via_jit_channel); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_remove_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_all_to_onchain_address); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_payment_probes); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_payment_probes_using_amount); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_payment_using_amount); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment_probes); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_send_to_onchain_address); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_sign_message); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_start); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_status); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_stop); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_sync_wallets); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_update_channel_config); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_verify_signature); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_NodeBase_wait_next_event); - dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_finalize_builder); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_build_with_sqlite_store); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_mnemonic_generate); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_close_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_connect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_connect_open_channel); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_disconnect); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_event_handled); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_is_running); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_list_channels); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_list_payments); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_list_payments_with_filter); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_list_peers); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_listening_addresses); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_new_onchain_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_node_id); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_receive_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_receive_variable_amount_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_remove_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_all_to_onchain_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_payment_probes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_payment_probes_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_payment_using_amount); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_send_to_onchain_address); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_sign_message); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_spendable_onchain_balance_sats); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_start); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_stop); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_sync_wallets); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_total_onchain_balance_sats); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_update_channel_config); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_verify_signature); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_ldk_node_wait_next_event); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_socket_address_as_string); + dummy_var ^= ((int64_t) (void*) frbgen_ldk_node_wire_socket_address_from_str); dummy_var ^= ((int64_t) (void*) store_dart_post_cobject); return dummy_var; } diff --git a/lib/ldk_node.dart b/lib/ldk_node.dart index 1fa2c80..8bae749 100644 --- a/lib/ldk_node.dart +++ b/lib/ldk_node.dart @@ -25,4 +25,4 @@ export './src/generated/api/types.dart' EntropySourceConfig_SeedFile; export 'src/root.dart'; export 'src/utils/utils.dart' - hide ExceptionBase, mapBuilderError, mapNodeBaseError, Frb; + hide LdkException, mapBuilderException, mapNodeException, Frb; diff --git a/lib/src/generated/api/error.dart b/lib/src/generated/api/error.dart index 1bd5ddc..f9b1e46 100644 --- a/lib/src/generated/api/error.dart +++ b/lib/src/generated/api/error.dart @@ -1,12 +1,12 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; -enum BuilderError { +enum BuilderException { socketAddressParseError, /// The given seed bytes are invalid, e.g., have invalid length. @@ -22,7 +22,7 @@ enum BuilderError { invalidChannelMonitor, /// The given listening addresses are invalid, e.g. too many were passed. - invalidListeningAddresses, + invalidListeningAddress, /// We failed to read data from the [`KVStore`]. readFailed, @@ -41,9 +41,12 @@ enum BuilderError { /// We failed to setup the logger. loggerSetupFailed, + invalidTrustedPeer, } -enum NodeBaseError { +enum NodeException { + invalidTxid, + /// Returned when trying to start [Node] while it is already running. alreadyRunning, @@ -131,7 +134,4 @@ enum NodeBaseError { /// There are insufficient funds to complete the given operation. insufficientFunds, feerateEstimationUpdateFailed, - liquidityRequestFailed, - liquiditySourceUnavailable, - liquidityFeeTooHigh, } diff --git a/lib/src/generated/api/node.dart b/lib/src/generated/api/node.dart index aa6d743..20d548f 100644 --- a/lib/src/generated/api/node.dart +++ b/lib/src/generated/api/node.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import @@ -9,19 +9,17 @@ import 'package:collection/collection.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'types.dart'; -Future finalizeBuilder( +Future buildWithSqliteStore( {required Config config, ChainDataSourceConfig? chainDataSourceConfig, EntropySourceConfig? entropySourceConfig, GossipSourceConfig? gossipSourceConfig, - LiquiditySourceConfig? liquiditySourceConfig, dynamic hint}) => - LdkCore.instance.api.finalizeBuilder( + LdkCore.instance.api.buildWithSqliteStore( config: config, chainDataSourceConfig: chainDataSourceConfig, entropySourceConfig: entropySourceConfig, gossipSourceConfig: gossipSourceConfig, - liquiditySourceConfig: liquiditySourceConfig, hint: hint); // Rust type: RustOpaqueNom> @@ -43,15 +41,15 @@ class NodeSqliteStore extends RustOpaque { ); } -class MnemonicBase { +class LdkMnemonic { final String seedPhrase; - const MnemonicBase({ + const LdkMnemonic({ required this.seedPhrase, }); - static Future generate({dynamic hint}) => - LdkCore.instance.api.mnemonicBaseGenerate(hint: hint); + static Future generate({dynamic hint}) => + LdkCore.instance.api.ldkMnemonicGenerate(hint: hint); @override int get hashCode => seedPhrase.hashCode; @@ -59,305 +57,213 @@ class MnemonicBase { @override bool operator ==(Object other) => identical(this, other) || - other is MnemonicBase && + other is LdkMnemonic && runtimeType == other.runtimeType && seedPhrase == other.seedPhrase; } -class NodeBase { +class LdkNode { final NodeSqliteStore ptr; - const NodeBase({ + const LdkNode({ required this.ptr, }); Future closeChannel( - {required UserChannelId userChannelId, + {required ChannelId channelId, required PublicKey counterpartyNodeId, dynamic hint}) => - LdkCore.instance.api.nodeBaseCloseChannel( - that: this, - userChannelId: userChannelId, - counterpartyNodeId: counterpartyNodeId, - ); - - Future config({dynamic hint}) => LdkCore.instance.api.nodeBaseConfig( - that: this, - ); + LdkCore.instance.api.ldkNodeCloseChannel( + that: this, + channelId: channelId, + counterpartyNodeId: counterpartyNodeId, + hint: hint); Future connect( {required PublicKey nodeId, required SocketAddress address, required bool persist, dynamic hint}) => - LdkCore.instance.api.nodeBaseConnect( - that: this, - nodeId: nodeId, - address: address, - persist: persist, - ); - - Future connectOpenChannel( - {required SocketAddress address, + LdkCore.instance.api.ldkNodeConnect( + that: this, + nodeId: nodeId, + address: address, + persist: persist, + hint: hint); + + Future connectOpenChannel( + {required SocketAddress socketAddress, required PublicKey nodeId, required int channelAmountSats, int? pushToCounterpartyMsat, required bool announceChannel, ChannelConfig? channelConfig, dynamic hint}) => - LdkCore.instance.api.nodeBaseConnectOpenChannel( - that: this, - address: address, - nodeId: nodeId, - channelAmountSats: channelAmountSats, - pushToCounterpartyMsat: pushToCounterpartyMsat, - announceChannel: announceChannel, - channelConfig: channelConfig, - ); + LdkCore.instance.api.ldkNodeConnectOpenChannel( + that: this, + socketAddress: socketAddress, + nodeId: nodeId, + channelAmountSats: channelAmountSats, + pushToCounterpartyMsat: pushToCounterpartyMsat, + announceChannel: announceChannel, + channelConfig: channelConfig, + hint: hint); Future disconnect( {required PublicKey counterpartyNodeId, dynamic hint}) => - LdkCore.instance.api.nodeBaseDisconnect( - that: this, - counterpartyNodeId: counterpartyNodeId, - ); + LdkCore.instance.api.ldkNodeDisconnect( + that: this, counterpartyNodeId: counterpartyNodeId, hint: hint); Future eventHandled({dynamic hint}) => - LdkCore.instance.api.nodeBaseEventHandled( - that: this, - ); + LdkCore.instance.api.ldkNodeEventHandled(that: this, hint: hint); - Future listBalances({dynamic hint}) => - LdkCore.instance.api.nodeBaseListBalances( - that: this, - ); + Future isRunning({dynamic hint}) => + LdkCore.instance.api.ldkNodeIsRunning(that: this, hint: hint); Future> listChannels({dynamic hint}) => - LdkCore.instance.api.nodeBaseListChannels( - that: this, - ); + LdkCore.instance.api.ldkNodeListChannels(that: this, hint: hint); Future> listPayments({dynamic hint}) => - LdkCore.instance.api.nodeBaseListPayments( - that: this, - ); + LdkCore.instance.api.ldkNodeListPayments(that: this, hint: hint); Future> listPaymentsWithFilter( {required PaymentDirection paymentDirection, dynamic hint}) => - LdkCore.instance.api.nodeBaseListPaymentsWithFilter( - that: this, - paymentDirection: paymentDirection, - ); + LdkCore.instance.api.ldkNodeListPaymentsWithFilter( + that: this, paymentDirection: paymentDirection, hint: hint); Future> listPeers({dynamic hint}) => - LdkCore.instance.api.nodeBaseListPeers( - that: this, - ); + LdkCore.instance.api.ldkNodeListPeers(that: this, hint: hint); Future?> listeningAddresses({dynamic hint}) => - LdkCore.instance.api.nodeBaseListeningAddresses( - that: this, - ); + LdkCore.instance.api.ldkNodeListeningAddresses(that: this, hint: hint); Future
newOnchainAddress({dynamic hint}) => - LdkCore.instance.api.nodeBaseNewOnchainAddress( - that: this, - ); + LdkCore.instance.api.ldkNodeNewOnchainAddress(that: this, hint: hint); Future nextEvent({dynamic hint}) => - LdkCore.instance.api.nodeBaseNextEvent( - that: this, - ); - - Future nextEventAsync({dynamic hint}) => - LdkCore.instance.api.nodeBaseNextEventAsync( - that: this, - ); + LdkCore.instance.api.ldkNodeNextEvent(that: this, hint: hint); Future nodeId({dynamic hint}) => - LdkCore.instance.api.nodeBaseNodeId( - that: this, - ); + LdkCore.instance.api.ldkNodeNodeId(that: this, hint: hint); Future payment( {required PaymentHash paymentHash, dynamic hint}) => - LdkCore.instance.api.nodeBasePayment( - that: this, - paymentHash: paymentHash, - ); + LdkCore.instance.api + .ldkNodePayment(that: this, paymentHash: paymentHash, hint: hint); Future receivePayment( {required int amountMsat, required String description, required int expirySecs, dynamic hint}) => - LdkCore.instance.api.nodeBaseReceivePayment( - that: this, - amountMsat: amountMsat, - description: description, - expirySecs: expirySecs, - ); - - Future receivePaymentViaJitChannel( - {required int amountMsat, - required String description, - required int expirySecs, - int? maxTotalLspFeeLimitMsat, - dynamic hint}) => - LdkCore.instance.api.nodeBaseReceivePaymentViaJitChannel( - that: this, - amountMsat: amountMsat, - description: description, - expirySecs: expirySecs, - maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat, - ); + LdkCore.instance.api.ldkNodeReceivePayment( + that: this, + amountMsat: amountMsat, + description: description, + expirySecs: expirySecs, + hint: hint); Future receiveVariableAmountPayment( {required String description, required int expirySecs, dynamic hint}) => - LdkCore.instance.api.nodeBaseReceiveVariableAmountPayment( - that: this, - description: description, - expirySecs: expirySecs, - ); - - Future receiveVariableAmountPaymentViaJitChannel( - {required String description, - required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, - dynamic hint}) => - LdkCore.instance.api.nodeBaseReceiveVariableAmountPaymentViaJitChannel( - that: this, - description: description, - expirySecs: expirySecs, - maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat, - ); + LdkCore.instance.api.ldkNodeReceiveVariableAmountPayment( + that: this, + description: description, + expirySecs: expirySecs, + hint: hint); Future removePayment( {required PaymentHash paymentHash, dynamic hint}) => - LdkCore.instance.api.nodeBaseRemovePayment( - that: this, - paymentHash: paymentHash, - ); + LdkCore.instance.api.ldkNodeRemovePayment( + that: this, paymentHash: paymentHash, hint: hint); Future sendAllToOnchainAddress( {required Address address, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendAllToOnchainAddress( - that: this, - address: address, - ); + LdkCore.instance.api.ldkNodeSendAllToOnchainAddress( + that: this, address: address, hint: hint); Future sendPayment( {required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendPayment( - that: this, - invoice: invoice, - ); + LdkCore.instance.api + .ldkNodeSendPayment(that: this, invoice: invoice, hint: hint); Future sendPaymentProbes( {required Bolt11Invoice invoice, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendPaymentProbes( - that: this, - invoice: invoice, - ); + LdkCore.instance.api + .ldkNodeSendPaymentProbes(that: this, invoice: invoice, hint: hint); Future sendPaymentProbesUsingAmount( {required Bolt11Invoice invoice, required int amountMsat, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendPaymentProbesUsingAmount( - that: this, - invoice: invoice, - amountMsat: amountMsat, - ); + LdkCore.instance.api.ldkNodeSendPaymentProbesUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); Future sendPaymentUsingAmount( {required Bolt11Invoice invoice, required int amountMsat, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendPaymentUsingAmount( - that: this, - invoice: invoice, - amountMsat: amountMsat, - ); + LdkCore.instance.api.ldkNodeSendPaymentUsingAmount( + that: this, invoice: invoice, amountMsat: amountMsat, hint: hint); Future sendSpontaneousPayment( {required int amountMsat, required PublicKey nodeId, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendSpontaneousPayment( - that: this, - amountMsat: amountMsat, - nodeId: nodeId, - ); + LdkCore.instance.api.ldkNodeSendSpontaneousPayment( + that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); + ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. Future sendSpontaneousPaymentProbes( {required int amountMsat, required PublicKey nodeId, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendSpontaneousPaymentProbes( - that: this, - amountMsat: amountMsat, - nodeId: nodeId, - ); + LdkCore.instance.api.ldkNodeSendSpontaneousPaymentProbes( + that: this, amountMsat: amountMsat, nodeId: nodeId, hint: hint); Future sendToOnchainAddress( {required Address address, required int amountSats, dynamic hint}) => - LdkCore.instance.api.nodeBaseSendToOnchainAddress( - that: this, - address: address, - amountSats: amountSats, - ); + LdkCore.instance.api.ldkNodeSendToOnchainAddress( + that: this, address: address, amountSats: amountSats, hint: hint); Future signMessage({required List msg, dynamic hint}) => - LdkCore.instance.api.nodeBaseSignMessage( - that: this, - msg: msg, - ); + LdkCore.instance.api.ldkNodeSignMessage(that: this, msg: msg, hint: hint); - Future start({dynamic hint}) => LdkCore.instance.api.nodeBaseStart( - that: this, - ); + Future spendableOnchainBalanceSats({dynamic hint}) => + LdkCore.instance.api + .ldkNodeSpendableOnchainBalanceSats(that: this, hint: hint); - Future status({dynamic hint}) => - LdkCore.instance.api.nodeBaseStatus( - that: this, - ); + Future start({dynamic hint}) => + LdkCore.instance.api.ldkNodeStart(that: this, hint: hint); - Future stop({dynamic hint}) => LdkCore.instance.api.nodeBaseStop( - that: this, - ); + Future stop({dynamic hint}) => + LdkCore.instance.api.ldkNodeStop(that: this, hint: hint); Future syncWallets({dynamic hint}) => - LdkCore.instance.api.nodeBaseSyncWallets( - that: this, - ); + LdkCore.instance.api.ldkNodeSyncWallets(that: this, hint: hint); + + Future totalOnchainBalanceSats({dynamic hint}) => LdkCore.instance.api + .ldkNodeTotalOnchainBalanceSats(that: this, hint: hint); Future updateChannelConfig( - {required UserChannelId userChannelId, + {required ChannelId channelId, required PublicKey counterpartyNodeId, required ChannelConfig channelConfig, dynamic hint}) => - LdkCore.instance.api.nodeBaseUpdateChannelConfig( - that: this, - userChannelId: userChannelId, - counterpartyNodeId: counterpartyNodeId, - channelConfig: channelConfig, - ); + LdkCore.instance.api.ldkNodeUpdateChannelConfig( + that: this, + channelId: channelId, + counterpartyNodeId: counterpartyNodeId, + channelConfig: channelConfig, + hint: hint); Future verifySignature( {required List msg, required String sig, required PublicKey pkey, dynamic hint}) => - LdkCore.instance.api.nodeBaseVerifySignature( - that: this, - msg: msg, - sig: sig, - pkey: pkey, - ); + LdkCore.instance.api.ldkNodeVerifySignature( + that: this, msg: msg, sig: sig, pkey: pkey, hint: hint); Future waitNextEvent({dynamic hint}) => - LdkCore.instance.api.nodeBaseWaitNextEvent( - that: this, - ); + LdkCore.instance.api.ldkNodeWaitNextEvent(that: this, hint: hint); @override int get hashCode => ptr.hashCode; @@ -365,7 +271,7 @@ class NodeBase { @override bool operator ==(Object other) => identical(this, other) || - other is NodeBase && runtimeType == other.runtimeType && ptr == other.ptr; + other is LdkNode && runtimeType == other.runtimeType && ptr == other.ptr; } class U8Array12 extends NonGrowableListView { diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index c8a193f..412aae8 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -1,9 +1,10 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import import '../frb_generated.dart'; +import 'error.dart'; import 'node.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; @@ -27,91 +28,6 @@ class Address { other is Address && runtimeType == other.runtimeType && s == other.s; } -/// Details of the known available balances returned by [`Node::list_balances`]. -/// -/// [`Node::list_balances`]: crate::Node::list_balances -class BalanceDetails { - /// The total balance of our on-chain wallet. - final int totalOnchainBalanceSats; - - /// The currently spendable balance of our on-chain wallet. - final int spendableOnchainBalanceSats; - - /// The total balance that we would be able to claim across all our Lightning channels. - /// - /// Note this excludes balances that we are unsure if we are able to claim (e.g., as we are - final int totalLightningBalanceSats; - - /// A detailed list of all known Lightning balances that would be claimable on channel closure. - /// - /// Note that less than the listed amounts are spendable over lightning as further reserve - /// restrictions apply. - final List lightningBalances; - - /// A detailed list of balances currently being swept from the Lightning to the on-chain - /// wallet. - /// - /// These are balances resulting from channel closures that may have been encumbered by a - /// delay, but are now being claimed and useable once sufficiently confirmed on-chain. - /// - /// Note that, depending on the sync status of the wallets, swept balances listed here might or - /// might not already be accounted for in `totalOnchainBalanceSats`. - final List pendingBalancesFromChannelClosures; - - const BalanceDetails({ - required this.totalOnchainBalanceSats, - required this.spendableOnchainBalanceSats, - required this.totalLightningBalanceSats, - required this.lightningBalances, - required this.pendingBalancesFromChannelClosures, - }); - - @override - int get hashCode => - totalOnchainBalanceSats.hashCode ^ - spendableOnchainBalanceSats.hashCode ^ - totalLightningBalanceSats.hashCode ^ - lightningBalances.hashCode ^ - pendingBalancesFromChannelClosures.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BalanceDetails && - runtimeType == other.runtimeType && - totalOnchainBalanceSats == other.totalOnchainBalanceSats && - spendableOnchainBalanceSats == other.spendableOnchainBalanceSats && - totalLightningBalanceSats == other.totalLightningBalanceSats && - lightningBalances == other.lightningBalances && - pendingBalancesFromChannelClosures == - other.pendingBalancesFromChannelClosures; -} - -/// The best known block as identified by its hash and height. -class BestBlock { - /// The block's hash - final String blockHash; - - /// The height at which the block was confirmed. - final int height; - - const BestBlock({ - required this.blockHash, - required this.height, - }); - - @override - int get hashCode => blockHash.hashCode ^ height.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BestBlock && - runtimeType == other.runtimeType && - blockHash == other.blockHash && - height == other.height; -} - ///Represents a syntactically and semantically correct lightning BOLT11 invoice. /// class Bolt11Invoice { @@ -134,6 +50,8 @@ class Bolt11Invoice { @freezed sealed class ChainDataSourceConfig with _$ChainDataSourceConfig { + const ChainDataSourceConfig._(); + const factory ChainDataSourceConfig.esplora( String field0, ) = ChainDataSourceConfig_Esplora; @@ -161,7 +79,7 @@ class ChannelConfig { final int cltvExpiryDelta; /// Options for how to set the max dust HTLC exposure allowed on a channel. - final MaxDustHTLCExposure? maxDustHtlcExposure; + final MaxDustHTLCExposure maxDustHtlcExposure; ///The additional fee we’re willing to pay to avoid waiting for the counterparty’s toSelfDelay to reclaim funds. /// @@ -175,13 +93,15 @@ class ChannelConfig { final int forceCloseAvoidanceMaxFeeSatoshis; ///If set, allows this channel's counterparty to skim an additional fee off this node's inbound HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. + /// Usage: + /// The payee will set this option and set its invoice route hints to use intercept scids generated by this channel's counterparty. final bool acceptUnderpayingHtlcs; const ChannelConfig({ required this.forwardingFeeProportionalMillionths, required this.forwardingFeeBaseMsat, required this.cltvExpiryDelta, - this.maxDustHtlcExposure, + required this.maxDustHtlcExposure, required this.forceCloseAvoidanceMaxFeeSatoshis, required this.acceptUnderpayingHtlcs, }); @@ -210,145 +130,117 @@ class ChannelConfig { acceptUnderpayingHtlcs == other.acceptUnderpayingHtlcs; } +/// Details of a channel, as returned by node.listChannels() +/// class ChannelDetails { - /// The channel ID (prior to funding transaction generation, this is a random 32-byte - /// identifier, afterwards this is the transaction ID of the funding transaction XOR the - /// funding transaction output). - /// + /// The channel's ID (prior to funding transaction generation, this is a random 32 bytes, + /// thereafter this is the txid of the funding transaction xor the funding transaction output). /// Note that this means this value is *not* persistent - it can change once during the /// lifetime of the channel. + /// final ChannelId channelId; - /// The node ID of our the channel's counterparty. + ///The node ID of our the channel’s counterparty. final PublicKey counterpartyNodeId; - /// The channel's funding transaction output, if we've negotiated the funding transaction with + /// The Channel's funding transaction output, if we've negotiated the funding transaction with /// our counterparty already. - final OutPoint? fundingTxo; + /// + final String? fundingTxo; - /// The value, in satoshis, of this channel as it appears in the funding output. + ///The value, in satoshis, of this channel as it appears in the funding output. final int channelValueSats; - /// The value, in satoshis, that must always be held as a reserve in the channel for us. This - /// value ensures that if we broadcast a revoked state, our counterparty can punish us by - /// claiming at least this value on chain. + /// The value, in satoshis, that must always be held in the channel for us. This value ensures + /// that if we broadcast a revoked state, our counterparty can punish us by claiming at least + /// this value on chain. /// - /// This value is not included in `outboundCapacityMsat` as it can never be spent. + /// This value is not included in `outbound_capacity_msat` as it can never be spent. /// - /// This value will be `None` for outbound channels until the counterparty accepts the channel. + /// This value will be null for outbound channels until the counterparty accepts the channel. /// final int? unspendablePunishmentReserve; - /// The local `user_channel_id` of this channel. + /// The userChannelId passed in to create_channel, or a random value if the channel was + /// inbound. This may be zero for inbound channels serialized with LDK versions prior to + /// 0.0.113. + /// final UserChannelId userChannelId; /// The currently negotiated fee rate denominated in satoshi per 1000 weight units, /// which is applied to commitment and HTLC transactions. + /// + /// This value will be null for objects serialized with LDK versions prior to 0.0.115. + /// final int feerateSatPer1000Weight; - /// The available outbound capacity for sending HTLCs to the remote peer. + /// Our total balance. This is the amount we would get if we close the channel. + /// This value is not exact. Due to various in-flight changes and feerate changes, exactly this + /// amount is not likely to be recoverable on close. /// - /// The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose + /// This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose /// balance is not available for inclusion in new outbound HTLCs). This further does not include /// any pending outgoing HTLCs which are awaiting some other resolution to be sent. + /// This does not consider any on-chain fees. + /// + final int balanceMsat; + + /// The available outbound capacity for sending HTLCs to the remote peer. This does not include + /// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + /// available for inclusion in new outbound HTLCs). This further does not include any pending + /// outgoing HTLCs which are awaiting some other resolution to be sent. + /// + /// This value is not exact. Due to various in-flight changes, feerate changes, and our + /// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we + /// should be able to spend nearly this amount. + /// final int outboundCapacityMsat; - /// The available outbound capacity for sending HTLCs to the remote peer. + /// The available inbound capacity for the remote peer to send HTLCs to us. This does not + /// include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + /// available for inclusion in new inbound HTLCs). + /// Note that there are some corner cases not fully handled here, so the actual available + /// inbound capacity may be slightly higher than this. + /// + /// This value is not exact. Due to various in-flight changes, feerate changes, and our + /// counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable. + /// However, our counterparty should be able to spend nearly this amount. /// - /// The amount does not include any pending HTLCs which are not yet resolved - /// (and, thus, whose balance is not available for inclusion in new inbound HTLCs). This further - /// does not include any pending outgoing HTLCs which are awaiting some other resolution to be - /// sent. final int inboundCapacityMsat; - /// The number of required confirmations on the funding transactions before the funding is - /// considered "locked". The amount is selected by the channel fundee. + /// The number of required confirmations on the funding transaction before the funding will be + /// considered "locked". This number is selected by the channel fundee, and can be selected for inbound channels with + /// This value will be null for outbound channels until the counterparty accepts the channel. /// - /// The value will be `None` for outbound channels until the counterparty accepts the channel. final int? confirmationsRequired; /// The current number of confirmations on the funding transaction. + /// + /// This value will be `None` for objects serialized with LDK versions prior to 0.0.113. + /// final int? confirmations; - /// Returns `true` if the channel was initiated (and therefore funded) by us. + /// True if the channel was initiated (and thus funded) by us. + /// final bool isOutbound; - /// Returns `true` if both parties have exchanged `channel_ready` messages, and the channel is - /// not currently being shut down. Both parties exchange `channel_ready` messages upon - /// independently verifying that the required confirmations count provided by - /// `confirmations_required` has been reached. - final bool isChannelReady; - - /// Returns `true` if the channel (a) `channel_ready` messages have been exchanged, (b) the - /// peer is connected, and (c) the channel is not currently negotiating shutdown. + /// True if the channel is confirmed, channelReady messages have been exchanged, and the + /// channel is not currently being shut down. `channelReady` message exchange implies the + /// required confirmation count has been reached (and we were connected to the peer at some + /// point after the funding transaction received enough confirmations). The required /// - /// This is a strict superset of `is_channel_ready`. - final bool isUsable; - - /// Returns `true` if this channel is (or will be) publicly-announced - final bool isPublic; - - /// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over - /// the channel. - final int? cltvExpiryDelta; + final bool isChannelReady; - /// The value, in satoshis, that must always be held in the channel for our counterparty. This - /// value ensures that if our counterparty broadcasts a revoked state, we can punish them by - /// claiming at least this value on chain. + /// True if the channel is (a) confirmed and channelReady messages have been exchanged, (b) + /// the peer is connected, and (c) the channel is not currently negotiating a shutdown. /// - /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + /// This is a strict superset of `isChannelReady`. /// - /// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat - final int counterpartyUnspendablePunishmentReserve; + final bool isUsable; - /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. + /// True if this channel is (or will be) publicly-announced. /// - /// This field is only `None` before we have received either the `OpenChannel` or - /// `AcceptChannel` message from the remote peer. - final int? counterpartyOutboundHtlcMinimumMsat; - - /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel. - final int? counterpartyOutboundHtlcMaximumMsat; - - /// Base routing fee in millisatoshis. - final int? counterpartyForwardingInfoFeeBaseMsat; - - /// Proportional fee, in millionths of a satoshi the channel will charge per transferred satoshi. - final int? counterpartyForwardingInfoFeeProportionalMillionths; - - /// The minimum difference in CLTV expiry between an ingoing HTLC and its outgoing counterpart, - /// such that the outgoing HTLC is forwardable to this counterparty. - final int? counterpartyForwardingInfoCltvExpiryDelta; - - /// The available outbound capacity for sending a single HTLC to the remote peer. This is - /// similar to `channelDetails.outboundCapacityMsat` but it may be further restricted by - /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us - /// to use a limit as close as possible to the HTLC limit we can currently send. - final int nextOutboundHtlcLimitMsat; - - /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of - /// `channelDetails.nextOutboundHtlcLimitMsat` but represents a lower-bound, rather than - /// an upper-bound. This is intended for use when routing, allowing us to ensure we pick a - /// route which is valid. - final int nextOutboundHtlcMinimumMsat; - - /// The number of blocks (after our commitment transaction confirms) that we will need to wait - /// until we can claim our funds after we force-close the channel. During this time our - /// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty - /// force-closes the channel and broadcasts a commitment transaction we do not have to wait any - /// time to claim our non-HTLC-encumbered funds. - /// - /// This value will be `None` for outbound channels until the counterparty accepts the channel. - final int? forceCloseSpendDelay; - - /// The smallest value HTLC (in msat) we will accept, for this channel. - final int inboundHtlcMinimumMsat; - - /// The largest value HTLC (in msat) we currently will accept, for this channel. - final int? inboundHtlcMaximumMsat; - - /// Set of configurable parameters that affect channel operation. - final ChannelConfig config; + final bool isPublic; const ChannelDetails({ required this.channelId, @@ -358,6 +250,7 @@ class ChannelDetails { this.unspendablePunishmentReserve, required this.userChannelId, required this.feerateSatPer1000Weight, + required this.balanceMsat, required this.outboundCapacityMsat, required this.inboundCapacityMsat, this.confirmationsRequired, @@ -366,19 +259,6 @@ class ChannelDetails { required this.isChannelReady, required this.isUsable, required this.isPublic, - this.cltvExpiryDelta, - required this.counterpartyUnspendablePunishmentReserve, - this.counterpartyOutboundHtlcMinimumMsat, - this.counterpartyOutboundHtlcMaximumMsat, - this.counterpartyForwardingInfoFeeBaseMsat, - this.counterpartyForwardingInfoFeeProportionalMillionths, - this.counterpartyForwardingInfoCltvExpiryDelta, - required this.nextOutboundHtlcLimitMsat, - required this.nextOutboundHtlcMinimumMsat, - this.forceCloseSpendDelay, - required this.inboundHtlcMinimumMsat, - this.inboundHtlcMaximumMsat, - required this.config, }); @override @@ -390,6 +270,7 @@ class ChannelDetails { unspendablePunishmentReserve.hashCode ^ userChannelId.hashCode ^ feerateSatPer1000Weight.hashCode ^ + balanceMsat.hashCode ^ outboundCapacityMsat.hashCode ^ inboundCapacityMsat.hashCode ^ confirmationsRequired.hashCode ^ @@ -397,20 +278,7 @@ class ChannelDetails { isOutbound.hashCode ^ isChannelReady.hashCode ^ isUsable.hashCode ^ - isPublic.hashCode ^ - cltvExpiryDelta.hashCode ^ - counterpartyUnspendablePunishmentReserve.hashCode ^ - counterpartyOutboundHtlcMinimumMsat.hashCode ^ - counterpartyOutboundHtlcMaximumMsat.hashCode ^ - counterpartyForwardingInfoFeeBaseMsat.hashCode ^ - counterpartyForwardingInfoFeeProportionalMillionths.hashCode ^ - counterpartyForwardingInfoCltvExpiryDelta.hashCode ^ - nextOutboundHtlcLimitMsat.hashCode ^ - nextOutboundHtlcMinimumMsat.hashCode ^ - forceCloseSpendDelay.hashCode ^ - inboundHtlcMinimumMsat.hashCode ^ - inboundHtlcMaximumMsat.hashCode ^ - config.hashCode; + isPublic.hashCode; @override bool operator ==(Object other) => @@ -424,6 +292,7 @@ class ChannelDetails { unspendablePunishmentReserve == other.unspendablePunishmentReserve && userChannelId == other.userChannelId && feerateSatPer1000Weight == other.feerateSatPer1000Weight && + balanceMsat == other.balanceMsat && outboundCapacityMsat == other.outboundCapacityMsat && inboundCapacityMsat == other.inboundCapacityMsat && confirmationsRequired == other.confirmationsRequired && @@ -431,26 +300,7 @@ class ChannelDetails { isOutbound == other.isOutbound && isChannelReady == other.isChannelReady && isUsable == other.isUsable && - isPublic == other.isPublic && - cltvExpiryDelta == other.cltvExpiryDelta && - counterpartyUnspendablePunishmentReserve == - other.counterpartyUnspendablePunishmentReserve && - counterpartyOutboundHtlcMinimumMsat == - other.counterpartyOutboundHtlcMinimumMsat && - counterpartyOutboundHtlcMaximumMsat == - other.counterpartyOutboundHtlcMaximumMsat && - counterpartyForwardingInfoFeeBaseMsat == - other.counterpartyForwardingInfoFeeBaseMsat && - counterpartyForwardingInfoFeeProportionalMillionths == - other.counterpartyForwardingInfoFeeProportionalMillionths && - counterpartyForwardingInfoCltvExpiryDelta == - other.counterpartyForwardingInfoCltvExpiryDelta && - nextOutboundHtlcLimitMsat == other.nextOutboundHtlcLimitMsat && - nextOutboundHtlcMinimumMsat == other.nextOutboundHtlcMinimumMsat && - forceCloseSpendDelay == other.forceCloseSpendDelay && - inboundHtlcMinimumMsat == other.inboundHtlcMinimumMsat && - inboundHtlcMaximumMsat == other.inboundHtlcMaximumMsat && - config == other.config; + isPublic == other.isPublic; } /// The global identifier of a channel. @@ -477,77 +327,6 @@ class ChannelId { data == other.data; } -@freezed -sealed class ClosureReason with _$ClosureReason { - /// Closure generated from receiving a peer error message. - /// - /// Our counterparty may have broadcasted their latest commitment state, and we have - /// as well. - const factory ClosureReason.counterpartyForceClosed({ - /// The error which the peer sent us. - /// - /// Be careful about printing the peer_msg, a well-crafted message could exploit - /// a security vulnerability in the terminal emulator or the logging subsystem. - /// To be safe, use `Display` on `UntrustedString` - /// - /// [`UntrustedString`]: crate::util::string::UntrustedString - required String peerMsg, - }) = ClosureReason_CounterpartyForceClosed; - - /// Closure generated from `ChannelManager.force_close_channel`, called by the user. - /// - const factory ClosureReason.holderForceClosed() = - ClosureReason_HolderForceClosed; - - /// The channel was closed after negotiating a cooperative close and we've now broadcasted - /// the cooperative close transaction. Note the shutdown may have been initiated by us. - const factory ClosureReason.cooperativeClosure() = - ClosureReason_CooperativeClosure; - - /// A commitment transaction was confirmed on chain, closing the channel. Most likely this - /// commitment transaction came from our counterparty, but it may also have come from - /// a copy of our own `ChannelMonitor`. - const factory ClosureReason.commitmentTxConfirmed() = - ClosureReason_CommitmentTxConfirmed; - - /// The funding transaction failed to confirm in a timely manner on an inbound channel. - const factory ClosureReason.fundingTimedOut() = ClosureReason_FundingTimedOut; - - /// Closure generated from processing an event, likely a HTLC forward/relay/reception. - const factory ClosureReason.processingError({ - /// A developer-readable error message which we generated. - required String err, - }) = ClosureReason_ProcessingError; - - /// The peer disconnected prior to funding completing. In this case the spec mandates that we - /// forget the channel entirely - we can attempt again if the peer reconnects. - /// - /// This includes cases where we restarted prior to funding completion, including prior to the - /// initial `ChannelMonitor` persistence completing. - /// - /// In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the - /// peer because of mutual incompatibility between us and our channel counterparty. - /// - const factory ClosureReason.disconnectedPeer() = - ClosureReason_DisconnectedPeer; - - /// Closure generated from `channelManager.read` if the `ChannelMonitor` is newer than - /// the `ChannelManager` deserialized. - /// - const factory ClosureReason.outdatedChannelManager() = - ClosureReason_OutdatedChannelManager; - - /// The counterparty requested a cooperative close of a channel that had not been funded yet. - /// The channel has been immediately closed. - const factory ClosureReason.counterpartyCoopClosedUnfundedChannel() = - ClosureReason_CounterpartyCoopClosedUnfundedChannel; - - /// Another channel in the same funding batch closed before the funding transaction - /// was ready to be broadcast. - const factory ClosureReason.fundingBatchClosure() = - ClosureReason_FundingBatchClosure; -} - /// Represents the configuration of an [Node] instance. /// class Config { @@ -642,6 +421,8 @@ class Config { @freezed sealed class EntropySourceConfig with _$EntropySourceConfig { + const EntropySourceConfig._(); + const factory EntropySourceConfig.seedFile( String field0, ) = EntropySourceConfig_SeedFile; @@ -649,31 +430,25 @@ sealed class EntropySourceConfig with _$EntropySourceConfig { U8Array64 field0, ) = EntropySourceConfig_SeedBytes; const factory EntropySourceConfig.bip39Mnemonic({ - required MnemonicBase mnemonic, + required LdkMnemonic mnemonic, String? passphrase, }) = EntropySourceConfig_Bip39Mnemonic; } @freezed sealed class Event with _$Event { + const Event._(); + /// A sent payment was successful. const factory Event.paymentSuccessful({ /// The hash of the payment. required PaymentHash paymentHash, - - /// The total fee which was spent at intermediate hops in this payment. - int? feePaidMsat, }) = Event_PaymentSuccessful; /// A sent payment has failed. const factory Event.paymentFailed({ /// The hash of the payment. required PaymentHash paymentHash, - - /// The reason why the payment failed. - /// - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - PaymentFailureReason? reason, }) = Event_PaymentFailed; /// A payment has been received. @@ -685,207 +460,53 @@ sealed class Event with _$Event { required int amountMsat, }) = Event_PaymentReceived; - /// A channel has been created and is pending confirmation on-chain. - const factory Event.channelPending({ - /// The `channel_id` of the channel. - required ChannelId channelId, - - /// The `user_channel_id` of the channel. - required UserChannelId userChannelId, - - /// The `temporary_channel_id` this channel used to be known by during channel establishment. - required ChannelId formerTemporaryChannelId, - - /// The `node_id` of the channel counterparty. - required PublicKey counterpartyNodeId, - - /// The outpoint of the channel's funding transaction. - required OutPoint fundingTxo, - }) = Event_ChannelPending; - /// A channel is ready to be used. const factory Event.channelReady({ - /// The `channel_id` of the channel. + /// The channel_id of the channel. required ChannelId channelId, - /// The `user_channel_id` of the channel. + /// The user_channel_id of the channel. required UserChannelId userChannelId, - - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. PublicKey? counterpartyNodeId, }) = Event_ChannelReady; /// A channel has been closed. const factory Event.channelClosed({ - /// The `channel_id` of the channel. + /// The channel_id of the channel. required ChannelId channelId, - /// The `user_channel_id` of the channel. + /// The user_channel_id of the channel. required UserChannelId userChannelId, - - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. PublicKey? counterpartyNodeId, - - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - ClosureReason? reason, }) = Event_ChannelClosed; -} - -@freezed -sealed class GossipSourceConfig with _$GossipSourceConfig { - const factory GossipSourceConfig.p2PNetwork() = GossipSourceConfig_P2PNetwork; - const factory GossipSourceConfig.rapidGossipSync( - String field0, - ) = GossipSourceConfig_RapidGossipSync; -} -@freezed -sealed class LightningBalance with _$LightningBalance { - /// The channel is not yet closed (or the commitment or closing transaction has not yet - /// appeared in a block). The given balance is claimable (less on-chain fees) if the channel is - /// force-closed now. - const factory LightningBalance.claimableOnChannelClose({ - /// The identifier of the channel this balance belongs to. - required ChannelId channelId, - - /// The identifier of our channel counterparty. - required PublicKey counterpartyNodeId, - - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - required int amountSatoshis, - }) = LightningBalance_ClaimableOnChannelClose; - - /// The channel has been closed, and the given balance is ours but awaiting confirmations until - /// we consider it spendable. - const factory LightningBalance.claimableAwaitingConfirmations({ - /// The identifier of the channel this balance belongs to. - required ChannelId channelId, - - /// The identifier of our channel counterparty. - required PublicKey counterpartyNodeId, - - /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which - /// were spent in broadcasting the transaction. - required int amountSatoshis, - - /// The height at which an [`Event::SpendableOutputs`] event will be generated for this - /// amount. - /// - /// [`Event::SpendableOutputs`]: lightning::events::Event::SpendableOutputs - required int confirmationHeight, - }) = LightningBalance_ClaimableAwaitingConfirmations; - - /// The channel has been closed, and the given balance should be ours but awaiting spending - /// transaction confirmation. If the spending transaction does not confirm in time, it is - /// possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain. - /// - /// Once the spending transaction confirms, before it has reached enough confirmations to be - /// considered safe from chain reorganizations, the balance will instead be provided via - /// `lightningBalance.claimableAwaitingConfirmations`. - const factory LightningBalance.contentiousClaimable({ - /// The identifier of the channel this balance belongs to. - required ChannelId channelId, - - /// The identifier of our channel counterparty. - required PublicKey counterpartyNodeId, - - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - required int amountSatoshis, - - /// The height at which the counterparty may be able to claim the balance if we have not - /// done so. - required int timeoutHeight, - - /// The payment hash that locks this HTLC. - required PaymentHash paymentHash, - - /// The preimage that can be used to claim this HTLC. - required PaymentPreimage paymentPreimage, - }) = LightningBalance_ContentiousClaimable; - - /// HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain - /// fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat - /// likely to be claimed by our counterparty before we do. - const factory LightningBalance.maybeTimeoutClaimableHtlc({ - /// The identifier of the channel this balance belongs to. - required ChannelId channelId, - - /// The identifier of our channel counterparty. - required PublicKey counterpartyNodeId, - - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - required int amountSatoshis, - - /// The height at which we will be able to claim the balance if our counterparty has not - /// done so. - required int claimableHeight, - - /// The payment hash whose preimage our counterparty needs to claim this HTLC. - required PaymentHash paymentHash, - }) = LightningBalance_MaybeTimeoutClaimableHTLC; - - /// HTLCs which we received from our counterparty which are claimable with a preimage which we - /// do not currently have. This will only be claimable if we receive the preimage from the node - /// to which we forwarded this HTLC before the timeout. - const factory LightningBalance.maybePreimageClaimableHtlc({ - /// The identifier of the channel this balance belongs to. + /// A channel has been created and is pending confirmation on-chain. + const factory Event.channelPending({ + /// The channel_id of the channel. required ChannelId channelId, - /// The identifier of our channel counterparty. - required PublicKey counterpartyNodeId, - - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - required int amountSatoshis, - - /// The height at which our counterparty will be able to claim the balance if we have not - /// yet received the preimage and claimed it ourselves. - required int expiryHeight, - - /// The payment hash whose preimage we need to claim this HTLC. - required PaymentHash paymentHash, - }) = LightningBalance_MaybePreimageClaimableHTLC; + /// The user_channel_id of the channel. + required UserChannelId userChannelId, - /// The channel has been closed, and our counterparty broadcasted a revoked commitment - /// transaction. - /// - /// Thus, we're able to claim all outputs in the commitment transaction, one of which has the - /// following amount. - const factory LightningBalance.counterpartyRevokedOutputClaimable({ - /// The identifier of the channel this balance belongs to. - required ChannelId channelId, + /// The temporary_channel_id this channel used to be known by during channel establishment. + required ChannelId formerTemporaryChannelId, - /// The identifier of our channel counterparty. + /// The node_id of the channel counterparty. required PublicKey counterpartyNodeId, - /// The amount, in satoshis, of the output which we can claim. - required int amountSatoshis, - }) = LightningBalance_CounterpartyRevokedOutputClaimable; + /// The outpoint of the channel's funding transaction. + required OutPoint fundingTxo, + }) = Event_ChannelPending; } -class LiquiditySourceConfig { - final (SocketAddress, PublicKey, String?) lsps2Service; - - const LiquiditySourceConfig({ - required this.lsps2Service, - }); - - @override - int get hashCode => lsps2Service.hashCode; +@freezed +sealed class GossipSourceConfig with _$GossipSourceConfig { + const GossipSourceConfig._(); - @override - bool operator ==(Object other) => - identical(this, other) || - other is LiquiditySourceConfig && - runtimeType == other.runtimeType && - lsps2Service == other.lsps2Service; + const factory GossipSourceConfig.p2PNetwork() = GossipSourceConfig_P2PNetwork; + const factory GossipSourceConfig.rapidGossipSync( + String field0, + ) = GossipSourceConfig_RapidGossipSync; } /// An enum representing the available verbosity levels of the logger. @@ -918,6 +539,8 @@ enum LogLevel { @freezed sealed class MaxDustHTLCExposure with _$MaxDustHTLCExposure { + const MaxDustHTLCExposure._(); + ///This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this limit is very important to prevent stealing of large amounts of dust HTLCs by miners through fee griefing attacks. const factory MaxDustHTLCExposure.fixedLimitMsat( int field0, @@ -949,88 +572,6 @@ enum Network { regtest, } -/// Represents the status of the [Node]. -class NodeStatus { - /// Indicates whether the [Node] is running. - final bool isRunning; - - /// Indicates whether the [Node] is listening for incoming connections on the addresses - /// configured via `config.listeningAddresses`. - final bool isListening; - - /// The best block to which our Lightning wallet is currently synced. - final BestBlock currentBestBlock; - - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced - /// our Lightning wallet to the chain tip. - /// - /// Will be `None` if the wallet hasn't been synced since the [Node] was initialized. - final int? latestWalletSyncTimestamp; - - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced - /// our on-chain wallet to the chain tip. - /// - /// Will be `None` if the wallet hasn't been synced since the [Node] was initialized. - final int? latestOnchainWalletSyncTimestamp; - - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully update - /// our fee rate cache. - /// - /// Will be `None` if the cache hasn't been updated since the [Node] was initialized. - final int? latestFeeRateCacheUpdateTimestamp; - - /// The timestamp, in seconds since start of the UNIX epoch, when the last rapid gossip sync - /// (RGS) snapshot we successfully applied was generated. - /// - /// Will be `None` if RGS isn't configured or the snapshot hasn't been updated since the [Node] was initialized. - final int? latestRgsSnapshotTimestamp; - - /// The timestamp, in seconds since start of the UNIX epoch, when we last broadcasted a node - /// announcement. - /// - /// Will be `None` if we have no public channels or we haven't broadcasted since the [Node] was initialized. - final int? latestNodeAnnouncementBroadcastTimestamp; - - const NodeStatus({ - required this.isRunning, - required this.isListening, - required this.currentBestBlock, - this.latestWalletSyncTimestamp, - this.latestOnchainWalletSyncTimestamp, - this.latestFeeRateCacheUpdateTimestamp, - this.latestRgsSnapshotTimestamp, - this.latestNodeAnnouncementBroadcastTimestamp, - }); - - @override - int get hashCode => - isRunning.hashCode ^ - isListening.hashCode ^ - currentBestBlock.hashCode ^ - latestWalletSyncTimestamp.hashCode ^ - latestOnchainWalletSyncTimestamp.hashCode ^ - latestFeeRateCacheUpdateTimestamp.hashCode ^ - latestRgsSnapshotTimestamp.hashCode ^ - latestNodeAnnouncementBroadcastTimestamp.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is NodeStatus && - runtimeType == other.runtimeType && - isRunning == other.isRunning && - isListening == other.isListening && - currentBestBlock == other.currentBestBlock && - latestWalletSyncTimestamp == other.latestWalletSyncTimestamp && - latestOnchainWalletSyncTimestamp == - other.latestOnchainWalletSyncTimestamp && - latestFeeRateCacheUpdateTimestamp == - other.latestFeeRateCacheUpdateTimestamp && - latestRgsSnapshotTimestamp == other.latestRgsSnapshotTimestamp && - latestNodeAnnouncementBroadcastTimestamp == - other.latestNodeAnnouncementBroadcastTimestamp; -} - ///A reference to a transaction output. /// class OutPoint { @@ -1116,33 +657,6 @@ enum PaymentDirection { outbound, } -/// The reason the payment failed. Used in `Event.PaymentFailed`. -enum PaymentFailureReason { - /// The intended recipient rejected our payment. - recipientRejected, - - /// The user chose to abandon this payment by calling `channelManager.abandon_payment`. - /// - userAbandoned, - - /// We exhausted all of our retry attempts while trying to send the payment, or we - /// exhausted the `Retry.Timeout` if the user set one. If at any point a retry - /// attempt failed while being forwarded along the path, an `Event::PaymentPathFailed` will - /// have come before this. - /// - retriesExhausted, - - /// The payment expired while retrying, based on the provided - paymentExpired, - - /// We failed to find a route while retrying the payment. - routeNotFound, - - /// This error should generally never happen. This likely means that there is a problem with - /// your router. - unexpectedError, -} - /// paymentHash type, use to cross-lock hop /// class PaymentHash { @@ -1250,79 +764,30 @@ class PeerDetails { isConnected == other.isConnected; } -@freezed -sealed class PendingSweepBalance with _$PendingSweepBalance { - /// The spendable output is about to be swept, but a spending transaction has yet to be generated and - /// broadcast. - const factory PendingSweepBalance.pendingBroadcast({ - /// The identifier of the channel this balance belongs to. - ChannelId? channelId, - - /// The amount, in satoshis, of the output being swept. - required int amountSatoshis, - }) = PendingSweepBalance_PendingBroadcast; - - /// A spending transaction has been generated and broadcast and is awaiting confirmation - /// on-chain. - const factory PendingSweepBalance.broadcastAwaitingConfirmation({ - /// The identifier of the channel this balance belongs to. - ChannelId? channelId, - - /// The best height when we last broadcast a transaction spending the output being swept. - required int latestBroadcastHeight, - - /// The identifier of the transaction spending the swept output we last broadcast. - required Txid latestSpendingTxid, - - /// The amount, in satoshis, of the output being swept. - required int amountSatoshis, - }) = PendingSweepBalance_BroadcastAwaitingConfirmation; - - /// A spending transaction has been confirmed on-chain and is awaiting threshold confirmations. - /// - /// It will be considered irrevocably confirmed after reaching [`ANTI_REORG_DELAY`]. - /// - /// [`ANTI_REORG_DELAY`]: lightning::chain::channelmonitor::ANTI_REORG_DELAY - const factory PendingSweepBalance.awaitingThresholdConfirmations({ - /// The identifier of the channel this balance belongs to. - ChannelId? channelId, - - /// The identifier of the confirmed transaction spending the swept output. - required Txid latestSpendingTxid, - - /// The hash of the block in which the spending transaction was confirmed. - required String confirmationHash, - - /// The height at which the spending transaction was confirmed. - required int confirmationHeight, - - /// The amount, in satoshis, of the output being swept. - required int amountSatoshis, - }) = PendingSweepBalance_AwaitingThresholdConfirmations; -} - ///A Secp256k1 public key, used for verification of signatures. /// class PublicKey { - final String hexCode; + final String hex; const PublicKey({ - required this.hexCode, + required this.hex, }); @override - int get hashCode => hexCode.hashCode; + int get hashCode => hex.hashCode; @override bool operator ==(Object other) => identical(this, other) || other is PublicKey && runtimeType == other.runtimeType && - hexCode == other.hexCode; + hex == other.hex; } @freezed sealed class SocketAddress with _$SocketAddress { + const SocketAddress._(); + const factory SocketAddress.tcpIpV4({ required U8Array4 addr, required int port, @@ -1344,6 +809,13 @@ sealed class SocketAddress with _$SocketAddress { required String addr, required int port, }) = SocketAddress_Hostname; + + Future asString({dynamic hint}) => + LdkCore.instance.api.socketAddressAsString(that: this, hint: hint); + + static Future fromStr( + {required String address, dynamic hint}) => + LdkCore.instance.api.socketAddressFromStr(address: address, hint: hint); } ///A bitcoin transaction hash/transaction ID. @@ -1369,7 +841,7 @@ class Txid { /// By default, this will be randomly generated for the user to ensure local uniqueness. /// class UserChannelId { - final Uint8List data; + final int data; const UserChannelId({ required this.data, diff --git a/lib/src/generated/api/types.freezed.dart b/lib/src/generated/api/types.freezed.dart index fb0db9d..1a466c2 100644 --- a/lib/src/generated/api/types.freezed.dart +++ b/lib/src/generated/api/types.freezed.dart @@ -128,8 +128,8 @@ class __$$ChainDataSourceConfig_EsploraImplCopyWithImpl<$Res> /// @nodoc class _$ChainDataSourceConfig_EsploraImpl - implements ChainDataSourceConfig_Esplora { - const _$ChainDataSourceConfig_EsploraImpl(this.field0); + extends ChainDataSourceConfig_Esplora { + const _$ChainDataSourceConfig_EsploraImpl(this.field0) : super._(); @override final String field0; @@ -215,9 +215,10 @@ class _$ChainDataSourceConfig_EsploraImpl } } -abstract class ChainDataSourceConfig_Esplora implements ChainDataSourceConfig { +abstract class ChainDataSourceConfig_Esplora extends ChainDataSourceConfig { const factory ChainDataSourceConfig_Esplora(final String field0) = _$ChainDataSourceConfig_EsploraImpl; + const ChainDataSourceConfig_Esplora._() : super._(); @override String get field0; @@ -229,130 +230,66 @@ abstract class ChainDataSourceConfig_Esplora implements ChainDataSourceConfig { } /// @nodoc -mixin _$ClosureReason { +mixin _$EntropySourceConfig { @optionalTypeArgs TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, + required TResult Function(String field0) seedFile, + required TResult Function(U8Array64 field0) seedBytes, + required TResult Function(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, required TResult orElse(), }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, + required TResult Function(EntropySourceConfig_SeedFile value) seedFile, + required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, + required TResult Function(EntropySourceConfig_Bip39Mnemonic value) + bip39Mnemonic, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, required TResult orElse(), }) => throw _privateConstructorUsedError; } /// @nodoc -abstract class $ClosureReasonCopyWith<$Res> { - factory $ClosureReasonCopyWith( - ClosureReason value, $Res Function(ClosureReason) then) = - _$ClosureReasonCopyWithImpl<$Res, ClosureReason>; +abstract class $EntropySourceConfigCopyWith<$Res> { + factory $EntropySourceConfigCopyWith( + EntropySourceConfig value, $Res Function(EntropySourceConfig) then) = + _$EntropySourceConfigCopyWithImpl<$Res, EntropySourceConfig>; } /// @nodoc -class _$ClosureReasonCopyWithImpl<$Res, $Val extends ClosureReason> - implements $ClosureReasonCopyWith<$Res> { - _$ClosureReasonCopyWithImpl(this._value, this._then); +class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> + implements $EntropySourceConfigCopyWith<$Res> { + _$EntropySourceConfigCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -361,34 +298,34 @@ class _$ClosureReasonCopyWithImpl<$Res, $Val extends ClosureReason> } /// @nodoc -abstract class _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { - factory _$$ClosureReason_CounterpartyForceClosedImplCopyWith( - _$ClosureReason_CounterpartyForceClosedImpl value, - $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) then) = - __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res>; +abstract class _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { + factory _$$EntropySourceConfig_SeedFileImplCopyWith( + _$EntropySourceConfig_SeedFileImpl value, + $Res Function(_$EntropySourceConfig_SeedFileImpl) then) = + __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res>; @useResult - $Res call({String peerMsg}); + $Res call({String field0}); } /// @nodoc -class __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_CounterpartyForceClosedImpl> - implements _$$ClosureReason_CounterpartyForceClosedImplCopyWith<$Res> { - __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl( - _$ClosureReason_CounterpartyForceClosedImpl _value, - $Res Function(_$ClosureReason_CounterpartyForceClosedImpl) _then) +class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> + extends _$EntropySourceConfigCopyWithImpl<$Res, + _$EntropySourceConfig_SeedFileImpl> + implements _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { + __$$EntropySourceConfig_SeedFileImplCopyWithImpl( + _$EntropySourceConfig_SeedFileImpl _value, + $Res Function(_$EntropySourceConfig_SeedFileImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? peerMsg = null, + Object? field0 = null, }) { - return _then(_$ClosureReason_CounterpartyForceClosedImpl( - peerMsg: null == peerMsg - ? _value.peerMsg - : peerMsg // ignore: cast_nullable_to_non_nullable + return _then(_$EntropySourceConfig_SeedFileImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable as String, )); } @@ -396,95 +333,67 @@ class __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl<$Res> /// @nodoc -class _$ClosureReason_CounterpartyForceClosedImpl - implements ClosureReason_CounterpartyForceClosed { - const _$ClosureReason_CounterpartyForceClosedImpl({required this.peerMsg}); +class _$EntropySourceConfig_SeedFileImpl extends EntropySourceConfig_SeedFile { + const _$EntropySourceConfig_SeedFileImpl(this.field0) : super._(); - /// The error which the peer sent us. - /// - /// Be careful about printing the peer_msg, a well-crafted message could exploit - /// a security vulnerability in the terminal emulator or the logging subsystem. - /// To be safe, use `Display` on `UntrustedString` - /// - /// [`UntrustedString`]: crate::util::string::UntrustedString @override - final String peerMsg; + final String field0; @override String toString() { - return 'ClosureReason.counterpartyForceClosed(peerMsg: $peerMsg)'; + return 'EntropySourceConfig.seedFile(field0: $field0)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ClosureReason_CounterpartyForceClosedImpl && - (identical(other.peerMsg, peerMsg) || other.peerMsg == peerMsg)); + other is _$EntropySourceConfig_SeedFileImpl && + (identical(other.field0, field0) || other.field0 == field0)); } @override - int get hashCode => Object.hash(runtimeType, peerMsg); + int get hashCode => Object.hash(runtimeType, field0); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ClosureReason_CounterpartyForceClosedImplCopyWith< - _$ClosureReason_CounterpartyForceClosedImpl> - get copyWith => __$$ClosureReason_CounterpartyForceClosedImplCopyWithImpl< - _$ClosureReason_CounterpartyForceClosedImpl>(this, _$identity); + _$$EntropySourceConfig_SeedFileImplCopyWith< + _$EntropySourceConfig_SeedFileImpl> + get copyWith => __$$EntropySourceConfig_SeedFileImplCopyWithImpl< + _$EntropySourceConfig_SeedFileImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, + required TResult Function(String field0) seedFile, + required TResult Function(U8Array64 field0) seedBytes, + required TResult Function(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, }) { - return counterpartyForceClosed(peerMsg); + return seedFile(field0); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, }) { - return counterpartyForceClosed?.call(peerMsg); + return seedFile?.call(field0); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, required TResult orElse(), }) { - if (counterpartyForceClosed != null) { - return counterpartyForceClosed(peerMsg); + if (seedFile != null) { + return seedFile(field0); } return orElse(); } @@ -492,193 +401,150 @@ class _$ClosureReason_CounterpartyForceClosedImpl @override @optionalTypeArgs TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, + required TResult Function(EntropySourceConfig_SeedFile value) seedFile, + required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, + required TResult Function(EntropySourceConfig_Bip39Mnemonic value) + bip39Mnemonic, }) { - return counterpartyForceClosed(this); + return seedFile(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, }) { - return counterpartyForceClosed?.call(this); + return seedFile?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, required TResult orElse(), }) { - if (counterpartyForceClosed != null) { - return counterpartyForceClosed(this); + if (seedFile != null) { + return seedFile(this); } return orElse(); } } -abstract class ClosureReason_CounterpartyForceClosed implements ClosureReason { - const factory ClosureReason_CounterpartyForceClosed( - {required final String peerMsg}) = - _$ClosureReason_CounterpartyForceClosedImpl; - - /// The error which the peer sent us. - /// - /// Be careful about printing the peer_msg, a well-crafted message could exploit - /// a security vulnerability in the terminal emulator or the logging subsystem. - /// To be safe, use `Display` on `UntrustedString` - /// - /// [`UntrustedString`]: crate::util::string::UntrustedString - String get peerMsg; +abstract class EntropySourceConfig_SeedFile extends EntropySourceConfig { + const factory EntropySourceConfig_SeedFile(final String field0) = + _$EntropySourceConfig_SeedFileImpl; + const EntropySourceConfig_SeedFile._() : super._(); + + String get field0; @JsonKey(ignore: true) - _$$ClosureReason_CounterpartyForceClosedImplCopyWith< - _$ClosureReason_CounterpartyForceClosedImpl> + _$$EntropySourceConfig_SeedFileImplCopyWith< + _$EntropySourceConfig_SeedFileImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { - factory _$$ClosureReason_HolderForceClosedImplCopyWith( - _$ClosureReason_HolderForceClosedImpl value, - $Res Function(_$ClosureReason_HolderForceClosedImpl) then) = - __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res>; +abstract class _$$EntropySourceConfig_SeedBytesImplCopyWith<$Res> { + factory _$$EntropySourceConfig_SeedBytesImplCopyWith( + _$EntropySourceConfig_SeedBytesImpl value, + $Res Function(_$EntropySourceConfig_SeedBytesImpl) then) = + __$$EntropySourceConfig_SeedBytesImplCopyWithImpl<$Res>; + @useResult + $Res call({U8Array64 field0}); } /// @nodoc -class __$$ClosureReason_HolderForceClosedImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_HolderForceClosedImpl> - implements _$$ClosureReason_HolderForceClosedImplCopyWith<$Res> { - __$$ClosureReason_HolderForceClosedImplCopyWithImpl( - _$ClosureReason_HolderForceClosedImpl _value, - $Res Function(_$ClosureReason_HolderForceClosedImpl) _then) +class __$$EntropySourceConfig_SeedBytesImplCopyWithImpl<$Res> + extends _$EntropySourceConfigCopyWithImpl<$Res, + _$EntropySourceConfig_SeedBytesImpl> + implements _$$EntropySourceConfig_SeedBytesImplCopyWith<$Res> { + __$$EntropySourceConfig_SeedBytesImplCopyWithImpl( + _$EntropySourceConfig_SeedBytesImpl _value, + $Res Function(_$EntropySourceConfig_SeedBytesImpl) _then) : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? field0 = null, + }) { + return _then(_$EntropySourceConfig_SeedBytesImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as U8Array64, + )); + } } /// @nodoc -class _$ClosureReason_HolderForceClosedImpl - implements ClosureReason_HolderForceClosed { - const _$ClosureReason_HolderForceClosedImpl(); +class _$EntropySourceConfig_SeedBytesImpl + extends EntropySourceConfig_SeedBytes { + const _$EntropySourceConfig_SeedBytesImpl(this.field0) : super._(); + + @override + final U8Array64 field0; @override String toString() { - return 'ClosureReason.holderForceClosed()'; + return 'EntropySourceConfig.seedBytes(field0: $field0)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ClosureReason_HolderForceClosedImpl); + other is _$EntropySourceConfig_SeedBytesImpl && + const DeepCollectionEquality().equals(other.field0, field0)); } @override - int get hashCode => runtimeType.hashCode; + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(field0)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$EntropySourceConfig_SeedBytesImplCopyWith< + _$EntropySourceConfig_SeedBytesImpl> + get copyWith => __$$EntropySourceConfig_SeedBytesImplCopyWithImpl< + _$EntropySourceConfig_SeedBytesImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, + required TResult Function(String field0) seedFile, + required TResult Function(U8Array64 field0) seedBytes, + required TResult Function(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, }) { - return holderForceClosed(); + return seedBytes(field0); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, }) { - return holderForceClosed?.call(); + return seedBytes?.call(field0); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, required TResult orElse(), }) { - if (holderForceClosed != null) { - return holderForceClosed(); + if (seedBytes != null) { + return seedBytes(field0); } return orElse(); } @@ -686,179 +552,161 @@ class _$ClosureReason_HolderForceClosedImpl @override @optionalTypeArgs TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, + required TResult Function(EntropySourceConfig_SeedFile value) seedFile, + required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, + required TResult Function(EntropySourceConfig_Bip39Mnemonic value) + bip39Mnemonic, }) { - return holderForceClosed(this); + return seedBytes(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, }) { - return holderForceClosed?.call(this); + return seedBytes?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, required TResult orElse(), }) { - if (holderForceClosed != null) { - return holderForceClosed(this); + if (seedBytes != null) { + return seedBytes(this); } return orElse(); } } -abstract class ClosureReason_HolderForceClosed implements ClosureReason { - const factory ClosureReason_HolderForceClosed() = - _$ClosureReason_HolderForceClosedImpl; +abstract class EntropySourceConfig_SeedBytes extends EntropySourceConfig { + const factory EntropySourceConfig_SeedBytes(final U8Array64 field0) = + _$EntropySourceConfig_SeedBytesImpl; + const EntropySourceConfig_SeedBytes._() : super._(); + + U8Array64 get field0; + @JsonKey(ignore: true) + _$$EntropySourceConfig_SeedBytesImplCopyWith< + _$EntropySourceConfig_SeedBytesImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ClosureReason_CooperativeClosureImplCopyWith<$Res> { - factory _$$ClosureReason_CooperativeClosureImplCopyWith( - _$ClosureReason_CooperativeClosureImpl value, - $Res Function(_$ClosureReason_CooperativeClosureImpl) then) = - __$$ClosureReason_CooperativeClosureImplCopyWithImpl<$Res>; +abstract class _$$EntropySourceConfig_Bip39MnemonicImplCopyWith<$Res> { + factory _$$EntropySourceConfig_Bip39MnemonicImplCopyWith( + _$EntropySourceConfig_Bip39MnemonicImpl value, + $Res Function(_$EntropySourceConfig_Bip39MnemonicImpl) then) = + __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl<$Res>; + @useResult + $Res call({LdkMnemonic mnemonic, String? passphrase}); } /// @nodoc -class __$$ClosureReason_CooperativeClosureImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_CooperativeClosureImpl> - implements _$$ClosureReason_CooperativeClosureImplCopyWith<$Res> { - __$$ClosureReason_CooperativeClosureImplCopyWithImpl( - _$ClosureReason_CooperativeClosureImpl _value, - $Res Function(_$ClosureReason_CooperativeClosureImpl) _then) +class __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl<$Res> + extends _$EntropySourceConfigCopyWithImpl<$Res, + _$EntropySourceConfig_Bip39MnemonicImpl> + implements _$$EntropySourceConfig_Bip39MnemonicImplCopyWith<$Res> { + __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl( + _$EntropySourceConfig_Bip39MnemonicImpl _value, + $Res Function(_$EntropySourceConfig_Bip39MnemonicImpl) _then) : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? mnemonic = null, + Object? passphrase = freezed, + }) { + return _then(_$EntropySourceConfig_Bip39MnemonicImpl( + mnemonic: null == mnemonic + ? _value.mnemonic + : mnemonic // ignore: cast_nullable_to_non_nullable + as LdkMnemonic, + passphrase: freezed == passphrase + ? _value.passphrase + : passphrase // ignore: cast_nullable_to_non_nullable + as String?, + )); + } } /// @nodoc -class _$ClosureReason_CooperativeClosureImpl - implements ClosureReason_CooperativeClosure { - const _$ClosureReason_CooperativeClosureImpl(); +class _$EntropySourceConfig_Bip39MnemonicImpl + extends EntropySourceConfig_Bip39Mnemonic { + const _$EntropySourceConfig_Bip39MnemonicImpl( + {required this.mnemonic, this.passphrase}) + : super._(); + + @override + final LdkMnemonic mnemonic; + @override + final String? passphrase; @override String toString() { - return 'ClosureReason.cooperativeClosure()'; + return 'EntropySourceConfig.bip39Mnemonic(mnemonic: $mnemonic, passphrase: $passphrase)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ClosureReason_CooperativeClosureImpl); + other is _$EntropySourceConfig_Bip39MnemonicImpl && + (identical(other.mnemonic, mnemonic) || + other.mnemonic == mnemonic) && + (identical(other.passphrase, passphrase) || + other.passphrase == passphrase)); } @override - int get hashCode => runtimeType.hashCode; + int get hashCode => Object.hash(runtimeType, mnemonic, passphrase); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$EntropySourceConfig_Bip39MnemonicImplCopyWith< + _$EntropySourceConfig_Bip39MnemonicImpl> + get copyWith => __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl< + _$EntropySourceConfig_Bip39MnemonicImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, + required TResult Function(String field0) seedFile, + required TResult Function(U8Array64 field0) seedBytes, + required TResult Function(LdkMnemonic mnemonic, String? passphrase) + bip39Mnemonic, }) { - return cooperativeClosure(); + return bip39Mnemonic(mnemonic, passphrase); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, + TResult? Function(String field0)? seedFile, + TResult? Function(U8Array64 field0)? seedBytes, + TResult? Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, }) { - return cooperativeClosure?.call(); + return bip39Mnemonic?.call(mnemonic, passphrase); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, + TResult Function(String field0)? seedFile, + TResult Function(U8Array64 field0)? seedBytes, + TResult Function(LdkMnemonic mnemonic, String? passphrase)? bip39Mnemonic, required TResult orElse(), }) { - if (cooperativeClosure != null) { - return cooperativeClosure(); + if (bip39Mnemonic != null) { + return bip39Mnemonic(mnemonic, passphrase); } return orElse(); } @@ -866,4190 +714,303 @@ class _$ClosureReason_CooperativeClosureImpl @override @optionalTypeArgs TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, + required TResult Function(EntropySourceConfig_SeedFile value) seedFile, + required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, + required TResult Function(EntropySourceConfig_Bip39Mnemonic value) + bip39Mnemonic, }) { - return cooperativeClosure(this); + return bip39Mnemonic(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, }) { - return cooperativeClosure?.call(this); + return bip39Mnemonic?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, + TResult Function(EntropySourceConfig_SeedFile value)? seedFile, + TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, + TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, required TResult orElse(), }) { - if (cooperativeClosure != null) { - return cooperativeClosure(this); + if (bip39Mnemonic != null) { + return bip39Mnemonic(this); } return orElse(); } } -abstract class ClosureReason_CooperativeClosure implements ClosureReason { - const factory ClosureReason_CooperativeClosure() = - _$ClosureReason_CooperativeClosureImpl; -} +abstract class EntropySourceConfig_Bip39Mnemonic extends EntropySourceConfig { + const factory EntropySourceConfig_Bip39Mnemonic( + {required final LdkMnemonic mnemonic, + final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; + const EntropySourceConfig_Bip39Mnemonic._() : super._(); -/// @nodoc -abstract class _$$ClosureReason_CommitmentTxConfirmedImplCopyWith<$Res> { - factory _$$ClosureReason_CommitmentTxConfirmedImplCopyWith( - _$ClosureReason_CommitmentTxConfirmedImpl value, - $Res Function(_$ClosureReason_CommitmentTxConfirmedImpl) then) = - __$$ClosureReason_CommitmentTxConfirmedImplCopyWithImpl<$Res>; + LdkMnemonic get mnemonic; + String? get passphrase; + @JsonKey(ignore: true) + _$$EntropySourceConfig_Bip39MnemonicImplCopyWith< + _$EntropySourceConfig_Bip39MnemonicImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -class __$$ClosureReason_CommitmentTxConfirmedImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_CommitmentTxConfirmedImpl> - implements _$$ClosureReason_CommitmentTxConfirmedImplCopyWith<$Res> { - __$$ClosureReason_CommitmentTxConfirmedImplCopyWithImpl( - _$ClosureReason_CommitmentTxConfirmedImpl _value, - $Res Function(_$ClosureReason_CommitmentTxConfirmedImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ClosureReason_CommitmentTxConfirmedImpl - implements ClosureReason_CommitmentTxConfirmed { - const _$ClosureReason_CommitmentTxConfirmedImpl(); - - @override - String toString() { - return 'ClosureReason.commitmentTxConfirmed()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ClosureReason_CommitmentTxConfirmedImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, - }) { - return commitmentTxConfirmed(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, - }) { - return commitmentTxConfirmed?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, - required TResult orElse(), - }) { - if (commitmentTxConfirmed != null) { - return commitmentTxConfirmed(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, - }) { - return commitmentTxConfirmed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - }) { - return commitmentTxConfirmed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - required TResult orElse(), - }) { - if (commitmentTxConfirmed != null) { - return commitmentTxConfirmed(this); - } - return orElse(); - } -} - -abstract class ClosureReason_CommitmentTxConfirmed implements ClosureReason { - const factory ClosureReason_CommitmentTxConfirmed() = - _$ClosureReason_CommitmentTxConfirmedImpl; -} - -/// @nodoc -abstract class _$$ClosureReason_FundingTimedOutImplCopyWith<$Res> { - factory _$$ClosureReason_FundingTimedOutImplCopyWith( - _$ClosureReason_FundingTimedOutImpl value, - $Res Function(_$ClosureReason_FundingTimedOutImpl) then) = - __$$ClosureReason_FundingTimedOutImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$ClosureReason_FundingTimedOutImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_FundingTimedOutImpl> - implements _$$ClosureReason_FundingTimedOutImplCopyWith<$Res> { - __$$ClosureReason_FundingTimedOutImplCopyWithImpl( - _$ClosureReason_FundingTimedOutImpl _value, - $Res Function(_$ClosureReason_FundingTimedOutImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ClosureReason_FundingTimedOutImpl - implements ClosureReason_FundingTimedOut { - const _$ClosureReason_FundingTimedOutImpl(); - - @override - String toString() { - return 'ClosureReason.fundingTimedOut()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ClosureReason_FundingTimedOutImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, - }) { - return fundingTimedOut(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, - }) { - return fundingTimedOut?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, - required TResult orElse(), - }) { - if (fundingTimedOut != null) { - return fundingTimedOut(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, - }) { - return fundingTimedOut(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - }) { - return fundingTimedOut?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - required TResult orElse(), - }) { - if (fundingTimedOut != null) { - return fundingTimedOut(this); - } - return orElse(); - } -} - -abstract class ClosureReason_FundingTimedOut implements ClosureReason { - const factory ClosureReason_FundingTimedOut() = - _$ClosureReason_FundingTimedOutImpl; -} - -/// @nodoc -abstract class _$$ClosureReason_ProcessingErrorImplCopyWith<$Res> { - factory _$$ClosureReason_ProcessingErrorImplCopyWith( - _$ClosureReason_ProcessingErrorImpl value, - $Res Function(_$ClosureReason_ProcessingErrorImpl) then) = - __$$ClosureReason_ProcessingErrorImplCopyWithImpl<$Res>; - @useResult - $Res call({String err}); -} - -/// @nodoc -class __$$ClosureReason_ProcessingErrorImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_ProcessingErrorImpl> - implements _$$ClosureReason_ProcessingErrorImplCopyWith<$Res> { - __$$ClosureReason_ProcessingErrorImplCopyWithImpl( - _$ClosureReason_ProcessingErrorImpl _value, - $Res Function(_$ClosureReason_ProcessingErrorImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? err = null, - }) { - return _then(_$ClosureReason_ProcessingErrorImpl( - err: null == err - ? _value.err - : err // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$ClosureReason_ProcessingErrorImpl - implements ClosureReason_ProcessingError { - const _$ClosureReason_ProcessingErrorImpl({required this.err}); - - /// A developer-readable error message which we generated. - @override - final String err; - - @override - String toString() { - return 'ClosureReason.processingError(err: $err)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ClosureReason_ProcessingErrorImpl && - (identical(other.err, err) || other.err == err)); - } - - @override - int get hashCode => Object.hash(runtimeType, err); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$ClosureReason_ProcessingErrorImplCopyWith< - _$ClosureReason_ProcessingErrorImpl> - get copyWith => __$$ClosureReason_ProcessingErrorImplCopyWithImpl< - _$ClosureReason_ProcessingErrorImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, - }) { - return processingError(err); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, - }) { - return processingError?.call(err); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, - required TResult orElse(), - }) { - if (processingError != null) { - return processingError(err); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, - }) { - return processingError(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - }) { - return processingError?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - required TResult orElse(), - }) { - if (processingError != null) { - return processingError(this); - } - return orElse(); - } -} - -abstract class ClosureReason_ProcessingError implements ClosureReason { - const factory ClosureReason_ProcessingError({required final String err}) = - _$ClosureReason_ProcessingErrorImpl; - - /// A developer-readable error message which we generated. - String get err; - @JsonKey(ignore: true) - _$$ClosureReason_ProcessingErrorImplCopyWith< - _$ClosureReason_ProcessingErrorImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$ClosureReason_DisconnectedPeerImplCopyWith<$Res> { - factory _$$ClosureReason_DisconnectedPeerImplCopyWith( - _$ClosureReason_DisconnectedPeerImpl value, - $Res Function(_$ClosureReason_DisconnectedPeerImpl) then) = - __$$ClosureReason_DisconnectedPeerImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$ClosureReason_DisconnectedPeerImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_DisconnectedPeerImpl> - implements _$$ClosureReason_DisconnectedPeerImplCopyWith<$Res> { - __$$ClosureReason_DisconnectedPeerImplCopyWithImpl( - _$ClosureReason_DisconnectedPeerImpl _value, - $Res Function(_$ClosureReason_DisconnectedPeerImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ClosureReason_DisconnectedPeerImpl - implements ClosureReason_DisconnectedPeer { - const _$ClosureReason_DisconnectedPeerImpl(); - - @override - String toString() { - return 'ClosureReason.disconnectedPeer()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ClosureReason_DisconnectedPeerImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, - }) { - return disconnectedPeer(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, - }) { - return disconnectedPeer?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, - required TResult orElse(), - }) { - if (disconnectedPeer != null) { - return disconnectedPeer(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, - }) { - return disconnectedPeer(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - }) { - return disconnectedPeer?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - required TResult orElse(), - }) { - if (disconnectedPeer != null) { - return disconnectedPeer(this); - } - return orElse(); - } -} - -abstract class ClosureReason_DisconnectedPeer implements ClosureReason { - const factory ClosureReason_DisconnectedPeer() = - _$ClosureReason_DisconnectedPeerImpl; -} - -/// @nodoc -abstract class _$$ClosureReason_OutdatedChannelManagerImplCopyWith<$Res> { - factory _$$ClosureReason_OutdatedChannelManagerImplCopyWith( - _$ClosureReason_OutdatedChannelManagerImpl value, - $Res Function(_$ClosureReason_OutdatedChannelManagerImpl) then) = - __$$ClosureReason_OutdatedChannelManagerImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$ClosureReason_OutdatedChannelManagerImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_OutdatedChannelManagerImpl> - implements _$$ClosureReason_OutdatedChannelManagerImplCopyWith<$Res> { - __$$ClosureReason_OutdatedChannelManagerImplCopyWithImpl( - _$ClosureReason_OutdatedChannelManagerImpl _value, - $Res Function(_$ClosureReason_OutdatedChannelManagerImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ClosureReason_OutdatedChannelManagerImpl - implements ClosureReason_OutdatedChannelManager { - const _$ClosureReason_OutdatedChannelManagerImpl(); - - @override - String toString() { - return 'ClosureReason.outdatedChannelManager()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ClosureReason_OutdatedChannelManagerImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, - }) { - return outdatedChannelManager(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, - }) { - return outdatedChannelManager?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, - required TResult orElse(), - }) { - if (outdatedChannelManager != null) { - return outdatedChannelManager(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, - }) { - return outdatedChannelManager(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - }) { - return outdatedChannelManager?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - required TResult orElse(), - }) { - if (outdatedChannelManager != null) { - return outdatedChannelManager(this); - } - return orElse(); - } -} - -abstract class ClosureReason_OutdatedChannelManager implements ClosureReason { - const factory ClosureReason_OutdatedChannelManager() = - _$ClosureReason_OutdatedChannelManagerImpl; -} - -/// @nodoc -abstract class _$$ClosureReason_CounterpartyCoopClosedUnfundedChannelImplCopyWith< - $Res> { - factory _$$ClosureReason_CounterpartyCoopClosedUnfundedChannelImplCopyWith( - _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl value, - $Res Function( - _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl) - then) = - __$$ClosureReason_CounterpartyCoopClosedUnfundedChannelImplCopyWithImpl< - $Res>; -} - -/// @nodoc -class __$$ClosureReason_CounterpartyCoopClosedUnfundedChannelImplCopyWithImpl< - $Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl> - implements - _$$ClosureReason_CounterpartyCoopClosedUnfundedChannelImplCopyWith< - $Res> { - __$$ClosureReason_CounterpartyCoopClosedUnfundedChannelImplCopyWithImpl( - _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl _value, - $Res Function(_$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl) - _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl - implements ClosureReason_CounterpartyCoopClosedUnfundedChannel { - const _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl(); - - @override - String toString() { - return 'ClosureReason.counterpartyCoopClosedUnfundedChannel()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, - }) { - return counterpartyCoopClosedUnfundedChannel(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, - }) { - return counterpartyCoopClosedUnfundedChannel?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, - required TResult orElse(), - }) { - if (counterpartyCoopClosedUnfundedChannel != null) { - return counterpartyCoopClosedUnfundedChannel(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, - }) { - return counterpartyCoopClosedUnfundedChannel(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - }) { - return counterpartyCoopClosedUnfundedChannel?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - required TResult orElse(), - }) { - if (counterpartyCoopClosedUnfundedChannel != null) { - return counterpartyCoopClosedUnfundedChannel(this); - } - return orElse(); - } -} - -abstract class ClosureReason_CounterpartyCoopClosedUnfundedChannel - implements ClosureReason { - const factory ClosureReason_CounterpartyCoopClosedUnfundedChannel() = - _$ClosureReason_CounterpartyCoopClosedUnfundedChannelImpl; -} - -/// @nodoc -abstract class _$$ClosureReason_FundingBatchClosureImplCopyWith<$Res> { - factory _$$ClosureReason_FundingBatchClosureImplCopyWith( - _$ClosureReason_FundingBatchClosureImpl value, - $Res Function(_$ClosureReason_FundingBatchClosureImpl) then) = - __$$ClosureReason_FundingBatchClosureImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$ClosureReason_FundingBatchClosureImplCopyWithImpl<$Res> - extends _$ClosureReasonCopyWithImpl<$Res, - _$ClosureReason_FundingBatchClosureImpl> - implements _$$ClosureReason_FundingBatchClosureImplCopyWith<$Res> { - __$$ClosureReason_FundingBatchClosureImplCopyWithImpl( - _$ClosureReason_FundingBatchClosureImpl _value, - $Res Function(_$ClosureReason_FundingBatchClosureImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$ClosureReason_FundingBatchClosureImpl - implements ClosureReason_FundingBatchClosure { - const _$ClosureReason_FundingBatchClosureImpl(); - - @override - String toString() { - return 'ClosureReason.fundingBatchClosure()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ClosureReason_FundingBatchClosureImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String peerMsg) counterpartyForceClosed, - required TResult Function() holderForceClosed, - required TResult Function() cooperativeClosure, - required TResult Function() commitmentTxConfirmed, - required TResult Function() fundingTimedOut, - required TResult Function(String err) processingError, - required TResult Function() disconnectedPeer, - required TResult Function() outdatedChannelManager, - required TResult Function() counterpartyCoopClosedUnfundedChannel, - required TResult Function() fundingBatchClosure, - }) { - return fundingBatchClosure(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String peerMsg)? counterpartyForceClosed, - TResult? Function()? holderForceClosed, - TResult? Function()? cooperativeClosure, - TResult? Function()? commitmentTxConfirmed, - TResult? Function()? fundingTimedOut, - TResult? Function(String err)? processingError, - TResult? Function()? disconnectedPeer, - TResult? Function()? outdatedChannelManager, - TResult? Function()? counterpartyCoopClosedUnfundedChannel, - TResult? Function()? fundingBatchClosure, - }) { - return fundingBatchClosure?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String peerMsg)? counterpartyForceClosed, - TResult Function()? holderForceClosed, - TResult Function()? cooperativeClosure, - TResult Function()? commitmentTxConfirmed, - TResult Function()? fundingTimedOut, - TResult Function(String err)? processingError, - TResult Function()? disconnectedPeer, - TResult Function()? outdatedChannelManager, - TResult Function()? counterpartyCoopClosedUnfundedChannel, - TResult Function()? fundingBatchClosure, - required TResult orElse(), - }) { - if (fundingBatchClosure != null) { - return fundingBatchClosure(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ClosureReason_CounterpartyForceClosed value) - counterpartyForceClosed, - required TResult Function(ClosureReason_HolderForceClosed value) - holderForceClosed, - required TResult Function(ClosureReason_CooperativeClosure value) - cooperativeClosure, - required TResult Function(ClosureReason_CommitmentTxConfirmed value) - commitmentTxConfirmed, - required TResult Function(ClosureReason_FundingTimedOut value) - fundingTimedOut, - required TResult Function(ClosureReason_ProcessingError value) - processingError, - required TResult Function(ClosureReason_DisconnectedPeer value) - disconnectedPeer, - required TResult Function(ClosureReason_OutdatedChannelManager value) - outdatedChannelManager, - required TResult Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value) - counterpartyCoopClosedUnfundedChannel, - required TResult Function(ClosureReason_FundingBatchClosure value) - fundingBatchClosure, - }) { - return fundingBatchClosure(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult? Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult? Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult? Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult? Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult? Function(ClosureReason_ProcessingError value)? processingError, - TResult? Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult? Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult? Function( - ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult? Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - }) { - return fundingBatchClosure?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ClosureReason_CounterpartyForceClosed value)? - counterpartyForceClosed, - TResult Function(ClosureReason_HolderForceClosed value)? holderForceClosed, - TResult Function(ClosureReason_CooperativeClosure value)? - cooperativeClosure, - TResult Function(ClosureReason_CommitmentTxConfirmed value)? - commitmentTxConfirmed, - TResult Function(ClosureReason_FundingTimedOut value)? fundingTimedOut, - TResult Function(ClosureReason_ProcessingError value)? processingError, - TResult Function(ClosureReason_DisconnectedPeer value)? disconnectedPeer, - TResult Function(ClosureReason_OutdatedChannelManager value)? - outdatedChannelManager, - TResult Function(ClosureReason_CounterpartyCoopClosedUnfundedChannel value)? - counterpartyCoopClosedUnfundedChannel, - TResult Function(ClosureReason_FundingBatchClosure value)? - fundingBatchClosure, - required TResult orElse(), - }) { - if (fundingBatchClosure != null) { - return fundingBatchClosure(this); - } - return orElse(); - } -} - -abstract class ClosureReason_FundingBatchClosure implements ClosureReason { - const factory ClosureReason_FundingBatchClosure() = - _$ClosureReason_FundingBatchClosureImpl; -} - -/// @nodoc -mixin _$EntropySourceConfig { - @optionalTypeArgs - TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(MnemonicBase mnemonic, String? passphrase) - bip39Mnemonic, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(EntropySourceConfig_SeedFile value) seedFile, - required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, - required TResult Function(EntropySourceConfig_Bip39Mnemonic value) - bip39Mnemonic, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EntropySourceConfigCopyWith<$Res> { - factory $EntropySourceConfigCopyWith( - EntropySourceConfig value, $Res Function(EntropySourceConfig) then) = - _$EntropySourceConfigCopyWithImpl<$Res, EntropySourceConfig>; -} - -/// @nodoc -class _$EntropySourceConfigCopyWithImpl<$Res, $Val extends EntropySourceConfig> - implements $EntropySourceConfigCopyWith<$Res> { - _$EntropySourceConfigCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; -} - -/// @nodoc -abstract class _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - factory _$$EntropySourceConfig_SeedFileImplCopyWith( - _$EntropySourceConfig_SeedFileImpl value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) then) = - __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res>; - @useResult - $Res call({String field0}); -} - -/// @nodoc -class __$$EntropySourceConfig_SeedFileImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedFileImpl> - implements _$$EntropySourceConfig_SeedFileImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedFileImplCopyWithImpl( - _$EntropySourceConfig_SeedFileImpl _value, - $Res Function(_$EntropySourceConfig_SeedFileImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field0 = null, - }) { - return _then(_$EntropySourceConfig_SeedFileImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$EntropySourceConfig_SeedFileImpl - implements EntropySourceConfig_SeedFile { - const _$EntropySourceConfig_SeedFileImpl(this.field0); - - @override - final String field0; - - @override - String toString() { - return 'EntropySourceConfig.seedFile(field0: $field0)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedFileImpl && - (identical(other.field0, field0) || other.field0 == field0)); - } - - @override - int get hashCode => Object.hash(runtimeType, field0); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> - get copyWith => __$$EntropySourceConfig_SeedFileImplCopyWithImpl< - _$EntropySourceConfig_SeedFileImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(MnemonicBase mnemonic, String? passphrase) - bip39Mnemonic, - }) { - return seedFile(field0); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - }) { - return seedFile?.call(field0); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - required TResult orElse(), - }) { - if (seedFile != null) { - return seedFile(field0); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(EntropySourceConfig_SeedFile value) seedFile, - required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, - required TResult Function(EntropySourceConfig_Bip39Mnemonic value) - bip39Mnemonic, - }) { - return seedFile(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - }) { - return seedFile?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - required TResult orElse(), - }) { - if (seedFile != null) { - return seedFile(this); - } - return orElse(); - } -} - -abstract class EntropySourceConfig_SeedFile implements EntropySourceConfig { - const factory EntropySourceConfig_SeedFile(final String field0) = - _$EntropySourceConfig_SeedFileImpl; - - String get field0; - @JsonKey(ignore: true) - _$$EntropySourceConfig_SeedFileImplCopyWith< - _$EntropySourceConfig_SeedFileImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$EntropySourceConfig_SeedBytesImplCopyWith<$Res> { - factory _$$EntropySourceConfig_SeedBytesImplCopyWith( - _$EntropySourceConfig_SeedBytesImpl value, - $Res Function(_$EntropySourceConfig_SeedBytesImpl) then) = - __$$EntropySourceConfig_SeedBytesImplCopyWithImpl<$Res>; - @useResult - $Res call({U8Array64 field0}); -} - -/// @nodoc -class __$$EntropySourceConfig_SeedBytesImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_SeedBytesImpl> - implements _$$EntropySourceConfig_SeedBytesImplCopyWith<$Res> { - __$$EntropySourceConfig_SeedBytesImplCopyWithImpl( - _$EntropySourceConfig_SeedBytesImpl _value, - $Res Function(_$EntropySourceConfig_SeedBytesImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field0 = null, - }) { - return _then(_$EntropySourceConfig_SeedBytesImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as U8Array64, - )); - } -} - -/// @nodoc - -class _$EntropySourceConfig_SeedBytesImpl - implements EntropySourceConfig_SeedBytes { - const _$EntropySourceConfig_SeedBytesImpl(this.field0); - - @override - final U8Array64 field0; - - @override - String toString() { - return 'EntropySourceConfig.seedBytes(field0: $field0)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_SeedBytesImpl && - const DeepCollectionEquality().equals(other.field0, field0)); - } - - @override - int get hashCode => - Object.hash(runtimeType, const DeepCollectionEquality().hash(field0)); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$EntropySourceConfig_SeedBytesImplCopyWith< - _$EntropySourceConfig_SeedBytesImpl> - get copyWith => __$$EntropySourceConfig_SeedBytesImplCopyWithImpl< - _$EntropySourceConfig_SeedBytesImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(MnemonicBase mnemonic, String? passphrase) - bip39Mnemonic, - }) { - return seedBytes(field0); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - }) { - return seedBytes?.call(field0); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - required TResult orElse(), - }) { - if (seedBytes != null) { - return seedBytes(field0); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(EntropySourceConfig_SeedFile value) seedFile, - required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, - required TResult Function(EntropySourceConfig_Bip39Mnemonic value) - bip39Mnemonic, - }) { - return seedBytes(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - }) { - return seedBytes?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - required TResult orElse(), - }) { - if (seedBytes != null) { - return seedBytes(this); - } - return orElse(); - } -} - -abstract class EntropySourceConfig_SeedBytes implements EntropySourceConfig { - const factory EntropySourceConfig_SeedBytes(final U8Array64 field0) = - _$EntropySourceConfig_SeedBytesImpl; - - U8Array64 get field0; - @JsonKey(ignore: true) - _$$EntropySourceConfig_SeedBytesImplCopyWith< - _$EntropySourceConfig_SeedBytesImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$EntropySourceConfig_Bip39MnemonicImplCopyWith<$Res> { - factory _$$EntropySourceConfig_Bip39MnemonicImplCopyWith( - _$EntropySourceConfig_Bip39MnemonicImpl value, - $Res Function(_$EntropySourceConfig_Bip39MnemonicImpl) then) = - __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl<$Res>; - @useResult - $Res call({MnemonicBase mnemonic, String? passphrase}); -} - -/// @nodoc -class __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl<$Res> - extends _$EntropySourceConfigCopyWithImpl<$Res, - _$EntropySourceConfig_Bip39MnemonicImpl> - implements _$$EntropySourceConfig_Bip39MnemonicImplCopyWith<$Res> { - __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl( - _$EntropySourceConfig_Bip39MnemonicImpl _value, - $Res Function(_$EntropySourceConfig_Bip39MnemonicImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? mnemonic = null, - Object? passphrase = freezed, - }) { - return _then(_$EntropySourceConfig_Bip39MnemonicImpl( - mnemonic: null == mnemonic - ? _value.mnemonic - : mnemonic // ignore: cast_nullable_to_non_nullable - as MnemonicBase, - passphrase: freezed == passphrase - ? _value.passphrase - : passphrase // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc - -class _$EntropySourceConfig_Bip39MnemonicImpl - implements EntropySourceConfig_Bip39Mnemonic { - const _$EntropySourceConfig_Bip39MnemonicImpl( - {required this.mnemonic, this.passphrase}); - - @override - final MnemonicBase mnemonic; - @override - final String? passphrase; - - @override - String toString() { - return 'EntropySourceConfig.bip39Mnemonic(mnemonic: $mnemonic, passphrase: $passphrase)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EntropySourceConfig_Bip39MnemonicImpl && - (identical(other.mnemonic, mnemonic) || - other.mnemonic == mnemonic) && - (identical(other.passphrase, passphrase) || - other.passphrase == passphrase)); - } - - @override - int get hashCode => Object.hash(runtimeType, mnemonic, passphrase); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$EntropySourceConfig_Bip39MnemonicImplCopyWith< - _$EntropySourceConfig_Bip39MnemonicImpl> - get copyWith => __$$EntropySourceConfig_Bip39MnemonicImplCopyWithImpl< - _$EntropySourceConfig_Bip39MnemonicImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String field0) seedFile, - required TResult Function(U8Array64 field0) seedBytes, - required TResult Function(MnemonicBase mnemonic, String? passphrase) - bip39Mnemonic, - }) { - return bip39Mnemonic(mnemonic, passphrase); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String field0)? seedFile, - TResult? Function(U8Array64 field0)? seedBytes, - TResult? Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - }) { - return bip39Mnemonic?.call(mnemonic, passphrase); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String field0)? seedFile, - TResult Function(U8Array64 field0)? seedBytes, - TResult Function(MnemonicBase mnemonic, String? passphrase)? bip39Mnemonic, - required TResult orElse(), - }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(mnemonic, passphrase); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(EntropySourceConfig_SeedFile value) seedFile, - required TResult Function(EntropySourceConfig_SeedBytes value) seedBytes, - required TResult Function(EntropySourceConfig_Bip39Mnemonic value) - bip39Mnemonic, - }) { - return bip39Mnemonic(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult? Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult? Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - }) { - return bip39Mnemonic?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(EntropySourceConfig_SeedFile value)? seedFile, - TResult Function(EntropySourceConfig_SeedBytes value)? seedBytes, - TResult Function(EntropySourceConfig_Bip39Mnemonic value)? bip39Mnemonic, - required TResult orElse(), - }) { - if (bip39Mnemonic != null) { - return bip39Mnemonic(this); - } - return orElse(); - } -} - -abstract class EntropySourceConfig_Bip39Mnemonic - implements EntropySourceConfig { - const factory EntropySourceConfig_Bip39Mnemonic( - {required final MnemonicBase mnemonic, - final String? passphrase}) = _$EntropySourceConfig_Bip39MnemonicImpl; - - MnemonicBase get mnemonic; - String? get passphrase; - @JsonKey(ignore: true) - _$$EntropySourceConfig_Bip39MnemonicImplCopyWith< - _$EntropySourceConfig_Bip39MnemonicImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -mixin _$Event { - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentHash paymentHash, int? feePaidMsat) - paymentSuccessful, - required TResult Function( - PaymentHash paymentHash, PaymentFailureReason? reason) - paymentFailed, - required TResult Function(PaymentHash paymentHash, int amountMsat) - paymentReceived, - required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId) - channelReady, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason) - channelClosed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult? Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, - required TResult Function(Event_PaymentFailed value) paymentFailed, - required TResult Function(Event_PaymentReceived value) paymentReceived, - required TResult Function(Event_ChannelPending value) channelPending, - required TResult Function(Event_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult? Function(Event_PaymentFailed value)? paymentFailed, - TResult? Function(Event_PaymentReceived value)? paymentReceived, - TResult? Function(Event_ChannelPending value)? channelPending, - TResult? Function(Event_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult Function(Event_PaymentFailed value)? paymentFailed, - TResult Function(Event_PaymentReceived value)? paymentReceived, - TResult Function(Event_ChannelPending value)? channelPending, - TResult Function(Event_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EventCopyWith<$Res> { - factory $EventCopyWith(Event value, $Res Function(Event) then) = - _$EventCopyWithImpl<$Res, Event>; -} - -/// @nodoc -class _$EventCopyWithImpl<$Res, $Val extends Event> - implements $EventCopyWith<$Res> { - _$EventCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; -} - -/// @nodoc -abstract class _$$Event_PaymentSuccessfulImplCopyWith<$Res> { - factory _$$Event_PaymentSuccessfulImplCopyWith( - _$Event_PaymentSuccessfulImpl value, - $Res Function(_$Event_PaymentSuccessfulImpl) then) = - __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentHash paymentHash, int? feePaidMsat}); -} - -/// @nodoc -class __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentSuccessfulImpl> - implements _$$Event_PaymentSuccessfulImplCopyWith<$Res> { - __$$Event_PaymentSuccessfulImplCopyWithImpl( - _$Event_PaymentSuccessfulImpl _value, - $Res Function(_$Event_PaymentSuccessfulImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentHash = null, - Object? feePaidMsat = freezed, - }) { - return _then(_$Event_PaymentSuccessfulImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, - feePaidMsat: freezed == feePaidMsat - ? _value.feePaidMsat - : feePaidMsat // ignore: cast_nullable_to_non_nullable - as int?, - )); - } -} - -/// @nodoc - -class _$Event_PaymentSuccessfulImpl implements Event_PaymentSuccessful { - const _$Event_PaymentSuccessfulImpl( - {required this.paymentHash, this.feePaidMsat}); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; - - /// The total fee which was spent at intermediate hops in this payment. - @override - final int? feePaidMsat; - - @override - String toString() { - return 'Event.paymentSuccessful(paymentHash: $paymentHash, feePaidMsat: $feePaidMsat)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Event_PaymentSuccessfulImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash) && - (identical(other.feePaidMsat, feePaidMsat) || - other.feePaidMsat == feePaidMsat)); - } - - @override - int get hashCode => Object.hash(runtimeType, paymentHash, feePaidMsat); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => __$$Event_PaymentSuccessfulImplCopyWithImpl< - _$Event_PaymentSuccessfulImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentHash paymentHash, int? feePaidMsat) - paymentSuccessful, - required TResult Function( - PaymentHash paymentHash, PaymentFailureReason? reason) - paymentFailed, - required TResult Function(PaymentHash paymentHash, int amountMsat) - paymentReceived, - required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId) - channelReady, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason) - channelClosed, - }) { - return paymentSuccessful(paymentHash, feePaidMsat); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult? Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - }) { - return paymentSuccessful?.call(paymentHash, feePaidMsat); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - required TResult orElse(), - }) { - if (paymentSuccessful != null) { - return paymentSuccessful(paymentHash, feePaidMsat); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, - required TResult Function(Event_PaymentFailed value) paymentFailed, - required TResult Function(Event_PaymentReceived value) paymentReceived, - required TResult Function(Event_ChannelPending value) channelPending, - required TResult Function(Event_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - }) { - return paymentSuccessful(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult? Function(Event_PaymentFailed value)? paymentFailed, - TResult? Function(Event_PaymentReceived value)? paymentReceived, - TResult? Function(Event_ChannelPending value)? channelPending, - TResult? Function(Event_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - }) { - return paymentSuccessful?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult Function(Event_PaymentFailed value)? paymentFailed, - TResult Function(Event_PaymentReceived value)? paymentReceived, - TResult Function(Event_ChannelPending value)? channelPending, - TResult Function(Event_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - required TResult orElse(), - }) { - if (paymentSuccessful != null) { - return paymentSuccessful(this); - } - return orElse(); - } -} - -abstract class Event_PaymentSuccessful implements Event { - const factory Event_PaymentSuccessful( - {required final PaymentHash paymentHash, - final int? feePaidMsat}) = _$Event_PaymentSuccessfulImpl; - - /// The hash of the payment. - PaymentHash get paymentHash; - - /// The total fee which was spent at intermediate hops in this payment. - int? get feePaidMsat; - @JsonKey(ignore: true) - _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$Event_PaymentFailedImplCopyWith<$Res> { - factory _$$Event_PaymentFailedImplCopyWith(_$Event_PaymentFailedImpl value, - $Res Function(_$Event_PaymentFailedImpl) then) = - __$$Event_PaymentFailedImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentHash paymentHash, PaymentFailureReason? reason}); -} - -/// @nodoc -class __$$Event_PaymentFailedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentFailedImpl> - implements _$$Event_PaymentFailedImplCopyWith<$Res> { - __$$Event_PaymentFailedImplCopyWithImpl(_$Event_PaymentFailedImpl _value, - $Res Function(_$Event_PaymentFailedImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentHash = null, - Object? reason = freezed, - }) { - return _then(_$Event_PaymentFailedImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, - reason: freezed == reason - ? _value.reason - : reason // ignore: cast_nullable_to_non_nullable - as PaymentFailureReason?, - )); - } -} - -/// @nodoc - -class _$Event_PaymentFailedImpl implements Event_PaymentFailed { - const _$Event_PaymentFailedImpl({required this.paymentHash, this.reason}); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; - - /// The reason why the payment failed. - /// - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - @override - final PaymentFailureReason? reason; - - @override - String toString() { - return 'Event.paymentFailed(paymentHash: $paymentHash, reason: $reason)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Event_PaymentFailedImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash) && - (identical(other.reason, reason) || other.reason == reason)); - } - - @override - int get hashCode => Object.hash(runtimeType, paymentHash, reason); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => - __$$Event_PaymentFailedImplCopyWithImpl<_$Event_PaymentFailedImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentHash paymentHash, int? feePaidMsat) - paymentSuccessful, - required TResult Function( - PaymentHash paymentHash, PaymentFailureReason? reason) - paymentFailed, - required TResult Function(PaymentHash paymentHash, int amountMsat) - paymentReceived, - required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId) - channelReady, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason) - channelClosed, - }) { - return paymentFailed(paymentHash, reason); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult? Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - }) { - return paymentFailed?.call(paymentHash, reason); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - required TResult orElse(), - }) { - if (paymentFailed != null) { - return paymentFailed(paymentHash, reason); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, - required TResult Function(Event_PaymentFailed value) paymentFailed, - required TResult Function(Event_PaymentReceived value) paymentReceived, - required TResult Function(Event_ChannelPending value) channelPending, - required TResult Function(Event_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - }) { - return paymentFailed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult? Function(Event_PaymentFailed value)? paymentFailed, - TResult? Function(Event_PaymentReceived value)? paymentReceived, - TResult? Function(Event_ChannelPending value)? channelPending, - TResult? Function(Event_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - }) { - return paymentFailed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult Function(Event_PaymentFailed value)? paymentFailed, - TResult Function(Event_PaymentReceived value)? paymentReceived, - TResult Function(Event_ChannelPending value)? channelPending, - TResult Function(Event_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - required TResult orElse(), - }) { - if (paymentFailed != null) { - return paymentFailed(this); - } - return orElse(); - } -} - -abstract class Event_PaymentFailed implements Event { - const factory Event_PaymentFailed( - {required final PaymentHash paymentHash, - final PaymentFailureReason? reason}) = _$Event_PaymentFailedImpl; - - /// The hash of the payment. - PaymentHash get paymentHash; - - /// The reason why the payment failed. - /// - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - PaymentFailureReason? get reason; - @JsonKey(ignore: true) - _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$Event_PaymentReceivedImplCopyWith<$Res> { - factory _$$Event_PaymentReceivedImplCopyWith( - _$Event_PaymentReceivedImpl value, - $Res Function(_$Event_PaymentReceivedImpl) then) = - __$$Event_PaymentReceivedImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentHash paymentHash, int amountMsat}); -} - -/// @nodoc -class __$$Event_PaymentReceivedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_PaymentReceivedImpl> - implements _$$Event_PaymentReceivedImplCopyWith<$Res> { - __$$Event_PaymentReceivedImplCopyWithImpl(_$Event_PaymentReceivedImpl _value, - $Res Function(_$Event_PaymentReceivedImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentHash = null, - Object? amountMsat = null, - }) { - return _then(_$Event_PaymentReceivedImpl( - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, - amountMsat: null == amountMsat - ? _value.amountMsat - : amountMsat // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc - -class _$Event_PaymentReceivedImpl implements Event_PaymentReceived { - const _$Event_PaymentReceivedImpl( - {required this.paymentHash, required this.amountMsat}); - - /// The hash of the payment. - @override - final PaymentHash paymentHash; - - /// The value, in thousandths of a satoshi, that has been received. - @override - final int amountMsat; - - @override - String toString() { - return 'Event.paymentReceived(paymentHash: $paymentHash, amountMsat: $amountMsat)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Event_PaymentReceivedImpl && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash) && - (identical(other.amountMsat, amountMsat) || - other.amountMsat == amountMsat)); - } - - @override - int get hashCode => Object.hash(runtimeType, paymentHash, amountMsat); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> - get copyWith => __$$Event_PaymentReceivedImplCopyWithImpl< - _$Event_PaymentReceivedImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentHash paymentHash, int? feePaidMsat) - paymentSuccessful, - required TResult Function( - PaymentHash paymentHash, PaymentFailureReason? reason) - paymentFailed, - required TResult Function(PaymentHash paymentHash, int amountMsat) - paymentReceived, - required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId) - channelReady, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason) - channelClosed, - }) { - return paymentReceived(paymentHash, amountMsat); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult? Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - }) { - return paymentReceived?.call(paymentHash, amountMsat); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - required TResult orElse(), - }) { - if (paymentReceived != null) { - return paymentReceived(paymentHash, amountMsat); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, - required TResult Function(Event_PaymentFailed value) paymentFailed, - required TResult Function(Event_PaymentReceived value) paymentReceived, - required TResult Function(Event_ChannelPending value) channelPending, - required TResult Function(Event_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - }) { - return paymentReceived(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult? Function(Event_PaymentFailed value)? paymentFailed, - TResult? Function(Event_PaymentReceived value)? paymentReceived, - TResult? Function(Event_ChannelPending value)? channelPending, - TResult? Function(Event_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - }) { - return paymentReceived?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult Function(Event_PaymentFailed value)? paymentFailed, - TResult Function(Event_PaymentReceived value)? paymentReceived, - TResult Function(Event_ChannelPending value)? channelPending, - TResult Function(Event_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - required TResult orElse(), - }) { - if (paymentReceived != null) { - return paymentReceived(this); - } - return orElse(); - } -} - -abstract class Event_PaymentReceived implements Event { - const factory Event_PaymentReceived( - {required final PaymentHash paymentHash, - required final int amountMsat}) = _$Event_PaymentReceivedImpl; - - /// The hash of the payment. - PaymentHash get paymentHash; - - /// The value, in thousandths of a satoshi, that has been received. - int get amountMsat; - @JsonKey(ignore: true) - _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$Event_ChannelPendingImplCopyWith<$Res> { - factory _$$Event_ChannelPendingImplCopyWith(_$Event_ChannelPendingImpl value, - $Res Function(_$Event_ChannelPendingImpl) then) = - __$$Event_ChannelPendingImplCopyWithImpl<$Res>; - @useResult - $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo}); -} - -/// @nodoc -class __$$Event_ChannelPendingImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelPendingImpl> - implements _$$Event_ChannelPendingImplCopyWith<$Res> { - __$$Event_ChannelPendingImplCopyWithImpl(_$Event_ChannelPendingImpl _value, - $Res Function(_$Event_ChannelPendingImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? channelId = null, - Object? userChannelId = null, - Object? formerTemporaryChannelId = null, - Object? counterpartyNodeId = null, - Object? fundingTxo = null, - }) { - return _then(_$Event_ChannelPendingImpl( - channelId: null == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - userChannelId: null == userChannelId - ? _value.userChannelId - : userChannelId // ignore: cast_nullable_to_non_nullable - as UserChannelId, - formerTemporaryChannelId: null == formerTemporaryChannelId - ? _value.formerTemporaryChannelId - : formerTemporaryChannelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - counterpartyNodeId: null == counterpartyNodeId - ? _value.counterpartyNodeId - : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey, - fundingTxo: null == fundingTxo - ? _value.fundingTxo - : fundingTxo // ignore: cast_nullable_to_non_nullable - as OutPoint, - )); - } -} - -/// @nodoc - -class _$Event_ChannelPendingImpl implements Event_ChannelPending { - const _$Event_ChannelPendingImpl( - {required this.channelId, - required this.userChannelId, - required this.formerTemporaryChannelId, - required this.counterpartyNodeId, - required this.fundingTxo}); - - /// The `channel_id` of the channel. - @override - final ChannelId channelId; - - /// The `user_channel_id` of the channel. - @override - final UserChannelId userChannelId; - - /// The `temporary_channel_id` this channel used to be known by during channel establishment. - @override - final ChannelId formerTemporaryChannelId; - - /// The `node_id` of the channel counterparty. - @override - final PublicKey counterpartyNodeId; - - /// The outpoint of the channel's funding transaction. - @override - final OutPoint fundingTxo; - - @override - String toString() { - return 'Event.channelPending(channelId: $channelId, userChannelId: $userChannelId, formerTemporaryChannelId: $formerTemporaryChannelId, counterpartyNodeId: $counterpartyNodeId, fundingTxo: $fundingTxo)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Event_ChannelPendingImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.userChannelId, userChannelId) || - other.userChannelId == userChannelId) && - (identical( - other.formerTemporaryChannelId, formerTemporaryChannelId) || - other.formerTemporaryChannelId == formerTemporaryChannelId) && - (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.fundingTxo, fundingTxo) || - other.fundingTxo == fundingTxo)); - } - - @override - int get hashCode => Object.hash(runtimeType, channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> - get copyWith => - __$$Event_ChannelPendingImplCopyWithImpl<_$Event_ChannelPendingImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentHash paymentHash, int? feePaidMsat) - paymentSuccessful, - required TResult Function( - PaymentHash paymentHash, PaymentFailureReason? reason) - paymentFailed, - required TResult Function(PaymentHash paymentHash, int amountMsat) - paymentReceived, - required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId) - channelReady, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason) - channelClosed, - }) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult? Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - }) { - return channelPending?.call(channelId, userChannelId, - formerTemporaryChannelId, counterpartyNodeId, fundingTxo); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - required TResult orElse(), - }) { - if (channelPending != null) { - return channelPending(channelId, userChannelId, formerTemporaryChannelId, - counterpartyNodeId, fundingTxo); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, - required TResult Function(Event_PaymentFailed value) paymentFailed, - required TResult Function(Event_PaymentReceived value) paymentReceived, - required TResult Function(Event_ChannelPending value) channelPending, - required TResult Function(Event_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - }) { - return channelPending(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult? Function(Event_PaymentFailed value)? paymentFailed, - TResult? Function(Event_PaymentReceived value)? paymentReceived, - TResult? Function(Event_ChannelPending value)? channelPending, - TResult? Function(Event_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - }) { - return channelPending?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult Function(Event_PaymentFailed value)? paymentFailed, - TResult Function(Event_PaymentReceived value)? paymentReceived, - TResult Function(Event_ChannelPending value)? channelPending, - TResult Function(Event_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - required TResult orElse(), - }) { - if (channelPending != null) { - return channelPending(this); - } - return orElse(); - } -} - -abstract class Event_ChannelPending implements Event { - const factory Event_ChannelPending( - {required final ChannelId channelId, - required final UserChannelId userChannelId, - required final ChannelId formerTemporaryChannelId, - required final PublicKey counterpartyNodeId, - required final OutPoint fundingTxo}) = _$Event_ChannelPendingImpl; - - /// The `channel_id` of the channel. - ChannelId get channelId; - - /// The `user_channel_id` of the channel. - UserChannelId get userChannelId; - - /// The `temporary_channel_id` this channel used to be known by during channel establishment. - ChannelId get formerTemporaryChannelId; - - /// The `node_id` of the channel counterparty. - PublicKey get counterpartyNodeId; - - /// The outpoint of the channel's funding transaction. - OutPoint get fundingTxo; - @JsonKey(ignore: true) - _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$Event_ChannelReadyImplCopyWith<$Res> { - factory _$$Event_ChannelReadyImplCopyWith(_$Event_ChannelReadyImpl value, - $Res Function(_$Event_ChannelReadyImpl) then) = - __$$Event_ChannelReadyImplCopyWithImpl<$Res>; - @useResult - $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - PublicKey? counterpartyNodeId}); -} - -/// @nodoc -class __$$Event_ChannelReadyImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelReadyImpl> - implements _$$Event_ChannelReadyImplCopyWith<$Res> { - __$$Event_ChannelReadyImplCopyWithImpl(_$Event_ChannelReadyImpl _value, - $Res Function(_$Event_ChannelReadyImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? channelId = null, - Object? userChannelId = null, - Object? counterpartyNodeId = freezed, - }) { - return _then(_$Event_ChannelReadyImpl( - channelId: null == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - userChannelId: null == userChannelId - ? _value.userChannelId - : userChannelId // ignore: cast_nullable_to_non_nullable - as UserChannelId, - counterpartyNodeId: freezed == counterpartyNodeId - ? _value.counterpartyNodeId - : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey?, - )); - } -} - -/// @nodoc - -class _$Event_ChannelReadyImpl implements Event_ChannelReady { - const _$Event_ChannelReadyImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId}); - - /// The `channel_id` of the channel. - @override - final ChannelId channelId; - - /// The `user_channel_id` of the channel. - @override - final UserChannelId userChannelId; - - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. - @override - final PublicKey? counterpartyNodeId; - - @override - String toString() { - return 'Event.channelReady(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Event_ChannelReadyImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.userChannelId, userChannelId) || - other.userChannelId == userChannelId) && - (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId)); - } - - @override - int get hashCode => - Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => - __$$Event_ChannelReadyImplCopyWithImpl<_$Event_ChannelReadyImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentHash paymentHash, int? feePaidMsat) - paymentSuccessful, - required TResult Function( - PaymentHash paymentHash, PaymentFailureReason? reason) - paymentFailed, - required TResult Function(PaymentHash paymentHash, int amountMsat) - paymentReceived, - required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId) - channelReady, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason) - channelClosed, - }) { - return channelReady(channelId, userChannelId, counterpartyNodeId); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult? Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - }) { - return channelReady?.call(channelId, userChannelId, counterpartyNodeId); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - required TResult orElse(), - }) { - if (channelReady != null) { - return channelReady(channelId, userChannelId, counterpartyNodeId); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, - required TResult Function(Event_PaymentFailed value) paymentFailed, - required TResult Function(Event_PaymentReceived value) paymentReceived, - required TResult Function(Event_ChannelPending value) channelPending, - required TResult Function(Event_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - }) { - return channelReady(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult? Function(Event_PaymentFailed value)? paymentFailed, - TResult? Function(Event_PaymentReceived value)? paymentReceived, - TResult? Function(Event_ChannelPending value)? channelPending, - TResult? Function(Event_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - }) { - return channelReady?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult Function(Event_PaymentFailed value)? paymentFailed, - TResult Function(Event_PaymentReceived value)? paymentReceived, - TResult Function(Event_ChannelPending value)? channelPending, - TResult Function(Event_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - required TResult orElse(), - }) { - if (channelReady != null) { - return channelReady(this); - } - return orElse(); - } -} - -abstract class Event_ChannelReady implements Event { - const factory Event_ChannelReady( - {required final ChannelId channelId, - required final UserChannelId userChannelId, - final PublicKey? counterpartyNodeId}) = _$Event_ChannelReadyImpl; - - /// The `channel_id` of the channel. - ChannelId get channelId; - - /// The `user_channel_id` of the channel. - UserChannelId get userChannelId; - - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. - PublicKey? get counterpartyNodeId; - @JsonKey(ignore: true) - _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$Event_ChannelClosedImplCopyWith<$Res> { - factory _$$Event_ChannelClosedImplCopyWith(_$Event_ChannelClosedImpl value, - $Res Function(_$Event_ChannelClosedImpl) then) = - __$$Event_ChannelClosedImplCopyWithImpl<$Res>; - @useResult - $Res call( - {ChannelId channelId, - UserChannelId userChannelId, - PublicKey? counterpartyNodeId, - ClosureReason? reason}); - - $ClosureReasonCopyWith<$Res>? get reason; -} - -/// @nodoc -class __$$Event_ChannelClosedImplCopyWithImpl<$Res> - extends _$EventCopyWithImpl<$Res, _$Event_ChannelClosedImpl> - implements _$$Event_ChannelClosedImplCopyWith<$Res> { - __$$Event_ChannelClosedImplCopyWithImpl(_$Event_ChannelClosedImpl _value, - $Res Function(_$Event_ChannelClosedImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? channelId = null, - Object? userChannelId = null, - Object? counterpartyNodeId = freezed, - Object? reason = freezed, - }) { - return _then(_$Event_ChannelClosedImpl( - channelId: null == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - userChannelId: null == userChannelId - ? _value.userChannelId - : userChannelId // ignore: cast_nullable_to_non_nullable - as UserChannelId, - counterpartyNodeId: freezed == counterpartyNodeId - ? _value.counterpartyNodeId - : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey?, - reason: freezed == reason - ? _value.reason - : reason // ignore: cast_nullable_to_non_nullable - as ClosureReason?, - )); - } - - @override - @pragma('vm:prefer-inline') - $ClosureReasonCopyWith<$Res>? get reason { - if (_value.reason == null) { - return null; - } - - return $ClosureReasonCopyWith<$Res>(_value.reason!, (value) { - return _then(_value.copyWith(reason: value)); - }); - } -} - -/// @nodoc - -class _$Event_ChannelClosedImpl implements Event_ChannelClosed { - const _$Event_ChannelClosedImpl( - {required this.channelId, - required this.userChannelId, - this.counterpartyNodeId, - this.reason}); - - /// The `channel_id` of the channel. - @override - final ChannelId channelId; - - /// The `user_channel_id` of the channel. - @override - final UserChannelId userChannelId; - - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. - @override - final PublicKey? counterpartyNodeId; - - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - @override - final ClosureReason? reason; - - @override - String toString() { - return 'Event.channelClosed(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId, reason: $reason)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$Event_ChannelClosedImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.userChannelId, userChannelId) || - other.userChannelId == userChannelId) && - (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.reason, reason) || other.reason == reason)); - } - - @override - int get hashCode => Object.hash( - runtimeType, channelId, userChannelId, counterpartyNodeId, reason); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - __$$Event_ChannelClosedImplCopyWithImpl<_$Event_ChannelClosedImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentHash paymentHash, int? feePaidMsat) - paymentSuccessful, - required TResult Function( - PaymentHash paymentHash, PaymentFailureReason? reason) - paymentFailed, - required TResult Function(PaymentHash paymentHash, int amountMsat) - paymentReceived, - required TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo) - channelPending, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId) - channelReady, - required TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason) - channelClosed, - }) { - return channelClosed(channelId, userChannelId, counterpartyNodeId, reason); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult? Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult? Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult? Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - }) { - return channelClosed?.call( - channelId, userChannelId, counterpartyNodeId, reason); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentHash paymentHash, int? feePaidMsat)? - paymentSuccessful, - TResult Function(PaymentHash paymentHash, PaymentFailureReason? reason)? - paymentFailed, - TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, - TResult Function( - ChannelId channelId, - UserChannelId userChannelId, - ChannelId formerTemporaryChannelId, - PublicKey counterpartyNodeId, - OutPoint fundingTxo)? - channelPending, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId)? - channelReady, - TResult Function(ChannelId channelId, UserChannelId userChannelId, - PublicKey? counterpartyNodeId, ClosureReason? reason)? - channelClosed, - required TResult orElse(), - }) { - if (channelClosed != null) { - return channelClosed( - channelId, userChannelId, counterpartyNodeId, reason); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, - required TResult Function(Event_PaymentFailed value) paymentFailed, - required TResult Function(Event_PaymentReceived value) paymentReceived, - required TResult Function(Event_ChannelPending value) channelPending, - required TResult Function(Event_ChannelReady value) channelReady, - required TResult Function(Event_ChannelClosed value) channelClosed, - }) { - return channelClosed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult? Function(Event_PaymentFailed value)? paymentFailed, - TResult? Function(Event_PaymentReceived value)? paymentReceived, - TResult? Function(Event_ChannelPending value)? channelPending, - TResult? Function(Event_ChannelReady value)? channelReady, - TResult? Function(Event_ChannelClosed value)? channelClosed, - }) { - return channelClosed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, - TResult Function(Event_PaymentFailed value)? paymentFailed, - TResult Function(Event_PaymentReceived value)? paymentReceived, - TResult Function(Event_ChannelPending value)? channelPending, - TResult Function(Event_ChannelReady value)? channelReady, - TResult Function(Event_ChannelClosed value)? channelClosed, - required TResult orElse(), - }) { - if (channelClosed != null) { - return channelClosed(this); - } - return orElse(); - } -} - -abstract class Event_ChannelClosed implements Event { - const factory Event_ChannelClosed( - {required final ChannelId channelId, - required final UserChannelId userChannelId, - final PublicKey? counterpartyNodeId, - final ClosureReason? reason}) = _$Event_ChannelClosedImpl; - - /// The `channel_id` of the channel. - ChannelId get channelId; - - /// The `user_channel_id` of the channel. - UserChannelId get userChannelId; - - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. - PublicKey? get counterpartyNodeId; - - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - ClosureReason? get reason; - @JsonKey(ignore: true) - _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -mixin _$GossipSourceConfig { - @optionalTypeArgs - TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $GossipSourceConfigCopyWith<$Res> { - factory $GossipSourceConfigCopyWith( - GossipSourceConfig value, $Res Function(GossipSourceConfig) then) = - _$GossipSourceConfigCopyWithImpl<$Res, GossipSourceConfig>; -} - -/// @nodoc -class _$GossipSourceConfigCopyWithImpl<$Res, $Val extends GossipSourceConfig> - implements $GossipSourceConfigCopyWith<$Res> { - _$GossipSourceConfigCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; -} - -/// @nodoc -abstract class _$$GossipSourceConfig_P2PNetworkImplCopyWith<$Res> { - factory _$$GossipSourceConfig_P2PNetworkImplCopyWith( - _$GossipSourceConfig_P2PNetworkImpl value, - $Res Function(_$GossipSourceConfig_P2PNetworkImpl) then) = - __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl<$Res> - extends _$GossipSourceConfigCopyWithImpl<$Res, - _$GossipSourceConfig_P2PNetworkImpl> - implements _$$GossipSourceConfig_P2PNetworkImplCopyWith<$Res> { - __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl( - _$GossipSourceConfig_P2PNetworkImpl _value, - $Res Function(_$GossipSourceConfig_P2PNetworkImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$GossipSourceConfig_P2PNetworkImpl - implements GossipSourceConfig_P2PNetwork { - const _$GossipSourceConfig_P2PNetworkImpl(); - - @override - String toString() { - return 'GossipSourceConfig.p2PNetwork()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GossipSourceConfig_P2PNetworkImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, - }) { - return p2PNetwork(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, - }) { - return p2PNetwork?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, - required TResult orElse(), - }) { - if (p2PNetwork != null) { - return p2PNetwork(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, - }) { - return p2PNetwork(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, - }) { - return p2PNetwork?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, - required TResult orElse(), - }) { - if (p2PNetwork != null) { - return p2PNetwork(this); - } - return orElse(); - } -} - -abstract class GossipSourceConfig_P2PNetwork implements GossipSourceConfig { - const factory GossipSourceConfig_P2PNetwork() = - _$GossipSourceConfig_P2PNetworkImpl; -} - -/// @nodoc -abstract class _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - factory _$$GossipSourceConfig_RapidGossipSyncImplCopyWith( - _$GossipSourceConfig_RapidGossipSyncImpl value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) then) = - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res>; - @useResult - $Res call({String field0}); -} - -/// @nodoc -class __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res> - extends _$GossipSourceConfigCopyWithImpl<$Res, - _$GossipSourceConfig_RapidGossipSyncImpl> - implements _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { - __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl( - _$GossipSourceConfig_RapidGossipSyncImpl _value, - $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field0 = null, - }) { - return _then(_$GossipSourceConfig_RapidGossipSyncImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$GossipSourceConfig_RapidGossipSyncImpl - implements GossipSourceConfig_RapidGossipSync { - const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0); - - @override - final String field0; - - @override - String toString() { - return 'GossipSourceConfig.rapidGossipSync(field0: $field0)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GossipSourceConfig_RapidGossipSyncImpl && - (identical(other.field0, field0) || other.field0 == field0)); - } - - @override - int get hashCode => Object.hash(runtimeType, field0); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> - get copyWith => __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl< - _$GossipSourceConfig_RapidGossipSyncImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() p2PNetwork, - required TResult Function(String field0) rapidGossipSync, - }) { - return rapidGossipSync(field0); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? p2PNetwork, - TResult? Function(String field0)? rapidGossipSync, - }) { - return rapidGossipSync?.call(field0); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? p2PNetwork, - TResult Function(String field0)? rapidGossipSync, - required TResult orElse(), - }) { - if (rapidGossipSync != null) { - return rapidGossipSync(field0); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, - required TResult Function(GossipSourceConfig_RapidGossipSync value) - rapidGossipSync, - }) { - return rapidGossipSync(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult? Function(GossipSourceConfig_RapidGossipSync value)? - rapidGossipSync, - }) { - return rapidGossipSync?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, - TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, - required TResult orElse(), - }) { - if (rapidGossipSync != null) { - return rapidGossipSync(this); - } - return orElse(); - } -} - -abstract class GossipSourceConfig_RapidGossipSync - implements GossipSourceConfig { - const factory GossipSourceConfig_RapidGossipSync(final String field0) = - _$GossipSourceConfig_RapidGossipSyncImpl; - - String get field0; - @JsonKey(ignore: true) - _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< - _$GossipSourceConfig_RapidGossipSyncImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -mixin _$LightningBalance { - /// The identifier of the channel this balance belongs to. - ChannelId get channelId => throw _privateConstructorUsedError; - - /// The identifier of our channel counterparty. - PublicKey get counterpartyNodeId => throw _privateConstructorUsedError; - - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - int get amountSatoshis => throw _privateConstructorUsedError; +mixin _$Event { @optionalTypeArgs TResult when({ - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - claimableOnChannelClose, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) - claimableAwaitingConfirmations, + required TResult Function(PaymentHash paymentHash) paymentSuccessful, + required TResult Function(PaymentHash paymentHash) paymentFailed, + required TResult Function(PaymentHash paymentHash, int amountMsat) + paymentReceived, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelReady, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelClosed, required TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage) - contentiousClaimable, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) - maybeTimeoutClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) - maybePreimageClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo) + channelPending, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult? Function(PaymentHash paymentHash)? paymentSuccessful, + TResult? Function(PaymentHash paymentHash)? paymentFailed, + TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult? Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult Function(PaymentHash paymentHash)? paymentSuccessful, + TResult Function(PaymentHash paymentHash)? paymentFailed, + TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, required TResult orElse(), }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ - required TResult Function(LightningBalance_ClaimableOnChannelClose value) - claimableOnChannelClose, - required TResult Function( - LightningBalance_ClaimableAwaitingConfirmations value) - claimableAwaitingConfirmations, - required TResult Function(LightningBalance_ContentiousClaimable value) - contentiousClaimable, - required TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value) - maybeTimeoutClaimableHtlc, - required TResult Function(LightningBalance_MaybePreimageClaimableHTLC value) - maybePreimageClaimableHtlc, - required TResult Function( - LightningBalance_CounterpartyRevokedOutputClaimable value) - counterpartyRevokedOutputClaimable, + required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, + required TResult Function(Event_PaymentFailed value) paymentFailed, + required TResult Function(Event_PaymentReceived value) paymentReceived, + required TResult Function(Event_ChannelReady value) channelReady, + required TResult Function(Event_ChannelClosed value) channelClosed, + required TResult Function(Event_ChannelPending value) channelPending, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult? Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult? Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult? Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult? Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult? Function( - LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult? Function(Event_PaymentFailed value)? paymentFailed, + TResult? Function(Event_PaymentReceived value)? paymentReceived, + TResult? Function(Event_ChannelReady value)? channelReady, + TResult? Function(Event_ChannelClosed value)? channelClosed, + TResult? Function(Event_ChannelPending value)? channelPending, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult Function(LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult Function(Event_PaymentFailed value)? paymentFailed, + TResult Function(Event_PaymentReceived value)? paymentReceived, + TResult Function(Event_ChannelReady value)? channelReady, + TResult Function(Event_ChannelClosed value)? channelClosed, + TResult Function(Event_ChannelPending value)? channelPending, required TResult orElse(), }) => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $LightningBalanceCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $LightningBalanceCopyWith<$Res> { - factory $LightningBalanceCopyWith( - LightningBalance value, $Res Function(LightningBalance) then) = - _$LightningBalanceCopyWithImpl<$Res, LightningBalance>; - @useResult - $Res call( - {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); +abstract class $EventCopyWith<$Res> { + factory $EventCopyWith(Event value, $Res Function(Event) then) = + _$EventCopyWithImpl<$Res, Event>; } /// @nodoc -class _$LightningBalanceCopyWithImpl<$Res, $Val extends LightningBalance> - implements $LightningBalanceCopyWith<$Res> { - _$LightningBalanceCopyWithImpl(this._value, this._then); +class _$EventCopyWithImpl<$Res, $Val extends Event> + implements $EventCopyWith<$Res> { + _$EventCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? channelId = null, - Object? counterpartyNodeId = null, - Object? amountSatoshis = null, - }) { - return _then(_value.copyWith( - channelId: null == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - counterpartyNodeId: null == counterpartyNodeId - ? _value.counterpartyNodeId - : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } } /// @nodoc -abstract class _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith<$Res> - implements $LightningBalanceCopyWith<$Res> { - factory _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith( - _$LightningBalance_ClaimableOnChannelCloseImpl value, - $Res Function(_$LightningBalance_ClaimableOnChannelCloseImpl) then) = - __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl<$Res>; - @override +abstract class _$$Event_PaymentSuccessfulImplCopyWith<$Res> { + factory _$$Event_PaymentSuccessfulImplCopyWith( + _$Event_PaymentSuccessfulImpl value, + $Res Function(_$Event_PaymentSuccessfulImpl) then) = + __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res>; @useResult - $Res call( - {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); + $Res call({PaymentHash paymentHash}); } /// @nodoc -class __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl<$Res> - extends _$LightningBalanceCopyWithImpl<$Res, - _$LightningBalance_ClaimableOnChannelCloseImpl> - implements _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith<$Res> { - __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl( - _$LightningBalance_ClaimableOnChannelCloseImpl _value, - $Res Function(_$LightningBalance_ClaimableOnChannelCloseImpl) _then) +class __$$Event_PaymentSuccessfulImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_PaymentSuccessfulImpl> + implements _$$Event_PaymentSuccessfulImplCopyWith<$Res> { + __$$Event_PaymentSuccessfulImplCopyWithImpl( + _$Event_PaymentSuccessfulImpl _value, + $Res Function(_$Event_PaymentSuccessfulImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = null, - Object? counterpartyNodeId = null, - Object? amountSatoshis = null, + Object? paymentHash = null, }) { - return _then(_$LightningBalance_ClaimableOnChannelCloseImpl( - channelId: null == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - counterpartyNodeId: null == counterpartyNodeId - ? _value.counterpartyNodeId - : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + return _then(_$Event_PaymentSuccessfulImpl( + paymentHash: null == paymentHash + ? _value.paymentHash + : paymentHash // ignore: cast_nullable_to_non_nullable + as PaymentHash, )); } } /// @nodoc -class _$LightningBalance_ClaimableOnChannelCloseImpl - implements LightningBalance_ClaimableOnChannelClose { - const _$LightningBalance_ClaimableOnChannelCloseImpl( - {required this.channelId, - required this.counterpartyNodeId, - required this.amountSatoshis}); - - /// The identifier of the channel this balance belongs to. - @override - final ChannelId channelId; - - /// The identifier of our channel counterparty. - @override - final PublicKey counterpartyNodeId; +class _$Event_PaymentSuccessfulImpl extends Event_PaymentSuccessful { + const _$Event_PaymentSuccessfulImpl({required this.paymentHash}) : super._(); - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. + /// The hash of the payment. @override - final int amountSatoshis; + final PaymentHash paymentHash; @override String toString() { - return 'LightningBalance.claimableOnChannelClose(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + return 'Event.paymentSuccessful(paymentHash: $paymentHash)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LightningBalance_ClaimableOnChannelCloseImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis)); + other is _$Event_PaymentSuccessfulImpl && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash)); } @override - int get hashCode => - Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + int get hashCode => Object.hash(runtimeType, paymentHash); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< - _$LightningBalance_ClaimableOnChannelCloseImpl> - get copyWith => - __$$LightningBalance_ClaimableOnChannelCloseImplCopyWithImpl< - _$LightningBalance_ClaimableOnChannelCloseImpl>(this, _$identity); + _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> + get copyWith => __$$Event_PaymentSuccessfulImplCopyWithImpl< + _$Event_PaymentSuccessfulImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - claimableOnChannelClose, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) - claimableAwaitingConfirmations, + required TResult Function(PaymentHash paymentHash) paymentSuccessful, + required TResult Function(PaymentHash paymentHash) paymentFailed, + required TResult Function(PaymentHash paymentHash, int amountMsat) + paymentReceived, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelReady, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelClosed, required TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage) - contentiousClaimable, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) - maybeTimeoutClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) - maybePreimageClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo) + channelPending, }) { - return claimableOnChannelClose( - channelId, counterpartyNodeId, amountSatoshis); + return paymentSuccessful(paymentHash); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult? Function(PaymentHash paymentHash)? paymentSuccessful, + TResult? Function(PaymentHash paymentHash)? paymentFailed, + TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult? Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, }) { - return claimableOnChannelClose?.call( - channelId, counterpartyNodeId, amountSatoshis); + return paymentSuccessful?.call(paymentHash); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult Function(PaymentHash paymentHash)? paymentSuccessful, + TResult Function(PaymentHash paymentHash)? paymentFailed, + TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, required TResult orElse(), }) { - if (claimableOnChannelClose != null) { - return claimableOnChannelClose( - channelId, counterpartyNodeId, amountSatoshis); + if (paymentSuccessful != null) { + return paymentSuccessful(paymentHash); } return orElse(); } @@ -5057,311 +1018,193 @@ class _$LightningBalance_ClaimableOnChannelCloseImpl @override @optionalTypeArgs TResult map({ - required TResult Function(LightningBalance_ClaimableOnChannelClose value) - claimableOnChannelClose, - required TResult Function( - LightningBalance_ClaimableAwaitingConfirmations value) - claimableAwaitingConfirmations, - required TResult Function(LightningBalance_ContentiousClaimable value) - contentiousClaimable, - required TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value) - maybeTimeoutClaimableHtlc, - required TResult Function(LightningBalance_MaybePreimageClaimableHTLC value) - maybePreimageClaimableHtlc, - required TResult Function( - LightningBalance_CounterpartyRevokedOutputClaimable value) - counterpartyRevokedOutputClaimable, + required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, + required TResult Function(Event_PaymentFailed value) paymentFailed, + required TResult Function(Event_PaymentReceived value) paymentReceived, + required TResult Function(Event_ChannelReady value) channelReady, + required TResult Function(Event_ChannelClosed value) channelClosed, + required TResult Function(Event_ChannelPending value) channelPending, }) { - return claimableOnChannelClose(this); + return paymentSuccessful(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult? Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult? Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult? Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult? Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult? Function( - LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult? Function(Event_PaymentFailed value)? paymentFailed, + TResult? Function(Event_PaymentReceived value)? paymentReceived, + TResult? Function(Event_ChannelReady value)? channelReady, + TResult? Function(Event_ChannelClosed value)? channelClosed, + TResult? Function(Event_ChannelPending value)? channelPending, }) { - return claimableOnChannelClose?.call(this); + return paymentSuccessful?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult Function(LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult Function(Event_PaymentFailed value)? paymentFailed, + TResult Function(Event_PaymentReceived value)? paymentReceived, + TResult Function(Event_ChannelReady value)? channelReady, + TResult Function(Event_ChannelClosed value)? channelClosed, + TResult Function(Event_ChannelPending value)? channelPending, required TResult orElse(), }) { - if (claimableOnChannelClose != null) { - return claimableOnChannelClose(this); + if (paymentSuccessful != null) { + return paymentSuccessful(this); } return orElse(); } } -abstract class LightningBalance_ClaimableOnChannelClose - implements LightningBalance { - const factory LightningBalance_ClaimableOnChannelClose( - {required final ChannelId channelId, - required final PublicKey counterpartyNodeId, - required final int amountSatoshis}) = - _$LightningBalance_ClaimableOnChannelCloseImpl; - - @override - - /// The identifier of the channel this balance belongs to. - ChannelId get channelId; - @override - - /// The identifier of our channel counterparty. - PublicKey get counterpartyNodeId; - @override +abstract class Event_PaymentSuccessful extends Event { + const factory Event_PaymentSuccessful( + {required final PaymentHash paymentHash}) = _$Event_PaymentSuccessfulImpl; + const Event_PaymentSuccessful._() : super._(); - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - int get amountSatoshis; - @override + /// The hash of the payment. + PaymentHash get paymentHash; @JsonKey(ignore: true) - _$$LightningBalance_ClaimableOnChannelCloseImplCopyWith< - _$LightningBalance_ClaimableOnChannelCloseImpl> + _$$Event_PaymentSuccessfulImplCopyWith<_$Event_PaymentSuccessfulImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< - $Res> implements $LightningBalanceCopyWith<$Res> { - factory _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith( - _$LightningBalance_ClaimableAwaitingConfirmationsImpl value, - $Res Function(_$LightningBalance_ClaimableAwaitingConfirmationsImpl) - then) = - __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl<$Res>; - @override +abstract class _$$Event_PaymentFailedImplCopyWith<$Res> { + factory _$$Event_PaymentFailedImplCopyWith(_$Event_PaymentFailedImpl value, + $Res Function(_$Event_PaymentFailedImpl) then) = + __$$Event_PaymentFailedImplCopyWithImpl<$Res>; @useResult - $Res call( - {ChannelId channelId, - PublicKey counterpartyNodeId, - int amountSatoshis, - int confirmationHeight}); + $Res call({PaymentHash paymentHash}); } /// @nodoc -class __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl<$Res> - extends _$LightningBalanceCopyWithImpl<$Res, - _$LightningBalance_ClaimableAwaitingConfirmationsImpl> - implements - _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith<$Res> { - __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl( - _$LightningBalance_ClaimableAwaitingConfirmationsImpl _value, - $Res Function(_$LightningBalance_ClaimableAwaitingConfirmationsImpl) - _then) +class __$$Event_PaymentFailedImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_PaymentFailedImpl> + implements _$$Event_PaymentFailedImplCopyWith<$Res> { + __$$Event_PaymentFailedImplCopyWithImpl(_$Event_PaymentFailedImpl _value, + $Res Function(_$Event_PaymentFailedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = null, - Object? counterpartyNodeId = null, - Object? amountSatoshis = null, - Object? confirmationHeight = null, + Object? paymentHash = null, }) { - return _then(_$LightningBalance_ClaimableAwaitingConfirmationsImpl( - channelId: null == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - counterpartyNodeId: null == counterpartyNodeId - ? _value.counterpartyNodeId - : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, - confirmationHeight: null == confirmationHeight - ? _value.confirmationHeight - : confirmationHeight // ignore: cast_nullable_to_non_nullable - as int, + return _then(_$Event_PaymentFailedImpl( + paymentHash: null == paymentHash + ? _value.paymentHash + : paymentHash // ignore: cast_nullable_to_non_nullable + as PaymentHash, )); } } /// @nodoc -class _$LightningBalance_ClaimableAwaitingConfirmationsImpl - implements LightningBalance_ClaimableAwaitingConfirmations { - const _$LightningBalance_ClaimableAwaitingConfirmationsImpl( - {required this.channelId, - required this.counterpartyNodeId, - required this.amountSatoshis, - required this.confirmationHeight}); - - /// The identifier of the channel this balance belongs to. - @override - final ChannelId channelId; - - /// The identifier of our channel counterparty. - @override - final PublicKey counterpartyNodeId; - - /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which - /// were spent in broadcasting the transaction. - @override - final int amountSatoshis; +class _$Event_PaymentFailedImpl extends Event_PaymentFailed { + const _$Event_PaymentFailedImpl({required this.paymentHash}) : super._(); - /// The height at which an [`Event::SpendableOutputs`] event will be generated for this - /// amount. - /// - /// [`Event::SpendableOutputs`]: lightning::events::Event::SpendableOutputs + /// The hash of the payment. @override - final int confirmationHeight; + final PaymentHash paymentHash; @override String toString() { - return 'LightningBalance.claimableAwaitingConfirmations(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, confirmationHeight: $confirmationHeight)'; + return 'Event.paymentFailed(paymentHash: $paymentHash)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LightningBalance_ClaimableAwaitingConfirmationsImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis) && - (identical(other.confirmationHeight, confirmationHeight) || - other.confirmationHeight == confirmationHeight)); + other is _$Event_PaymentFailedImpl && + (identical(other.paymentHash, paymentHash) || + other.paymentHash == paymentHash)); } @override - int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, - amountSatoshis, confirmationHeight); + int get hashCode => Object.hash(runtimeType, paymentHash); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< - _$LightningBalance_ClaimableAwaitingConfirmationsImpl> - get copyWith => - __$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWithImpl< - _$LightningBalance_ClaimableAwaitingConfirmationsImpl>( - this, _$identity); + _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => + __$$Event_PaymentFailedImplCopyWithImpl<_$Event_PaymentFailedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - claimableOnChannelClose, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) - claimableAwaitingConfirmations, + required TResult Function(PaymentHash paymentHash) paymentSuccessful, + required TResult Function(PaymentHash paymentHash) paymentFailed, + required TResult Function(PaymentHash paymentHash, int amountMsat) + paymentReceived, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelReady, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelClosed, required TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage) - contentiousClaimable, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) - maybeTimeoutClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) - maybePreimageClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo) + channelPending, }) { - return claimableAwaitingConfirmations( - channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + return paymentFailed(paymentHash); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult? Function(PaymentHash paymentHash)? paymentSuccessful, + TResult? Function(PaymentHash paymentHash)? paymentFailed, + TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult? Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, }) { - return claimableAwaitingConfirmations?.call( - channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + return paymentFailed?.call(paymentHash); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult Function(PaymentHash paymentHash)? paymentSuccessful, + TResult Function(PaymentHash paymentHash)? paymentFailed, + TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, required TResult orElse(), }) { - if (claimableAwaitingConfirmations != null) { - return claimableAwaitingConfirmations( - channelId, counterpartyNodeId, amountSatoshis, confirmationHeight); + if (paymentFailed != null) { + return paymentFailed(paymentHash); } return orElse(); } @@ -5369,337 +1212,207 @@ class _$LightningBalance_ClaimableAwaitingConfirmationsImpl @override @optionalTypeArgs TResult map({ - required TResult Function(LightningBalance_ClaimableOnChannelClose value) - claimableOnChannelClose, - required TResult Function( - LightningBalance_ClaimableAwaitingConfirmations value) - claimableAwaitingConfirmations, - required TResult Function(LightningBalance_ContentiousClaimable value) - contentiousClaimable, - required TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value) - maybeTimeoutClaimableHtlc, - required TResult Function(LightningBalance_MaybePreimageClaimableHTLC value) - maybePreimageClaimableHtlc, - required TResult Function( - LightningBalance_CounterpartyRevokedOutputClaimable value) - counterpartyRevokedOutputClaimable, + required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, + required TResult Function(Event_PaymentFailed value) paymentFailed, + required TResult Function(Event_PaymentReceived value) paymentReceived, + required TResult Function(Event_ChannelReady value) channelReady, + required TResult Function(Event_ChannelClosed value) channelClosed, + required TResult Function(Event_ChannelPending value) channelPending, }) { - return claimableAwaitingConfirmations(this); + return paymentFailed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult? Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult? Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult? Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult? Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult? Function( - LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult? Function(Event_PaymentFailed value)? paymentFailed, + TResult? Function(Event_PaymentReceived value)? paymentReceived, + TResult? Function(Event_ChannelReady value)? channelReady, + TResult? Function(Event_ChannelClosed value)? channelClosed, + TResult? Function(Event_ChannelPending value)? channelPending, }) { - return claimableAwaitingConfirmations?.call(this); + return paymentFailed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult Function(LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult Function(Event_PaymentFailed value)? paymentFailed, + TResult Function(Event_PaymentReceived value)? paymentReceived, + TResult Function(Event_ChannelReady value)? channelReady, + TResult Function(Event_ChannelClosed value)? channelClosed, + TResult Function(Event_ChannelPending value)? channelPending, required TResult orElse(), }) { - if (claimableAwaitingConfirmations != null) { - return claimableAwaitingConfirmations(this); + if (paymentFailed != null) { + return paymentFailed(this); } return orElse(); } } -abstract class LightningBalance_ClaimableAwaitingConfirmations - implements LightningBalance { - const factory LightningBalance_ClaimableAwaitingConfirmations( - {required final ChannelId channelId, - required final PublicKey counterpartyNodeId, - required final int amountSatoshis, - required final int confirmationHeight}) = - _$LightningBalance_ClaimableAwaitingConfirmationsImpl; - - @override - - /// The identifier of the channel this balance belongs to. - ChannelId get channelId; - @override - - /// The identifier of our channel counterparty. - PublicKey get counterpartyNodeId; - @override +abstract class Event_PaymentFailed extends Event { + const factory Event_PaymentFailed({required final PaymentHash paymentHash}) = + _$Event_PaymentFailedImpl; + const Event_PaymentFailed._() : super._(); - /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which - /// were spent in broadcasting the transaction. - int get amountSatoshis; - - /// The height at which an [`Event::SpendableOutputs`] event will be generated for this - /// amount. - /// - /// [`Event::SpendableOutputs`]: lightning::events::Event::SpendableOutputs - int get confirmationHeight; - @override + /// The hash of the payment. + PaymentHash get paymentHash; @JsonKey(ignore: true) - _$$LightningBalance_ClaimableAwaitingConfirmationsImplCopyWith< - _$LightningBalance_ClaimableAwaitingConfirmationsImpl> - get copyWith => throw _privateConstructorUsedError; + _$$Event_PaymentFailedImplCopyWith<_$Event_PaymentFailedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LightningBalance_ContentiousClaimableImplCopyWith<$Res> - implements $LightningBalanceCopyWith<$Res> { - factory _$$LightningBalance_ContentiousClaimableImplCopyWith( - _$LightningBalance_ContentiousClaimableImpl value, - $Res Function(_$LightningBalance_ContentiousClaimableImpl) then) = - __$$LightningBalance_ContentiousClaimableImplCopyWithImpl<$Res>; - @override +abstract class _$$Event_PaymentReceivedImplCopyWith<$Res> { + factory _$$Event_PaymentReceivedImplCopyWith( + _$Event_PaymentReceivedImpl value, + $Res Function(_$Event_PaymentReceivedImpl) then) = + __$$Event_PaymentReceivedImplCopyWithImpl<$Res>; @useResult - $Res call( - {ChannelId channelId, - PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage}); + $Res call({PaymentHash paymentHash, int amountMsat}); } /// @nodoc -class __$$LightningBalance_ContentiousClaimableImplCopyWithImpl<$Res> - extends _$LightningBalanceCopyWithImpl<$Res, - _$LightningBalance_ContentiousClaimableImpl> - implements _$$LightningBalance_ContentiousClaimableImplCopyWith<$Res> { - __$$LightningBalance_ContentiousClaimableImplCopyWithImpl( - _$LightningBalance_ContentiousClaimableImpl _value, - $Res Function(_$LightningBalance_ContentiousClaimableImpl) _then) +class __$$Event_PaymentReceivedImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_PaymentReceivedImpl> + implements _$$Event_PaymentReceivedImplCopyWith<$Res> { + __$$Event_PaymentReceivedImplCopyWithImpl(_$Event_PaymentReceivedImpl _value, + $Res Function(_$Event_PaymentReceivedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = null, - Object? counterpartyNodeId = null, - Object? amountSatoshis = null, - Object? timeoutHeight = null, Object? paymentHash = null, - Object? paymentPreimage = null, + Object? amountMsat = null, }) { - return _then(_$LightningBalance_ContentiousClaimableImpl( - channelId: null == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId, - counterpartyNodeId: null == counterpartyNodeId - ? _value.counterpartyNodeId - : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, - timeoutHeight: null == timeoutHeight - ? _value.timeoutHeight - : timeoutHeight // ignore: cast_nullable_to_non_nullable - as int, + return _then(_$Event_PaymentReceivedImpl( paymentHash: null == paymentHash ? _value.paymentHash : paymentHash // ignore: cast_nullable_to_non_nullable as PaymentHash, - paymentPreimage: null == paymentPreimage - ? _value.paymentPreimage - : paymentPreimage // ignore: cast_nullable_to_non_nullable - as PaymentPreimage, + amountMsat: null == amountMsat + ? _value.amountMsat + : amountMsat // ignore: cast_nullable_to_non_nullable + as int, )); } } /// @nodoc -class _$LightningBalance_ContentiousClaimableImpl - implements LightningBalance_ContentiousClaimable { - const _$LightningBalance_ContentiousClaimableImpl( - {required this.channelId, - required this.counterpartyNodeId, - required this.amountSatoshis, - required this.timeoutHeight, - required this.paymentHash, - required this.paymentPreimage}); - - /// The identifier of the channel this balance belongs to. - @override - final ChannelId channelId; - - /// The identifier of our channel counterparty. - @override - final PublicKey counterpartyNodeId; - - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - @override - final int amountSatoshis; - - /// The height at which the counterparty may be able to claim the balance if we have not - /// done so. - @override - final int timeoutHeight; +class _$Event_PaymentReceivedImpl extends Event_PaymentReceived { + const _$Event_PaymentReceivedImpl( + {required this.paymentHash, required this.amountMsat}) + : super._(); - /// The payment hash that locks this HTLC. + /// The hash of the payment. @override final PaymentHash paymentHash; - /// The preimage that can be used to claim this HTLC. + /// The value, in thousandths of a satoshi, that has been received. @override - final PaymentPreimage paymentPreimage; + final int amountMsat; @override String toString() { - return 'LightningBalance.contentiousClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, timeoutHeight: $timeoutHeight, paymentHash: $paymentHash, paymentPreimage: $paymentPreimage)'; + return 'Event.paymentReceived(paymentHash: $paymentHash, amountMsat: $amountMsat)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LightningBalance_ContentiousClaimableImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis) && - (identical(other.timeoutHeight, timeoutHeight) || - other.timeoutHeight == timeoutHeight) && + other is _$Event_PaymentReceivedImpl && (identical(other.paymentHash, paymentHash) || other.paymentHash == paymentHash) && - (identical(other.paymentPreimage, paymentPreimage) || - other.paymentPreimage == paymentPreimage)); + (identical(other.amountMsat, amountMsat) || + other.amountMsat == amountMsat)); } @override - int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, - amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + int get hashCode => Object.hash(runtimeType, paymentHash, amountMsat); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LightningBalance_ContentiousClaimableImplCopyWith< - _$LightningBalance_ContentiousClaimableImpl> - get copyWith => __$$LightningBalance_ContentiousClaimableImplCopyWithImpl< - _$LightningBalance_ContentiousClaimableImpl>(this, _$identity); + _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> + get copyWith => __$$Event_PaymentReceivedImplCopyWithImpl< + _$Event_PaymentReceivedImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - claimableOnChannelClose, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) - claimableAwaitingConfirmations, + required TResult Function(PaymentHash paymentHash) paymentSuccessful, + required TResult Function(PaymentHash paymentHash) paymentFailed, + required TResult Function(PaymentHash paymentHash, int amountMsat) + paymentReceived, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelReady, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelClosed, required TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage) - contentiousClaimable, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) - maybeTimeoutClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) - maybePreimageClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo) + channelPending, }) { - return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, - timeoutHeight, paymentHash, paymentPreimage); + return paymentReceived(paymentHash, amountMsat); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult? Function(PaymentHash paymentHash)? paymentSuccessful, + TResult? Function(PaymentHash paymentHash)? paymentFailed, + TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult? Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, }) { - return contentiousClaimable?.call(channelId, counterpartyNodeId, - amountSatoshis, timeoutHeight, paymentHash, paymentPreimage); + return paymentReceived?.call(paymentHash, amountMsat); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult Function(PaymentHash paymentHash)? paymentSuccessful, + TResult Function(PaymentHash paymentHash)? paymentFailed, + TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, required TResult orElse(), }) { - if (contentiousClaimable != null) { - return contentiousClaimable(channelId, counterpartyNodeId, amountSatoshis, - timeoutHeight, paymentHash, paymentPreimage); + if (paymentReceived != null) { + return paymentReceived(paymentHash, amountMsat); } return orElse(); } @@ -5707,333 +1420,225 @@ class _$LightningBalance_ContentiousClaimableImpl @override @optionalTypeArgs TResult map({ - required TResult Function(LightningBalance_ClaimableOnChannelClose value) - claimableOnChannelClose, - required TResult Function( - LightningBalance_ClaimableAwaitingConfirmations value) - claimableAwaitingConfirmations, - required TResult Function(LightningBalance_ContentiousClaimable value) - contentiousClaimable, - required TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value) - maybeTimeoutClaimableHtlc, - required TResult Function(LightningBalance_MaybePreimageClaimableHTLC value) - maybePreimageClaimableHtlc, - required TResult Function( - LightningBalance_CounterpartyRevokedOutputClaimable value) - counterpartyRevokedOutputClaimable, + required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, + required TResult Function(Event_PaymentFailed value) paymentFailed, + required TResult Function(Event_PaymentReceived value) paymentReceived, + required TResult Function(Event_ChannelReady value) channelReady, + required TResult Function(Event_ChannelClosed value) channelClosed, + required TResult Function(Event_ChannelPending value) channelPending, }) { - return contentiousClaimable(this); + return paymentReceived(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult? Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult? Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult? Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult? Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult? Function( - LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult? Function(Event_PaymentFailed value)? paymentFailed, + TResult? Function(Event_PaymentReceived value)? paymentReceived, + TResult? Function(Event_ChannelReady value)? channelReady, + TResult? Function(Event_ChannelClosed value)? channelClosed, + TResult? Function(Event_ChannelPending value)? channelPending, }) { - return contentiousClaimable?.call(this); + return paymentReceived?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult Function(LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult Function(Event_PaymentFailed value)? paymentFailed, + TResult Function(Event_PaymentReceived value)? paymentReceived, + TResult Function(Event_ChannelReady value)? channelReady, + TResult Function(Event_ChannelClosed value)? channelClosed, + TResult Function(Event_ChannelPending value)? channelPending, required TResult orElse(), }) { - if (contentiousClaimable != null) { - return contentiousClaimable(this); + if (paymentReceived != null) { + return paymentReceived(this); } return orElse(); } } -abstract class LightningBalance_ContentiousClaimable - implements LightningBalance { - const factory LightningBalance_ContentiousClaimable( - {required final ChannelId channelId, - required final PublicKey counterpartyNodeId, - required final int amountSatoshis, - required final int timeoutHeight, - required final PaymentHash paymentHash, - required final PaymentPreimage paymentPreimage}) = - _$LightningBalance_ContentiousClaimableImpl; - - @override - - /// The identifier of the channel this balance belongs to. - ChannelId get channelId; - @override - - /// The identifier of our channel counterparty. - PublicKey get counterpartyNodeId; - @override - - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - int get amountSatoshis; - - /// The height at which the counterparty may be able to claim the balance if we have not - /// done so. - int get timeoutHeight; +abstract class Event_PaymentReceived extends Event { + const factory Event_PaymentReceived( + {required final PaymentHash paymentHash, + required final int amountMsat}) = _$Event_PaymentReceivedImpl; + const Event_PaymentReceived._() : super._(); - /// The payment hash that locks this HTLC. + /// The hash of the payment. PaymentHash get paymentHash; - /// The preimage that can be used to claim this HTLC. - PaymentPreimage get paymentPreimage; - @override + /// The value, in thousandths of a satoshi, that has been received. + int get amountMsat; @JsonKey(ignore: true) - _$$LightningBalance_ContentiousClaimableImplCopyWith< - _$LightningBalance_ContentiousClaimableImpl> + _$$Event_PaymentReceivedImplCopyWith<_$Event_PaymentReceivedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith<$Res> - implements $LightningBalanceCopyWith<$Res> { - factory _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith( - _$LightningBalance_MaybeTimeoutClaimableHTLCImpl value, - $Res Function(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl) - then) = - __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl<$Res>; - @override +abstract class _$$Event_ChannelReadyImplCopyWith<$Res> { + factory _$$Event_ChannelReadyImplCopyWith(_$Event_ChannelReadyImpl value, + $Res Function(_$Event_ChannelReadyImpl) then) = + __$$Event_ChannelReadyImplCopyWithImpl<$Res>; @useResult $Res call( {ChannelId channelId, - PublicKey counterpartyNodeId, - int amountSatoshis, - int claimableHeight, - PaymentHash paymentHash}); + UserChannelId userChannelId, + PublicKey? counterpartyNodeId}); } /// @nodoc -class __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl<$Res> - extends _$LightningBalanceCopyWithImpl<$Res, - _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> - implements _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith<$Res> { - __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl( - _$LightningBalance_MaybeTimeoutClaimableHTLCImpl _value, - $Res Function(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl) _then) +class __$$Event_ChannelReadyImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_ChannelReadyImpl> + implements _$$Event_ChannelReadyImplCopyWith<$Res> { + __$$Event_ChannelReadyImplCopyWithImpl(_$Event_ChannelReadyImpl _value, + $Res Function(_$Event_ChannelReadyImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ Object? channelId = null, - Object? counterpartyNodeId = null, - Object? amountSatoshis = null, - Object? claimableHeight = null, - Object? paymentHash = null, + Object? userChannelId = null, + Object? counterpartyNodeId = freezed, }) { - return _then(_$LightningBalance_MaybeTimeoutClaimableHTLCImpl( + return _then(_$Event_ChannelReadyImpl( channelId: null == channelId ? _value.channelId : channelId // ignore: cast_nullable_to_non_nullable as ChannelId, - counterpartyNodeId: null == counterpartyNodeId + userChannelId: null == userChannelId + ? _value.userChannelId + : userChannelId // ignore: cast_nullable_to_non_nullable + as UserChannelId, + counterpartyNodeId: freezed == counterpartyNodeId ? _value.counterpartyNodeId : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, - claimableHeight: null == claimableHeight - ? _value.claimableHeight - : claimableHeight // ignore: cast_nullable_to_non_nullable - as int, - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, + as PublicKey?, )); } } /// @nodoc -class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl - implements LightningBalance_MaybeTimeoutClaimableHTLC { - const _$LightningBalance_MaybeTimeoutClaimableHTLCImpl( +class _$Event_ChannelReadyImpl extends Event_ChannelReady { + const _$Event_ChannelReadyImpl( {required this.channelId, - required this.counterpartyNodeId, - required this.amountSatoshis, - required this.claimableHeight, - required this.paymentHash}); + required this.userChannelId, + this.counterpartyNodeId}) + : super._(); - /// The identifier of the channel this balance belongs to. + /// The channel_id of the channel. @override final ChannelId channelId; - /// The identifier of our channel counterparty. - @override - final PublicKey counterpartyNodeId; - - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - @override - final int amountSatoshis; - - /// The height at which we will be able to claim the balance if our counterparty has not - /// done so. + /// The user_channel_id of the channel. @override - final int claimableHeight; - - /// The payment hash whose preimage our counterparty needs to claim this HTLC. + final UserChannelId userChannelId; @override - final PaymentHash paymentHash; + final PublicKey? counterpartyNodeId; @override String toString() { - return 'LightningBalance.maybeTimeoutClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, claimableHeight: $claimableHeight, paymentHash: $paymentHash)'; + return 'Event.channelReady(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LightningBalance_MaybeTimeoutClaimableHTLCImpl && + other is _$Event_ChannelReadyImpl && (identical(other.channelId, channelId) || other.channelId == channelId) && + (identical(other.userChannelId, userChannelId) || + other.userChannelId == userChannelId) && (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis) && - (identical(other.claimableHeight, claimableHeight) || - other.claimableHeight == claimableHeight) && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other.counterpartyNodeId == counterpartyNodeId)); } @override - int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, - amountSatoshis, claimableHeight, paymentHash); + int get hashCode => + Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< - _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> - get copyWith => - __$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWithImpl< - _$LightningBalance_MaybeTimeoutClaimableHTLCImpl>( - this, _$identity); + _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => + __$$Event_ChannelReadyImplCopyWithImpl<_$Event_ChannelReadyImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - claimableOnChannelClose, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) - claimableAwaitingConfirmations, + required TResult Function(PaymentHash paymentHash) paymentSuccessful, + required TResult Function(PaymentHash paymentHash) paymentFailed, + required TResult Function(PaymentHash paymentHash, int amountMsat) + paymentReceived, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelReady, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelClosed, required TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage) - contentiousClaimable, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) - maybeTimeoutClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) - maybePreimageClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo) + channelPending, }) { - return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, - amountSatoshis, claimableHeight, paymentHash); + return channelReady(channelId, userChannelId, counterpartyNodeId); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult? Function(PaymentHash paymentHash)? paymentSuccessful, + TResult? Function(PaymentHash paymentHash)? paymentFailed, + TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult? Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, }) { - return maybeTimeoutClaimableHtlc?.call(channelId, counterpartyNodeId, - amountSatoshis, claimableHeight, paymentHash); + return channelReady?.call(channelId, userChannelId, counterpartyNodeId); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult Function(PaymentHash paymentHash)? paymentSuccessful, + TResult Function(PaymentHash paymentHash)? paymentFailed, + TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, required TResult orElse(), }) { - if (maybeTimeoutClaimableHtlc != null) { - return maybeTimeoutClaimableHtlc(channelId, counterpartyNodeId, - amountSatoshis, claimableHeight, paymentHash); + if (channelReady != null) { + return channelReady(channelId, userChannelId, counterpartyNodeId); } return orElse(); } @@ -6041,330 +1646,227 @@ class _$LightningBalance_MaybeTimeoutClaimableHTLCImpl @override @optionalTypeArgs TResult map({ - required TResult Function(LightningBalance_ClaimableOnChannelClose value) - claimableOnChannelClose, - required TResult Function( - LightningBalance_ClaimableAwaitingConfirmations value) - claimableAwaitingConfirmations, - required TResult Function(LightningBalance_ContentiousClaimable value) - contentiousClaimable, - required TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value) - maybeTimeoutClaimableHtlc, - required TResult Function(LightningBalance_MaybePreimageClaimableHTLC value) - maybePreimageClaimableHtlc, - required TResult Function( - LightningBalance_CounterpartyRevokedOutputClaimable value) - counterpartyRevokedOutputClaimable, + required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, + required TResult Function(Event_PaymentFailed value) paymentFailed, + required TResult Function(Event_PaymentReceived value) paymentReceived, + required TResult Function(Event_ChannelReady value) channelReady, + required TResult Function(Event_ChannelClosed value) channelClosed, + required TResult Function(Event_ChannelPending value) channelPending, }) { - return maybeTimeoutClaimableHtlc(this); + return channelReady(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult? Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult? Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult? Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult? Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult? Function( - LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult? Function(Event_PaymentFailed value)? paymentFailed, + TResult? Function(Event_PaymentReceived value)? paymentReceived, + TResult? Function(Event_ChannelReady value)? channelReady, + TResult? Function(Event_ChannelClosed value)? channelClosed, + TResult? Function(Event_ChannelPending value)? channelPending, }) { - return maybeTimeoutClaimableHtlc?.call(this); + return channelReady?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult Function(LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult Function(Event_PaymentFailed value)? paymentFailed, + TResult Function(Event_PaymentReceived value)? paymentReceived, + TResult Function(Event_ChannelReady value)? channelReady, + TResult Function(Event_ChannelClosed value)? channelClosed, + TResult Function(Event_ChannelPending value)? channelPending, required TResult orElse(), }) { - if (maybeTimeoutClaimableHtlc != null) { - return maybeTimeoutClaimableHtlc(this); + if (channelReady != null) { + return channelReady(this); } return orElse(); } } -abstract class LightningBalance_MaybeTimeoutClaimableHTLC - implements LightningBalance { - const factory LightningBalance_MaybeTimeoutClaimableHTLC( - {required final ChannelId channelId, - required final PublicKey counterpartyNodeId, - required final int amountSatoshis, - required final int claimableHeight, - required final PaymentHash paymentHash}) = - _$LightningBalance_MaybeTimeoutClaimableHTLCImpl; - - @override +abstract class Event_ChannelReady extends Event { + const factory Event_ChannelReady( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId}) = _$Event_ChannelReadyImpl; + const Event_ChannelReady._() : super._(); - /// The identifier of the channel this balance belongs to. + /// The channel_id of the channel. ChannelId get channelId; - @override - - /// The identifier of our channel counterparty. - PublicKey get counterpartyNodeId; - @override - - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - int get amountSatoshis; - /// The height at which we will be able to claim the balance if our counterparty has not - /// done so. - int get claimableHeight; - - /// The payment hash whose preimage our counterparty needs to claim this HTLC. - PaymentHash get paymentHash; - @override + /// The user_channel_id of the channel. + UserChannelId get userChannelId; + PublicKey? get counterpartyNodeId; @JsonKey(ignore: true) - _$$LightningBalance_MaybeTimeoutClaimableHTLCImplCopyWith< - _$LightningBalance_MaybeTimeoutClaimableHTLCImpl> - get copyWith => throw _privateConstructorUsedError; + _$$Event_ChannelReadyImplCopyWith<_$Event_ChannelReadyImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith<$Res> - implements $LightningBalanceCopyWith<$Res> { - factory _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith( - _$LightningBalance_MaybePreimageClaimableHTLCImpl value, - $Res Function(_$LightningBalance_MaybePreimageClaimableHTLCImpl) - then) = - __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl<$Res>; - @override +abstract class _$$Event_ChannelClosedImplCopyWith<$Res> { + factory _$$Event_ChannelClosedImplCopyWith(_$Event_ChannelClosedImpl value, + $Res Function(_$Event_ChannelClosedImpl) then) = + __$$Event_ChannelClosedImplCopyWithImpl<$Res>; @useResult $Res call( {ChannelId channelId, - PublicKey counterpartyNodeId, - int amountSatoshis, - int expiryHeight, - PaymentHash paymentHash}); + UserChannelId userChannelId, + PublicKey? counterpartyNodeId}); } /// @nodoc -class __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl<$Res> - extends _$LightningBalanceCopyWithImpl<$Res, - _$LightningBalance_MaybePreimageClaimableHTLCImpl> - implements - _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith<$Res> { - __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl( - _$LightningBalance_MaybePreimageClaimableHTLCImpl _value, - $Res Function(_$LightningBalance_MaybePreimageClaimableHTLCImpl) _then) +class __$$Event_ChannelClosedImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_ChannelClosedImpl> + implements _$$Event_ChannelClosedImplCopyWith<$Res> { + __$$Event_ChannelClosedImplCopyWithImpl(_$Event_ChannelClosedImpl _value, + $Res Function(_$Event_ChannelClosedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ Object? channelId = null, - Object? counterpartyNodeId = null, - Object? amountSatoshis = null, - Object? expiryHeight = null, - Object? paymentHash = null, + Object? userChannelId = null, + Object? counterpartyNodeId = freezed, }) { - return _then(_$LightningBalance_MaybePreimageClaimableHTLCImpl( + return _then(_$Event_ChannelClosedImpl( channelId: null == channelId ? _value.channelId : channelId // ignore: cast_nullable_to_non_nullable as ChannelId, - counterpartyNodeId: null == counterpartyNodeId + userChannelId: null == userChannelId + ? _value.userChannelId + : userChannelId // ignore: cast_nullable_to_non_nullable + as UserChannelId, + counterpartyNodeId: freezed == counterpartyNodeId ? _value.counterpartyNodeId : counterpartyNodeId // ignore: cast_nullable_to_non_nullable - as PublicKey, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, - expiryHeight: null == expiryHeight - ? _value.expiryHeight - : expiryHeight // ignore: cast_nullable_to_non_nullable - as int, - paymentHash: null == paymentHash - ? _value.paymentHash - : paymentHash // ignore: cast_nullable_to_non_nullable - as PaymentHash, + as PublicKey?, )); } } /// @nodoc -class _$LightningBalance_MaybePreimageClaimableHTLCImpl - implements LightningBalance_MaybePreimageClaimableHTLC { - const _$LightningBalance_MaybePreimageClaimableHTLCImpl( +class _$Event_ChannelClosedImpl extends Event_ChannelClosed { + const _$Event_ChannelClosedImpl( {required this.channelId, - required this.counterpartyNodeId, - required this.amountSatoshis, - required this.expiryHeight, - required this.paymentHash}); + required this.userChannelId, + this.counterpartyNodeId}) + : super._(); - /// The identifier of the channel this balance belongs to. + /// The channel_id of the channel. @override final ChannelId channelId; - /// The identifier of our channel counterparty. - @override - final PublicKey counterpartyNodeId; - - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - @override - final int amountSatoshis; - - /// The height at which our counterparty will be able to claim the balance if we have not - /// yet received the preimage and claimed it ourselves. + /// The user_channel_id of the channel. @override - final int expiryHeight; - - /// The payment hash whose preimage we need to claim this HTLC. + final UserChannelId userChannelId; @override - final PaymentHash paymentHash; + final PublicKey? counterpartyNodeId; @override String toString() { - return 'LightningBalance.maybePreimageClaimableHtlc(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis, expiryHeight: $expiryHeight, paymentHash: $paymentHash)'; + return 'Event.channelClosed(channelId: $channelId, userChannelId: $userChannelId, counterpartyNodeId: $counterpartyNodeId)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LightningBalance_MaybePreimageClaimableHTLCImpl && + other is _$Event_ChannelClosedImpl && (identical(other.channelId, channelId) || other.channelId == channelId) && + (identical(other.userChannelId, userChannelId) || + other.userChannelId == userChannelId) && (identical(other.counterpartyNodeId, counterpartyNodeId) || - other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis) && - (identical(other.expiryHeight, expiryHeight) || - other.expiryHeight == expiryHeight) && - (identical(other.paymentHash, paymentHash) || - other.paymentHash == paymentHash)); + other.counterpartyNodeId == counterpartyNodeId)); } @override - int get hashCode => Object.hash(runtimeType, channelId, counterpartyNodeId, - amountSatoshis, expiryHeight, paymentHash); + int get hashCode => + Object.hash(runtimeType, channelId, userChannelId, counterpartyNodeId); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< - _$LightningBalance_MaybePreimageClaimableHTLCImpl> - get copyWith => - __$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWithImpl< - _$LightningBalance_MaybePreimageClaimableHTLCImpl>( - this, _$identity); + _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => + __$$Event_ChannelClosedImplCopyWithImpl<_$Event_ChannelClosedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - claimableOnChannelClose, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) - claimableAwaitingConfirmations, + required TResult Function(PaymentHash paymentHash) paymentSuccessful, + required TResult Function(PaymentHash paymentHash) paymentFailed, + required TResult Function(PaymentHash paymentHash, int amountMsat) + paymentReceived, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelReady, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelClosed, required TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage) - contentiousClaimable, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) - maybeTimeoutClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) - maybePreimageClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo) + channelPending, }) { - return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, - amountSatoshis, expiryHeight, paymentHash); + return channelClosed(channelId, userChannelId, counterpartyNodeId); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult? Function(PaymentHash paymentHash)? paymentSuccessful, + TResult? Function(PaymentHash paymentHash)? paymentFailed, + TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult? Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, }) { - return maybePreimageClaimableHtlc?.call(channelId, counterpartyNodeId, - amountSatoshis, expiryHeight, paymentHash); + return channelClosed?.call(channelId, userChannelId, counterpartyNodeId); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult Function(PaymentHash paymentHash)? paymentSuccessful, + TResult Function(PaymentHash paymentHash)? paymentFailed, + TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, required TResult orElse(), }) { - if (maybePreimageClaimableHtlc != null) { - return maybePreimageClaimableHtlc(channelId, counterpartyNodeId, - amountSatoshis, expiryHeight, paymentHash); + if (channelClosed != null) { + return channelClosed(channelId, userChannelId, counterpartyNodeId); } return orElse(); } @@ -6372,306 +1874,260 @@ class _$LightningBalance_MaybePreimageClaimableHTLCImpl @override @optionalTypeArgs TResult map({ - required TResult Function(LightningBalance_ClaimableOnChannelClose value) - claimableOnChannelClose, - required TResult Function( - LightningBalance_ClaimableAwaitingConfirmations value) - claimableAwaitingConfirmations, - required TResult Function(LightningBalance_ContentiousClaimable value) - contentiousClaimable, - required TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value) - maybeTimeoutClaimableHtlc, - required TResult Function(LightningBalance_MaybePreimageClaimableHTLC value) - maybePreimageClaimableHtlc, - required TResult Function( - LightningBalance_CounterpartyRevokedOutputClaimable value) - counterpartyRevokedOutputClaimable, + required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, + required TResult Function(Event_PaymentFailed value) paymentFailed, + required TResult Function(Event_PaymentReceived value) paymentReceived, + required TResult Function(Event_ChannelReady value) channelReady, + required TResult Function(Event_ChannelClosed value) channelClosed, + required TResult Function(Event_ChannelPending value) channelPending, }) { - return maybePreimageClaimableHtlc(this); + return channelClosed(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult? Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult? Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult? Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult? Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult? Function( - LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult? Function(Event_PaymentFailed value)? paymentFailed, + TResult? Function(Event_PaymentReceived value)? paymentReceived, + TResult? Function(Event_ChannelReady value)? channelReady, + TResult? Function(Event_ChannelClosed value)? channelClosed, + TResult? Function(Event_ChannelPending value)? channelPending, }) { - return maybePreimageClaimableHtlc?.call(this); + return channelClosed?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult Function(LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult Function(Event_PaymentFailed value)? paymentFailed, + TResult Function(Event_PaymentReceived value)? paymentReceived, + TResult Function(Event_ChannelReady value)? channelReady, + TResult Function(Event_ChannelClosed value)? channelClosed, + TResult Function(Event_ChannelPending value)? channelPending, required TResult orElse(), }) { - if (maybePreimageClaimableHtlc != null) { - return maybePreimageClaimableHtlc(this); + if (channelClosed != null) { + return channelClosed(this); } return orElse(); } } -abstract class LightningBalance_MaybePreimageClaimableHTLC - implements LightningBalance { - const factory LightningBalance_MaybePreimageClaimableHTLC( - {required final ChannelId channelId, - required final PublicKey counterpartyNodeId, - required final int amountSatoshis, - required final int expiryHeight, - required final PaymentHash paymentHash}) = - _$LightningBalance_MaybePreimageClaimableHTLCImpl; - - @override +abstract class Event_ChannelClosed extends Event { + const factory Event_ChannelClosed( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + final PublicKey? counterpartyNodeId}) = _$Event_ChannelClosedImpl; + const Event_ChannelClosed._() : super._(); - /// The identifier of the channel this balance belongs to. + /// The channel_id of the channel. ChannelId get channelId; - @override - - /// The identifier of our channel counterparty. - PublicKey get counterpartyNodeId; - @override - - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - int get amountSatoshis; - /// The height at which our counterparty will be able to claim the balance if we have not - /// yet received the preimage and claimed it ourselves. - int get expiryHeight; - - /// The payment hash whose preimage we need to claim this HTLC. - PaymentHash get paymentHash; - @override + /// The user_channel_id of the channel. + UserChannelId get userChannelId; + PublicKey? get counterpartyNodeId; @JsonKey(ignore: true) - _$$LightningBalance_MaybePreimageClaimableHTLCImplCopyWith< - _$LightningBalance_MaybePreimageClaimableHTLCImpl> - get copyWith => throw _privateConstructorUsedError; + _$$Event_ChannelClosedImplCopyWith<_$Event_ChannelClosedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< - $Res> implements $LightningBalanceCopyWith<$Res> { - factory _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith( - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl value, - $Res Function( - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl) - then) = - __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< - $Res>; - @override +abstract class _$$Event_ChannelPendingImplCopyWith<$Res> { + factory _$$Event_ChannelPendingImplCopyWith(_$Event_ChannelPendingImpl value, + $Res Function(_$Event_ChannelPendingImpl) then) = + __$$Event_ChannelPendingImplCopyWithImpl<$Res>; @useResult $Res call( - {ChannelId channelId, PublicKey counterpartyNodeId, int amountSatoshis}); + {ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, + PublicKey counterpartyNodeId, + OutPoint fundingTxo}); } /// @nodoc -class __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< - $Res> - extends _$LightningBalanceCopyWithImpl<$Res, - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> - implements - _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< - $Res> { - __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl( - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl _value, - $Res Function(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl) - _then) +class __$$Event_ChannelPendingImplCopyWithImpl<$Res> + extends _$EventCopyWithImpl<$Res, _$Event_ChannelPendingImpl> + implements _$$Event_ChannelPendingImplCopyWith<$Res> { + __$$Event_ChannelPendingImplCopyWithImpl(_$Event_ChannelPendingImpl _value, + $Res Function(_$Event_ChannelPendingImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ Object? channelId = null, + Object? userChannelId = null, + Object? formerTemporaryChannelId = null, Object? counterpartyNodeId = null, - Object? amountSatoshis = null, + Object? fundingTxo = null, }) { - return _then(_$LightningBalance_CounterpartyRevokedOutputClaimableImpl( + return _then(_$Event_ChannelPendingImpl( channelId: null == channelId ? _value.channelId : channelId // ignore: cast_nullable_to_non_nullable as ChannelId, + userChannelId: null == userChannelId + ? _value.userChannelId + : userChannelId // ignore: cast_nullable_to_non_nullable + as UserChannelId, + formerTemporaryChannelId: null == formerTemporaryChannelId + ? _value.formerTemporaryChannelId + : formerTemporaryChannelId // ignore: cast_nullable_to_non_nullable + as ChannelId, counterpartyNodeId: null == counterpartyNodeId ? _value.counterpartyNodeId : counterpartyNodeId // ignore: cast_nullable_to_non_nullable as PublicKey, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, + fundingTxo: null == fundingTxo + ? _value.fundingTxo + : fundingTxo // ignore: cast_nullable_to_non_nullable + as OutPoint, )); } } /// @nodoc -class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl - implements LightningBalance_CounterpartyRevokedOutputClaimable { - const _$LightningBalance_CounterpartyRevokedOutputClaimableImpl( +class _$Event_ChannelPendingImpl extends Event_ChannelPending { + const _$Event_ChannelPendingImpl( {required this.channelId, + required this.userChannelId, + required this.formerTemporaryChannelId, required this.counterpartyNodeId, - required this.amountSatoshis}); + required this.fundingTxo}) + : super._(); - /// The identifier of the channel this balance belongs to. + /// The channel_id of the channel. @override final ChannelId channelId; - /// The identifier of our channel counterparty. + /// The user_channel_id of the channel. + @override + final UserChannelId userChannelId; + + /// The temporary_channel_id this channel used to be known by during channel establishment. + @override + final ChannelId formerTemporaryChannelId; + + /// The node_id of the channel counterparty. @override final PublicKey counterpartyNodeId; - /// The amount, in satoshis, of the output which we can claim. + /// The outpoint of the channel's funding transaction. @override - final int amountSatoshis; + final OutPoint fundingTxo; @override String toString() { - return 'LightningBalance.counterpartyRevokedOutputClaimable(channelId: $channelId, counterpartyNodeId: $counterpartyNodeId, amountSatoshis: $amountSatoshis)'; + return 'Event.channelPending(channelId: $channelId, userChannelId: $userChannelId, formerTemporaryChannelId: $formerTemporaryChannelId, counterpartyNodeId: $counterpartyNodeId, fundingTxo: $fundingTxo)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other - is _$LightningBalance_CounterpartyRevokedOutputClaimableImpl && + other is _$Event_ChannelPendingImpl && (identical(other.channelId, channelId) || other.channelId == channelId) && + (identical(other.userChannelId, userChannelId) || + other.userChannelId == userChannelId) && + (identical( + other.formerTemporaryChannelId, formerTemporaryChannelId) || + other.formerTemporaryChannelId == formerTemporaryChannelId) && (identical(other.counterpartyNodeId, counterpartyNodeId) || other.counterpartyNodeId == counterpartyNodeId) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis)); + (identical(other.fundingTxo, fundingTxo) || + other.fundingTxo == fundingTxo)); } @override - int get hashCode => - Object.hash(runtimeType, channelId, counterpartyNodeId, amountSatoshis); + int get hashCode => Object.hash(runtimeType, channelId, userChannelId, + formerTemporaryChannelId, counterpartyNodeId, fundingTxo); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> get copyWith => - __$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWithImpl< - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl>( + __$$Event_ChannelPendingImplCopyWithImpl<_$Event_ChannelPendingImpl>( this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - claimableOnChannelClose, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight) - claimableAwaitingConfirmations, + required TResult Function(PaymentHash paymentHash) paymentSuccessful, + required TResult Function(PaymentHash paymentHash) paymentFailed, + required TResult Function(PaymentHash paymentHash, int amountMsat) + paymentReceived, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelReady, + required TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId) + channelClosed, required TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage) - contentiousClaimable, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash) - maybeTimeoutClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash) - maybePreimageClaimableHtlc, - required TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis) - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo) + channelPending, }) { - return counterpartyRevokedOutputClaimable( - channelId, counterpartyNodeId, amountSatoshis); + return channelPending(channelId, userChannelId, formerTemporaryChannelId, + counterpartyNodeId, fundingTxo); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult? Function(PaymentHash paymentHash)? paymentSuccessful, + TResult? Function(PaymentHash paymentHash)? paymentFailed, + TResult? Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult? Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult? Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult? Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, }) { - return counterpartyRevokedOutputClaimable?.call( - channelId, counterpartyNodeId, amountSatoshis); + return channelPending?.call(channelId, userChannelId, + formerTemporaryChannelId, counterpartyNodeId, fundingTxo); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - claimableOnChannelClose, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int confirmationHeight)? - claimableAwaitingConfirmations, + TResult Function(PaymentHash paymentHash)? paymentSuccessful, + TResult Function(PaymentHash paymentHash)? paymentFailed, + TResult Function(PaymentHash paymentHash, int amountMsat)? paymentReceived, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelReady, + TResult Function(ChannelId channelId, UserChannelId userChannelId, + PublicKey? counterpartyNodeId)? + channelClosed, TResult Function( ChannelId channelId, + UserChannelId userChannelId, + ChannelId formerTemporaryChannelId, PublicKey counterpartyNodeId, - int amountSatoshis, - int timeoutHeight, - PaymentHash paymentHash, - PaymentPreimage paymentPreimage)? - contentiousClaimable, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int claimableHeight, PaymentHash paymentHash)? - maybeTimeoutClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis, int expiryHeight, PaymentHash paymentHash)? - maybePreimageClaimableHtlc, - TResult Function(ChannelId channelId, PublicKey counterpartyNodeId, - int amountSatoshis)? - counterpartyRevokedOutputClaimable, + OutPoint fundingTxo)? + channelPending, required TResult orElse(), }) { - if (counterpartyRevokedOutputClaimable != null) { - return counterpartyRevokedOutputClaimable( - channelId, counterpartyNodeId, amountSatoshis); + if (channelPending != null) { + return channelPending(channelId, userChannelId, formerTemporaryChannelId, + counterpartyNodeId, fundingTxo); } return orElse(); } @@ -6679,275 +2135,204 @@ class _$LightningBalance_CounterpartyRevokedOutputClaimableImpl @override @optionalTypeArgs TResult map({ - required TResult Function(LightningBalance_ClaimableOnChannelClose value) - claimableOnChannelClose, - required TResult Function( - LightningBalance_ClaimableAwaitingConfirmations value) - claimableAwaitingConfirmations, - required TResult Function(LightningBalance_ContentiousClaimable value) - contentiousClaimable, - required TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value) - maybeTimeoutClaimableHtlc, - required TResult Function(LightningBalance_MaybePreimageClaimableHTLC value) - maybePreimageClaimableHtlc, - required TResult Function( - LightningBalance_CounterpartyRevokedOutputClaimable value) - counterpartyRevokedOutputClaimable, + required TResult Function(Event_PaymentSuccessful value) paymentSuccessful, + required TResult Function(Event_PaymentFailed value) paymentFailed, + required TResult Function(Event_PaymentReceived value) paymentReceived, + required TResult Function(Event_ChannelReady value) channelReady, + required TResult Function(Event_ChannelClosed value) channelClosed, + required TResult Function(Event_ChannelPending value) channelPending, }) { - return counterpartyRevokedOutputClaimable(this); + return channelPending(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult? Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult? Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult? Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult? Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult? Function( - LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult? Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult? Function(Event_PaymentFailed value)? paymentFailed, + TResult? Function(Event_PaymentReceived value)? paymentReceived, + TResult? Function(Event_ChannelReady value)? channelReady, + TResult? Function(Event_ChannelClosed value)? channelClosed, + TResult? Function(Event_ChannelPending value)? channelPending, }) { - return counterpartyRevokedOutputClaimable?.call(this); + return channelPending?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(LightningBalance_ClaimableOnChannelClose value)? - claimableOnChannelClose, - TResult Function(LightningBalance_ClaimableAwaitingConfirmations value)? - claimableAwaitingConfirmations, - TResult Function(LightningBalance_ContentiousClaimable value)? - contentiousClaimable, - TResult Function(LightningBalance_MaybeTimeoutClaimableHTLC value)? - maybeTimeoutClaimableHtlc, - TResult Function(LightningBalance_MaybePreimageClaimableHTLC value)? - maybePreimageClaimableHtlc, - TResult Function(LightningBalance_CounterpartyRevokedOutputClaimable value)? - counterpartyRevokedOutputClaimable, + TResult Function(Event_PaymentSuccessful value)? paymentSuccessful, + TResult Function(Event_PaymentFailed value)? paymentFailed, + TResult Function(Event_PaymentReceived value)? paymentReceived, + TResult Function(Event_ChannelReady value)? channelReady, + TResult Function(Event_ChannelClosed value)? channelClosed, + TResult Function(Event_ChannelPending value)? channelPending, required TResult orElse(), }) { - if (counterpartyRevokedOutputClaimable != null) { - return counterpartyRevokedOutputClaimable(this); + if (channelPending != null) { + return channelPending(this); } return orElse(); } } -abstract class LightningBalance_CounterpartyRevokedOutputClaimable - implements LightningBalance { - const factory LightningBalance_CounterpartyRevokedOutputClaimable( - {required final ChannelId channelId, - required final PublicKey counterpartyNodeId, - required final int amountSatoshis}) = - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl; - - @override +abstract class Event_ChannelPending extends Event { + const factory Event_ChannelPending( + {required final ChannelId channelId, + required final UserChannelId userChannelId, + required final ChannelId formerTemporaryChannelId, + required final PublicKey counterpartyNodeId, + required final OutPoint fundingTxo}) = _$Event_ChannelPendingImpl; + const Event_ChannelPending._() : super._(); - /// The identifier of the channel this balance belongs to. + /// The channel_id of the channel. ChannelId get channelId; - @override - /// The identifier of our channel counterparty. + /// The user_channel_id of the channel. + UserChannelId get userChannelId; + + /// The temporary_channel_id this channel used to be known by during channel establishment. + ChannelId get formerTemporaryChannelId; + + /// The node_id of the channel counterparty. PublicKey get counterpartyNodeId; - @override - /// The amount, in satoshis, of the output which we can claim. - int get amountSatoshis; - @override + /// The outpoint of the channel's funding transaction. + OutPoint get fundingTxo; @JsonKey(ignore: true) - _$$LightningBalance_CounterpartyRevokedOutputClaimableImplCopyWith< - _$LightningBalance_CounterpartyRevokedOutputClaimableImpl> + _$$Event_ChannelPendingImplCopyWith<_$Event_ChannelPendingImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -mixin _$MaxDustHTLCExposure { - int get field0 => throw _privateConstructorUsedError; +mixin _$GossipSourceConfig { @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function() p2PNetwork, + required TResult Function(String field0) rapidGossipSync, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function()? p2PNetwork, + TResult? Function(String field0)? rapidGossipSync, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function()? p2PNetwork, + TResult Function(String field0)? rapidGossipSync, required TResult orElse(), }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, + required TResult Function(GossipSourceConfig_RapidGossipSync value) + rapidGossipSync, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, + TResult? Function(GossipSourceConfig_RapidGossipSync value)? + rapidGossipSync, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, + TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, required TResult orElse(), }) => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $MaxDustHTLCExposureCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $MaxDustHTLCExposureCopyWith<$Res> { - factory $MaxDustHTLCExposureCopyWith( - MaxDustHTLCExposure value, $Res Function(MaxDustHTLCExposure) then) = - _$MaxDustHTLCExposureCopyWithImpl<$Res, MaxDustHTLCExposure>; - @useResult - $Res call({int field0}); +abstract class $GossipSourceConfigCopyWith<$Res> { + factory $GossipSourceConfigCopyWith( + GossipSourceConfig value, $Res Function(GossipSourceConfig) then) = + _$GossipSourceConfigCopyWithImpl<$Res, GossipSourceConfig>; } /// @nodoc -class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> - implements $MaxDustHTLCExposureCopyWith<$Res> { - _$MaxDustHTLCExposureCopyWithImpl(this._value, this._then); +class _$GossipSourceConfigCopyWithImpl<$Res, $Val extends GossipSourceConfig> + implements $GossipSourceConfigCopyWith<$Res> { + _$GossipSourceConfigCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field0 = null, - }) { - return _then(_value.copyWith( - field0: null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } } /// @nodoc -abstract class _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith<$Res> - implements $MaxDustHTLCExposureCopyWith<$Res> { - factory _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith( - _$MaxDustHTLCExposure_FixedLimitMsatImpl value, - $Res Function(_$MaxDustHTLCExposure_FixedLimitMsatImpl) then) = - __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int field0}); +abstract class _$$GossipSourceConfig_P2PNetworkImplCopyWith<$Res> { + factory _$$GossipSourceConfig_P2PNetworkImplCopyWith( + _$GossipSourceConfig_P2PNetworkImpl value, + $Res Function(_$GossipSourceConfig_P2PNetworkImpl) then) = + __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl<$Res>; } /// @nodoc -class __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res> - extends _$MaxDustHTLCExposureCopyWithImpl<$Res, - _$MaxDustHTLCExposure_FixedLimitMsatImpl> - implements _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith<$Res> { - __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl( - _$MaxDustHTLCExposure_FixedLimitMsatImpl _value, - $Res Function(_$MaxDustHTLCExposure_FixedLimitMsatImpl) _then) +class __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl<$Res> + extends _$GossipSourceConfigCopyWithImpl<$Res, + _$GossipSourceConfig_P2PNetworkImpl> + implements _$$GossipSourceConfig_P2PNetworkImplCopyWith<$Res> { + __$$GossipSourceConfig_P2PNetworkImplCopyWithImpl( + _$GossipSourceConfig_P2PNetworkImpl _value, + $Res Function(_$GossipSourceConfig_P2PNetworkImpl) _then) : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field0 = null, - }) { - return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( - null == field0 - ? _value.field0 - : field0 // ignore: cast_nullable_to_non_nullable - as int, - )); - } } /// @nodoc -class _$MaxDustHTLCExposure_FixedLimitMsatImpl - implements MaxDustHTLCExposure_FixedLimitMsat { - const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0); - - @override - final int field0; +class _$GossipSourceConfig_P2PNetworkImpl + extends GossipSourceConfig_P2PNetwork { + const _$GossipSourceConfig_P2PNetworkImpl() : super._(); @override String toString() { - return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; + return 'GossipSourceConfig.p2PNetwork()'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$MaxDustHTLCExposure_FixedLimitMsatImpl && - (identical(other.field0, field0) || other.field0 == field0)); + other is _$GossipSourceConfig_P2PNetworkImpl); } @override - int get hashCode => Object.hash(runtimeType, field0); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> - get copyWith => __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl< - _$MaxDustHTLCExposure_FixedLimitMsatImpl>(this, _$identity); + int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function() p2PNetwork, + required TResult Function(String field0) rapidGossipSync, }) { - return fixedLimitMsat(field0); + return p2PNetwork(); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function()? p2PNetwork, + TResult? Function(String field0)? rapidGossipSync, }) { - return fixedLimitMsat?.call(field0); + return p2PNetwork?.call(); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function()? p2PNetwork, + TResult Function(String field0)? rapidGossipSync, required TResult orElse(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(field0); + if (p2PNetwork != null) { + return p2PNetwork(); } return orElse(); } @@ -6955,73 +2340,61 @@ class _$MaxDustHTLCExposure_FixedLimitMsatImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, + required TResult Function(GossipSourceConfig_RapidGossipSync value) + rapidGossipSync, }) { - return fixedLimitMsat(this); + return p2PNetwork(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, + TResult? Function(GossipSourceConfig_RapidGossipSync value)? + rapidGossipSync, }) { - return fixedLimitMsat?.call(this); + return p2PNetwork?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, + TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, required TResult orElse(), }) { - if (fixedLimitMsat != null) { - return fixedLimitMsat(this); + if (p2PNetwork != null) { + return p2PNetwork(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FixedLimitMsat - implements MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FixedLimitMsat(final int field0) = - _$MaxDustHTLCExposure_FixedLimitMsatImpl; - - @override - int get field0; - @override - @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< - _$MaxDustHTLCExposure_FixedLimitMsatImpl> - get copyWith => throw _privateConstructorUsedError; +abstract class GossipSourceConfig_P2PNetwork extends GossipSourceConfig { + const factory GossipSourceConfig_P2PNetwork() = + _$GossipSourceConfig_P2PNetworkImpl; + const GossipSourceConfig_P2PNetwork._() : super._(); } /// @nodoc -abstract class _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> - implements $MaxDustHTLCExposureCopyWith<$Res> { - factory _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith( - _$MaxDustHTLCExposure_FeeRateMultiplierImpl value, - $Res Function(_$MaxDustHTLCExposure_FeeRateMultiplierImpl) then) = - __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res>; - @override +abstract class _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { + factory _$$GossipSourceConfig_RapidGossipSyncImplCopyWith( + _$GossipSourceConfig_RapidGossipSyncImpl value, + $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) then) = + __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res>; @useResult - $Res call({int field0}); + $Res call({String field0}); } /// @nodoc -class __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res> - extends _$MaxDustHTLCExposureCopyWithImpl<$Res, - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> - implements _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> { - __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl( - _$MaxDustHTLCExposure_FeeRateMultiplierImpl _value, - $Res Function(_$MaxDustHTLCExposure_FeeRateMultiplierImpl) _then) +class __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl<$Res> + extends _$GossipSourceConfigCopyWithImpl<$Res, + _$GossipSourceConfig_RapidGossipSyncImpl> + implements _$$GossipSourceConfig_RapidGossipSyncImplCopyWith<$Res> { + __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl( + _$GossipSourceConfig_RapidGossipSyncImpl _value, + $Res Function(_$GossipSourceConfig_RapidGossipSyncImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -7029,34 +2402,34 @@ class __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( + return _then(_$GossipSourceConfig_RapidGossipSyncImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable - as int, + as String, )); } } /// @nodoc -class _$MaxDustHTLCExposure_FeeRateMultiplierImpl - implements MaxDustHTLCExposure_FeeRateMultiplier { - const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0); +class _$GossipSourceConfig_RapidGossipSyncImpl + extends GossipSourceConfig_RapidGossipSync { + const _$GossipSourceConfig_RapidGossipSyncImpl(this.field0) : super._(); @override - final int field0; + final String field0; @override String toString() { - return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; + return 'GossipSourceConfig.rapidGossipSync(field0: $field0)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && + other is _$GossipSourceConfig_RapidGossipSyncImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -7066,38 +2439,38 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> - get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); + _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< + _$GossipSourceConfig_RapidGossipSyncImpl> + get copyWith => __$$GossipSourceConfig_RapidGossipSyncImplCopyWithImpl< + _$GossipSourceConfig_RapidGossipSyncImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(int field0) fixedLimitMsat, - required TResult Function(int field0) feeRateMultiplier, + required TResult Function() p2PNetwork, + required TResult Function(String field0) rapidGossipSync, }) { - return feeRateMultiplier(field0); + return rapidGossipSync(field0); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(int field0)? fixedLimitMsat, - TResult? Function(int field0)? feeRateMultiplier, + TResult? Function()? p2PNetwork, + TResult? Function(String field0)? rapidGossipSync, }) { - return feeRateMultiplier?.call(field0); + return rapidGossipSync?.call(field0); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(int field0)? fixedLimitMsat, - TResult Function(int field0)? feeRateMultiplier, + TResult Function()? p2PNetwork, + TResult Function(String field0)? rapidGossipSync, required TResult orElse(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(field0); + if (rapidGossipSync != null) { + return rapidGossipSync(field0); } return orElse(); } @@ -7105,444 +2478,164 @@ class _$MaxDustHTLCExposure_FeeRateMultiplierImpl @override @optionalTypeArgs TResult map({ - required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) - fixedLimitMsat, - required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) - feeRateMultiplier, + required TResult Function(GossipSourceConfig_P2PNetwork value) p2PNetwork, + required TResult Function(GossipSourceConfig_RapidGossipSync value) + rapidGossipSync, }) { - return feeRateMultiplier(this); + return rapidGossipSync(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult? Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, + TResult? Function(GossipSourceConfig_RapidGossipSync value)? + rapidGossipSync, }) { - return feeRateMultiplier?.call(this); + return rapidGossipSync?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, - TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? - feeRateMultiplier, + TResult Function(GossipSourceConfig_P2PNetwork value)? p2PNetwork, + TResult Function(GossipSourceConfig_RapidGossipSync value)? rapidGossipSync, required TResult orElse(), }) { - if (feeRateMultiplier != null) { - return feeRateMultiplier(this); + if (rapidGossipSync != null) { + return rapidGossipSync(this); } return orElse(); } } -abstract class MaxDustHTLCExposure_FeeRateMultiplier - implements MaxDustHTLCExposure { - const factory MaxDustHTLCExposure_FeeRateMultiplier(final int field0) = - _$MaxDustHTLCExposure_FeeRateMultiplierImpl; +abstract class GossipSourceConfig_RapidGossipSync extends GossipSourceConfig { + const factory GossipSourceConfig_RapidGossipSync(final String field0) = + _$GossipSourceConfig_RapidGossipSyncImpl; + const GossipSourceConfig_RapidGossipSync._() : super._(); - @override - int get field0; - @override + String get field0; @JsonKey(ignore: true) - _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< - _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + _$$GossipSourceConfig_RapidGossipSyncImplCopyWith< + _$GossipSourceConfig_RapidGossipSyncImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -mixin _$PendingSweepBalance { - /// The identifier of the channel this balance belongs to. - ChannelId? get channelId => throw _privateConstructorUsedError; - - /// The amount, in satoshis, of the output being swept. - int get amountSatoshis => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) - pendingBroadcast, - required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) - broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) - awaitingThresholdConfirmations, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult? Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(PendingSweepBalance_PendingBroadcast value) - pendingBroadcast, - required TResult Function( - PendingSweepBalance_BroadcastAwaitingConfirmation value) - broadcastAwaitingConfirmation, - required TResult Function( - PendingSweepBalance_AwaitingThresholdConfirmations value) - awaitingThresholdConfirmations, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $PendingSweepBalanceCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PendingSweepBalanceCopyWith<$Res> { - factory $PendingSweepBalanceCopyWith( - PendingSweepBalance value, $Res Function(PendingSweepBalance) then) = - _$PendingSweepBalanceCopyWithImpl<$Res, PendingSweepBalance>; - @useResult - $Res call({ChannelId? channelId, int amountSatoshis}); -} - -/// @nodoc -class _$PendingSweepBalanceCopyWithImpl<$Res, $Val extends PendingSweepBalance> - implements $PendingSweepBalanceCopyWith<$Res> { - _$PendingSweepBalanceCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? channelId = freezed, - Object? amountSatoshis = null, - }) { - return _then(_value.copyWith( - channelId: freezed == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId?, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$PendingSweepBalance_PendingBroadcastImplCopyWith<$Res> - implements $PendingSweepBalanceCopyWith<$Res> { - factory _$$PendingSweepBalance_PendingBroadcastImplCopyWith( - _$PendingSweepBalance_PendingBroadcastImpl value, - $Res Function(_$PendingSweepBalance_PendingBroadcastImpl) then) = - __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({ChannelId? channelId, int amountSatoshis}); -} - -/// @nodoc -class __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl<$Res> - extends _$PendingSweepBalanceCopyWithImpl<$Res, - _$PendingSweepBalance_PendingBroadcastImpl> - implements _$$PendingSweepBalance_PendingBroadcastImplCopyWith<$Res> { - __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl( - _$PendingSweepBalance_PendingBroadcastImpl _value, - $Res Function(_$PendingSweepBalance_PendingBroadcastImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? channelId = freezed, - Object? amountSatoshis = null, - }) { - return _then(_$PendingSweepBalance_PendingBroadcastImpl( - channelId: freezed == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId?, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc - -class _$PendingSweepBalance_PendingBroadcastImpl - implements PendingSweepBalance_PendingBroadcast { - const _$PendingSweepBalance_PendingBroadcastImpl( - {this.channelId, required this.amountSatoshis}); - - /// The identifier of the channel this balance belongs to. - @override - final ChannelId? channelId; - - /// The amount, in satoshis, of the output being swept. - @override - final int amountSatoshis; - - @override - String toString() { - return 'PendingSweepBalance.pendingBroadcast(channelId: $channelId, amountSatoshis: $amountSatoshis)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PendingSweepBalance_PendingBroadcastImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis)); - } - - @override - int get hashCode => Object.hash(runtimeType, channelId, amountSatoshis); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$PendingSweepBalance_PendingBroadcastImplCopyWith< - _$PendingSweepBalance_PendingBroadcastImpl> - get copyWith => __$$PendingSweepBalance_PendingBroadcastImplCopyWithImpl< - _$PendingSweepBalance_PendingBroadcastImpl>(this, _$identity); - - @override +mixin _$MaxDustHTLCExposure { + int get field0 => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) - pendingBroadcast, - required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) - broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) - awaitingThresholdConfirmations, - }) { - return pendingBroadcast(channelId, amountSatoshis); - } - - @override + required TResult Function(int field0) fixedLimitMsat, + required TResult Function(int field0) feeRateMultiplier, + }) => + throw _privateConstructorUsedError; @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult? Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, - }) { - return pendingBroadcast?.call(channelId, amountSatoshis); - } - - @override + TResult? Function(int field0)? fixedLimitMsat, + TResult? Function(int field0)? feeRateMultiplier, + }) => + throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, + TResult Function(int field0)? fixedLimitMsat, + TResult Function(int field0)? feeRateMultiplier, required TResult orElse(), - }) { - if (pendingBroadcast != null) { - return pendingBroadcast(channelId, amountSatoshis); - } - return orElse(); - } - - @override + }) => + throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ - required TResult Function(PendingSweepBalance_PendingBroadcast value) - pendingBroadcast, - required TResult Function( - PendingSweepBalance_BroadcastAwaitingConfirmation value) - broadcastAwaitingConfirmation, - required TResult Function( - PendingSweepBalance_AwaitingThresholdConfirmations value) - awaitingThresholdConfirmations, - }) { - return pendingBroadcast(this); - } - - @override + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, - }) { - return pendingBroadcast?.call(this); - } - - @override + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, + }) => + throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ - TResult Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, required TResult orElse(), - }) { - if (pendingBroadcast != null) { - return pendingBroadcast(this); - } - return orElse(); - } + }) => + throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $MaxDustHTLCExposureCopyWith get copyWith => + throw _privateConstructorUsedError; } -abstract class PendingSweepBalance_PendingBroadcast - implements PendingSweepBalance { - const factory PendingSweepBalance_PendingBroadcast( - {final ChannelId? channelId, required final int amountSatoshis}) = - _$PendingSweepBalance_PendingBroadcastImpl; +/// @nodoc +abstract class $MaxDustHTLCExposureCopyWith<$Res> { + factory $MaxDustHTLCExposureCopyWith( + MaxDustHTLCExposure value, $Res Function(MaxDustHTLCExposure) then) = + _$MaxDustHTLCExposureCopyWithImpl<$Res, MaxDustHTLCExposure>; + @useResult + $Res call({int field0}); +} - @override +/// @nodoc +class _$MaxDustHTLCExposureCopyWithImpl<$Res, $Val extends MaxDustHTLCExposure> + implements $MaxDustHTLCExposureCopyWith<$Res> { + _$MaxDustHTLCExposureCopyWithImpl(this._value, this._then); - /// The identifier of the channel this balance belongs to. - ChannelId? get channelId; - @override + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; - /// The amount, in satoshis, of the output being swept. - int get amountSatoshis; + @pragma('vm:prefer-inline') @override - @JsonKey(ignore: true) - _$$PendingSweepBalance_PendingBroadcastImplCopyWith< - _$PendingSweepBalance_PendingBroadcastImpl> - get copyWith => throw _privateConstructorUsedError; + $Res call({ + Object? field0 = null, + }) { + return _then(_value.copyWith( + field0: null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } } /// @nodoc -abstract class _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< - $Res> implements $PendingSweepBalanceCopyWith<$Res> { - factory _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith( - _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl value, - $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) - then) = - __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< - $Res>; +abstract class _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith<$Res> + implements $MaxDustHTLCExposureCopyWith<$Res> { + factory _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith( + _$MaxDustHTLCExposure_FixedLimitMsatImpl value, + $Res Function(_$MaxDustHTLCExposure_FixedLimitMsatImpl) then) = + __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ChannelId? channelId, - int latestBroadcastHeight, - Txid latestSpendingTxid, - int amountSatoshis}); + $Res call({int field0}); } /// @nodoc -class __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< - $Res> - extends _$PendingSweepBalanceCopyWithImpl<$Res, - _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> - implements - _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith<$Res> { - __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl( - _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl _value, - $Res Function(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl) - _then) +class __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl<$Res> + extends _$MaxDustHTLCExposureCopyWithImpl<$Res, + _$MaxDustHTLCExposure_FixedLimitMsatImpl> + implements _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith<$Res> { + __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl( + _$MaxDustHTLCExposure_FixedLimitMsatImpl _value, + $Res Function(_$MaxDustHTLCExposure_FixedLimitMsatImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = freezed, - Object? latestBroadcastHeight = null, - Object? latestSpendingTxid = null, - Object? amountSatoshis = null, + Object? field0 = null, }) { - return _then(_$PendingSweepBalance_BroadcastAwaitingConfirmationImpl( - channelId: freezed == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId?, - latestBroadcastHeight: null == latestBroadcastHeight - ? _value.latestBroadcastHeight - : latestBroadcastHeight // ignore: cast_nullable_to_non_nullable - as int, - latestSpendingTxid: null == latestSpendingTxid - ? _value.latestSpendingTxid - : latestSpendingTxid // ignore: cast_nullable_to_non_nullable - as Txid, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable + return _then(_$MaxDustHTLCExposure_FixedLimitMsatImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable as int, )); } @@ -7550,120 +2643,64 @@ class __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< /// @nodoc -class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl - implements PendingSweepBalance_BroadcastAwaitingConfirmation { - const _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl( - {this.channelId, - required this.latestBroadcastHeight, - required this.latestSpendingTxid, - required this.amountSatoshis}); - - /// The identifier of the channel this balance belongs to. - @override - final ChannelId? channelId; - - /// The best height when we last broadcast a transaction spending the output being swept. - @override - final int latestBroadcastHeight; - - /// The identifier of the transaction spending the swept output we last broadcast. - @override - final Txid latestSpendingTxid; +class _$MaxDustHTLCExposure_FixedLimitMsatImpl + extends MaxDustHTLCExposure_FixedLimitMsat { + const _$MaxDustHTLCExposure_FixedLimitMsatImpl(this.field0) : super._(); - /// The amount, in satoshis, of the output being swept. @override - final int amountSatoshis; + final int field0; @override String toString() { - return 'PendingSweepBalance.broadcastAwaitingConfirmation(channelId: $channelId, latestBroadcastHeight: $latestBroadcastHeight, latestSpendingTxid: $latestSpendingTxid, amountSatoshis: $amountSatoshis)'; + return 'MaxDustHTLCExposure.fixedLimitMsat(field0: $field0)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.latestBroadcastHeight, latestBroadcastHeight) || - other.latestBroadcastHeight == latestBroadcastHeight) && - (identical(other.latestSpendingTxid, latestSpendingTxid) || - other.latestSpendingTxid == latestSpendingTxid) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis)); + other is _$MaxDustHTLCExposure_FixedLimitMsatImpl && + (identical(other.field0, field0) || other.field0 == field0)); } @override - int get hashCode => Object.hash(runtimeType, channelId, latestBroadcastHeight, - latestSpendingTxid, amountSatoshis); + int get hashCode => Object.hash(runtimeType, field0); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< - _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> - get copyWith => - __$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWithImpl< - _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl>( - this, _$identity); + _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< + _$MaxDustHTLCExposure_FixedLimitMsatImpl> + get copyWith => __$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWithImpl< + _$MaxDustHTLCExposure_FixedLimitMsatImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) - pendingBroadcast, - required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) - broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) - awaitingThresholdConfirmations, + required TResult Function(int field0) fixedLimitMsat, + required TResult Function(int field0) feeRateMultiplier, }) { - return broadcastAwaitingConfirmation( - channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); + return fixedLimitMsat(field0); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult? Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, + TResult? Function(int field0)? fixedLimitMsat, + TResult? Function(int field0)? feeRateMultiplier, }) { - return broadcastAwaitingConfirmation?.call( - channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); + return fixedLimitMsat?.call(field0); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, + TResult Function(int field0)? fixedLimitMsat, + TResult Function(int field0)? feeRateMultiplier, required TResult orElse(), }) { - if (broadcastAwaitingConfirmation != null) { - return broadcastAwaitingConfirmation( - channelId, latestBroadcastHeight, latestSpendingTxid, amountSatoshis); + if (fixedLimitMsat != null) { + return fixedLimitMsat(field0); } return orElse(); } @@ -7671,142 +2708,84 @@ class _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl @override @optionalTypeArgs TResult map({ - required TResult Function(PendingSweepBalance_PendingBroadcast value) - pendingBroadcast, - required TResult Function( - PendingSweepBalance_BroadcastAwaitingConfirmation value) - broadcastAwaitingConfirmation, - required TResult Function( - PendingSweepBalance_AwaitingThresholdConfirmations value) - awaitingThresholdConfirmations, + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, }) { - return broadcastAwaitingConfirmation(this); + return fixedLimitMsat(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, }) { - return broadcastAwaitingConfirmation?.call(this); + return fixedLimitMsat?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, required TResult orElse(), }) { - if (broadcastAwaitingConfirmation != null) { - return broadcastAwaitingConfirmation(this); + if (fixedLimitMsat != null) { + return fixedLimitMsat(this); } return orElse(); } } -abstract class PendingSweepBalance_BroadcastAwaitingConfirmation - implements PendingSweepBalance { - const factory PendingSweepBalance_BroadcastAwaitingConfirmation( - {final ChannelId? channelId, - required final int latestBroadcastHeight, - required final Txid latestSpendingTxid, - required final int amountSatoshis}) = - _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl; - - @override - - /// The identifier of the channel this balance belongs to. - ChannelId? get channelId; - - /// The best height when we last broadcast a transaction spending the output being swept. - int get latestBroadcastHeight; +abstract class MaxDustHTLCExposure_FixedLimitMsat extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FixedLimitMsat(final int field0) = + _$MaxDustHTLCExposure_FixedLimitMsatImpl; + const MaxDustHTLCExposure_FixedLimitMsat._() : super._(); - /// The identifier of the transaction spending the swept output we last broadcast. - Txid get latestSpendingTxid; @override - - /// The amount, in satoshis, of the output being swept. - int get amountSatoshis; + int get field0; @override @JsonKey(ignore: true) - _$$PendingSweepBalance_BroadcastAwaitingConfirmationImplCopyWith< - _$PendingSweepBalance_BroadcastAwaitingConfirmationImpl> + _$$MaxDustHTLCExposure_FixedLimitMsatImplCopyWith< + _$MaxDustHTLCExposure_FixedLimitMsatImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< - $Res> implements $PendingSweepBalanceCopyWith<$Res> { - factory _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith( - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl value, - $Res Function( - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) - then) = - __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< - $Res>; +abstract class _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> + implements $MaxDustHTLCExposureCopyWith<$Res> { + factory _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith( + _$MaxDustHTLCExposure_FeeRateMultiplierImpl value, + $Res Function(_$MaxDustHTLCExposure_FeeRateMultiplierImpl) then) = + __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis}); + $Res call({int field0}); } /// @nodoc -class __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< - $Res> - extends _$PendingSweepBalanceCopyWithImpl<$Res, - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> - implements - _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< - $Res> { - __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl( - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl _value, - $Res Function(_$PendingSweepBalance_AwaitingThresholdConfirmationsImpl) - _then) +class __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl<$Res> + extends _$MaxDustHTLCExposureCopyWithImpl<$Res, + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + implements _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith<$Res> { + __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl( + _$MaxDustHTLCExposure_FeeRateMultiplierImpl _value, + $Res Function(_$MaxDustHTLCExposure_FeeRateMultiplierImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? channelId = freezed, - Object? latestSpendingTxid = null, - Object? confirmationHash = null, - Object? confirmationHeight = null, - Object? amountSatoshis = null, - }) { - return _then(_$PendingSweepBalance_AwaitingThresholdConfirmationsImpl( - channelId: freezed == channelId - ? _value.channelId - : channelId // ignore: cast_nullable_to_non_nullable - as ChannelId?, - latestSpendingTxid: null == latestSpendingTxid - ? _value.latestSpendingTxid - : latestSpendingTxid // ignore: cast_nullable_to_non_nullable - as Txid, - confirmationHash: null == confirmationHash - ? _value.confirmationHash - : confirmationHash // ignore: cast_nullable_to_non_nullable - as String, - confirmationHeight: null == confirmationHeight - ? _value.confirmationHeight - : confirmationHeight // ignore: cast_nullable_to_non_nullable - as int, - amountSatoshis: null == amountSatoshis - ? _value.amountSatoshis - : amountSatoshis // ignore: cast_nullable_to_non_nullable + Object? field0 = null, + }) { + return _then(_$MaxDustHTLCExposure_FeeRateMultiplierImpl( + null == field0 + ? _value.field0 + : field0 // ignore: cast_nullable_to_non_nullable as int, )); } @@ -7814,127 +2793,64 @@ class __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< /// @nodoc -class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl - implements PendingSweepBalance_AwaitingThresholdConfirmations { - const _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl( - {this.channelId, - required this.latestSpendingTxid, - required this.confirmationHash, - required this.confirmationHeight, - required this.amountSatoshis}); - - /// The identifier of the channel this balance belongs to. - @override - final ChannelId? channelId; - - /// The identifier of the confirmed transaction spending the swept output. - @override - final Txid latestSpendingTxid; - - /// The hash of the block in which the spending transaction was confirmed. - @override - final String confirmationHash; - - /// The height at which the spending transaction was confirmed. - @override - final int confirmationHeight; +class _$MaxDustHTLCExposure_FeeRateMultiplierImpl + extends MaxDustHTLCExposure_FeeRateMultiplier { + const _$MaxDustHTLCExposure_FeeRateMultiplierImpl(this.field0) : super._(); - /// The amount, in satoshis, of the output being swept. @override - final int amountSatoshis; + final int field0; @override String toString() { - return 'PendingSweepBalance.awaitingThresholdConfirmations(channelId: $channelId, latestSpendingTxid: $latestSpendingTxid, confirmationHash: $confirmationHash, confirmationHeight: $confirmationHeight, amountSatoshis: $amountSatoshis)'; + return 'MaxDustHTLCExposure.feeRateMultiplier(field0: $field0)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl && - (identical(other.channelId, channelId) || - other.channelId == channelId) && - (identical(other.latestSpendingTxid, latestSpendingTxid) || - other.latestSpendingTxid == latestSpendingTxid) && - (identical(other.confirmationHash, confirmationHash) || - other.confirmationHash == confirmationHash) && - (identical(other.confirmationHeight, confirmationHeight) || - other.confirmationHeight == confirmationHeight) && - (identical(other.amountSatoshis, amountSatoshis) || - other.amountSatoshis == amountSatoshis)); + other is _$MaxDustHTLCExposure_FeeRateMultiplierImpl && + (identical(other.field0, field0) || other.field0 == field0)); } @override - int get hashCode => Object.hash(runtimeType, channelId, latestSpendingTxid, - confirmationHash, confirmationHeight, amountSatoshis); + int get hashCode => Object.hash(runtimeType, field0); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> - get copyWith => - __$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWithImpl< - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl>( - this, _$identity); + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> + get copyWith => __$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWithImpl< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl>(this, _$identity); @override @optionalTypeArgs TResult when({ - required TResult Function(ChannelId? channelId, int amountSatoshis) - pendingBroadcast, - required TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis) - broadcastAwaitingConfirmation, - required TResult Function(ChannelId? channelId, Txid latestSpendingTxid, - String confirmationHash, int confirmationHeight, int amountSatoshis) - awaitingThresholdConfirmations, + required TResult Function(int field0) fixedLimitMsat, + required TResult Function(int field0) feeRateMultiplier, }) { - return awaitingThresholdConfirmations(channelId, latestSpendingTxid, - confirmationHash, confirmationHeight, amountSatoshis); + return feeRateMultiplier(field0); } @override @optionalTypeArgs TResult? whenOrNull({ - TResult? Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult? Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult? Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, + TResult? Function(int field0)? fixedLimitMsat, + TResult? Function(int field0)? feeRateMultiplier, }) { - return awaitingThresholdConfirmations?.call(channelId, latestSpendingTxid, - confirmationHash, confirmationHeight, amountSatoshis); + return feeRateMultiplier?.call(field0); } @override @optionalTypeArgs TResult maybeWhen({ - TResult Function(ChannelId? channelId, int amountSatoshis)? - pendingBroadcast, - TResult Function(ChannelId? channelId, int latestBroadcastHeight, - Txid latestSpendingTxid, int amountSatoshis)? - broadcastAwaitingConfirmation, - TResult Function( - ChannelId? channelId, - Txid latestSpendingTxid, - String confirmationHash, - int confirmationHeight, - int amountSatoshis)? - awaitingThresholdConfirmations, + TResult Function(int field0)? fixedLimitMsat, + TResult Function(int field0)? feeRateMultiplier, required TResult orElse(), }) { - if (awaitingThresholdConfirmations != null) { - return awaitingThresholdConfirmations(channelId, latestSpendingTxid, - confirmationHash, confirmationHeight, amountSatoshis); + if (feeRateMultiplier != null) { + return feeRateMultiplier(field0); } return orElse(); } @@ -7942,80 +2858,51 @@ class _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl @override @optionalTypeArgs TResult map({ - required TResult Function(PendingSweepBalance_PendingBroadcast value) - pendingBroadcast, - required TResult Function( - PendingSweepBalance_BroadcastAwaitingConfirmation value) - broadcastAwaitingConfirmation, - required TResult Function( - PendingSweepBalance_AwaitingThresholdConfirmations value) - awaitingThresholdConfirmations, + required TResult Function(MaxDustHTLCExposure_FixedLimitMsat value) + fixedLimitMsat, + required TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value) + feeRateMultiplier, }) { - return awaitingThresholdConfirmations(this); + return feeRateMultiplier(this); } @override @optionalTypeArgs TResult? mapOrNull({ - TResult? Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult? Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult? Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, + TResult? Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult? Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, }) { - return awaitingThresholdConfirmations?.call(this); + return feeRateMultiplier?.call(this); } @override @optionalTypeArgs TResult maybeMap({ - TResult Function(PendingSweepBalance_PendingBroadcast value)? - pendingBroadcast, - TResult Function(PendingSweepBalance_BroadcastAwaitingConfirmation value)? - broadcastAwaitingConfirmation, - TResult Function(PendingSweepBalance_AwaitingThresholdConfirmations value)? - awaitingThresholdConfirmations, + TResult Function(MaxDustHTLCExposure_FixedLimitMsat value)? fixedLimitMsat, + TResult Function(MaxDustHTLCExposure_FeeRateMultiplier value)? + feeRateMultiplier, required TResult orElse(), }) { - if (awaitingThresholdConfirmations != null) { - return awaitingThresholdConfirmations(this); + if (feeRateMultiplier != null) { + return feeRateMultiplier(this); } return orElse(); } } -abstract class PendingSweepBalance_AwaitingThresholdConfirmations - implements PendingSweepBalance { - const factory PendingSweepBalance_AwaitingThresholdConfirmations( - {final ChannelId? channelId, - required final Txid latestSpendingTxid, - required final String confirmationHash, - required final int confirmationHeight, - required final int amountSatoshis}) = - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl; - - @override - - /// The identifier of the channel this balance belongs to. - ChannelId? get channelId; - - /// The identifier of the confirmed transaction spending the swept output. - Txid get latestSpendingTxid; - - /// The hash of the block in which the spending transaction was confirmed. - String get confirmationHash; +abstract class MaxDustHTLCExposure_FeeRateMultiplier + extends MaxDustHTLCExposure { + const factory MaxDustHTLCExposure_FeeRateMultiplier(final int field0) = + _$MaxDustHTLCExposure_FeeRateMultiplierImpl; + const MaxDustHTLCExposure_FeeRateMultiplier._() : super._(); - /// The height at which the spending transaction was confirmed. - int get confirmationHeight; @override - - /// The amount, in satoshis, of the output being swept. - int get amountSatoshis; + int get field0; @override @JsonKey(ignore: true) - _$$PendingSweepBalance_AwaitingThresholdConfirmationsImplCopyWith< - _$PendingSweepBalance_AwaitingThresholdConfirmationsImpl> + _$$MaxDustHTLCExposure_FeeRateMultiplierImplCopyWith< + _$MaxDustHTLCExposure_FeeRateMultiplierImpl> get copyWith => throw _privateConstructorUsedError; } @@ -8142,8 +3029,9 @@ class __$$SocketAddress_TcpIpV4ImplCopyWithImpl<$Res> /// @nodoc -class _$SocketAddress_TcpIpV4Impl implements SocketAddress_TcpIpV4 { - const _$SocketAddress_TcpIpV4Impl({required this.addr, required this.port}); +class _$SocketAddress_TcpIpV4Impl extends SocketAddress_TcpIpV4 { + const _$SocketAddress_TcpIpV4Impl({required this.addr, required this.port}) + : super._(); @override final U8Array4 addr; @@ -8262,10 +3150,11 @@ class _$SocketAddress_TcpIpV4Impl implements SocketAddress_TcpIpV4 { } } -abstract class SocketAddress_TcpIpV4 implements SocketAddress { +abstract class SocketAddress_TcpIpV4 extends SocketAddress { const factory SocketAddress_TcpIpV4( {required final U8Array4 addr, required final int port}) = _$SocketAddress_TcpIpV4Impl; + const SocketAddress_TcpIpV4._() : super._(); U8Array4 get addr; int get port; @@ -8313,8 +3202,9 @@ class __$$SocketAddress_TcpIpV6ImplCopyWithImpl<$Res> /// @nodoc -class _$SocketAddress_TcpIpV6Impl implements SocketAddress_TcpIpV6 { - const _$SocketAddress_TcpIpV6Impl({required this.addr, required this.port}); +class _$SocketAddress_TcpIpV6Impl extends SocketAddress_TcpIpV6 { + const _$SocketAddress_TcpIpV6Impl({required this.addr, required this.port}) + : super._(); @override final U8Array16 addr; @@ -8433,10 +3323,11 @@ class _$SocketAddress_TcpIpV6Impl implements SocketAddress_TcpIpV6 { } } -abstract class SocketAddress_TcpIpV6 implements SocketAddress { +abstract class SocketAddress_TcpIpV6 extends SocketAddress { const factory SocketAddress_TcpIpV6( {required final U8Array16 addr, required final int port}) = _$SocketAddress_TcpIpV6Impl; + const SocketAddress_TcpIpV6._() : super._(); U8Array16 get addr; int get port; @@ -8479,8 +3370,8 @@ class __$$SocketAddress_OnionV2ImplCopyWithImpl<$Res> /// @nodoc -class _$SocketAddress_OnionV2Impl implements SocketAddress_OnionV2 { - const _$SocketAddress_OnionV2Impl(this.field0); +class _$SocketAddress_OnionV2Impl extends SocketAddress_OnionV2 { + const _$SocketAddress_OnionV2Impl(this.field0) : super._(); @override final U8Array12 field0; @@ -8596,9 +3487,10 @@ class _$SocketAddress_OnionV2Impl implements SocketAddress_OnionV2 { } } -abstract class SocketAddress_OnionV2 implements SocketAddress { +abstract class SocketAddress_OnionV2 extends SocketAddress { const factory SocketAddress_OnionV2(final U8Array12 field0) = _$SocketAddress_OnionV2Impl; + const SocketAddress_OnionV2._() : super._(); U8Array12 get field0; @JsonKey(ignore: true) @@ -8655,12 +3547,13 @@ class __$$SocketAddress_OnionV3ImplCopyWithImpl<$Res> /// @nodoc -class _$SocketAddress_OnionV3Impl implements SocketAddress_OnionV3 { +class _$SocketAddress_OnionV3Impl extends SocketAddress_OnionV3 { const _$SocketAddress_OnionV3Impl( {required this.ed25519Pubkey, required this.checksum, required this.version, - required this.port}); + required this.port}) + : super._(); @override final U8Array32 ed25519Pubkey; @@ -8791,12 +3684,13 @@ class _$SocketAddress_OnionV3Impl implements SocketAddress_OnionV3 { } } -abstract class SocketAddress_OnionV3 implements SocketAddress { +abstract class SocketAddress_OnionV3 extends SocketAddress { const factory SocketAddress_OnionV3( {required final U8Array32 ed25519Pubkey, required final int checksum, required final int version, required final int port}) = _$SocketAddress_OnionV3Impl; + const SocketAddress_OnionV3._() : super._(); U8Array32 get ed25519Pubkey; int get checksum; @@ -8847,8 +3741,9 @@ class __$$SocketAddress_HostnameImplCopyWithImpl<$Res> /// @nodoc -class _$SocketAddress_HostnameImpl implements SocketAddress_Hostname { - const _$SocketAddress_HostnameImpl({required this.addr, required this.port}); +class _$SocketAddress_HostnameImpl extends SocketAddress_Hostname { + const _$SocketAddress_HostnameImpl({required this.addr, required this.port}) + : super._(); @override final String addr; @@ -8966,10 +3861,11 @@ class _$SocketAddress_HostnameImpl implements SocketAddress_Hostname { } } -abstract class SocketAddress_Hostname implements SocketAddress { +abstract class SocketAddress_Hostname extends SocketAddress { const factory SocketAddress_Hostname( {required final String addr, required final int port}) = _$SocketAddress_HostnameImpl; + const SocketAddress_Hostname._() : super._(); String get addr; int get port; diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index 6302808..4e2953e 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -53,7 +53,7 @@ class LdkCore extends BaseEntrypoint { kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.0.0-dev.28'; + String get codegenVersion => '2.0.0-dev.31'; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -64,26 +64,31 @@ class LdkCore extends BaseEntrypoint { } abstract class LdkCoreApi extends BaseApi { - Future mnemonicBaseGenerate({dynamic hint}); + Future buildWithSqliteStore( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + dynamic hint}); + + Future ldkMnemonicGenerate({dynamic hint}); - Future nodeBaseCloseChannel( - {required NodeBase that, - required UserChannelId userChannelId, + Future ldkNodeCloseChannel( + {required LdkNode that, + required ChannelId channelId, required PublicKey counterpartyNodeId, dynamic hint}); - Future nodeBaseConfig({required NodeBase that, dynamic hint}); - - Future nodeBaseConnect( - {required NodeBase that, + Future ldkNodeConnect( + {required LdkNode that, required PublicKey nodeId, required SocketAddress address, required bool persist, dynamic hint}); - Future nodeBaseConnectOpenChannel( - {required NodeBase that, - required SocketAddress address, + Future ldkNodeConnectOpenChannel( + {required LdkNode that, + required SocketAddress socketAddress, required PublicKey nodeId, required int channelAmountSats, int? pushToCounterpartyMsat, @@ -91,149 +96,133 @@ abstract class LdkCoreApi extends BaseApi { ChannelConfig? channelConfig, dynamic hint}); - Future nodeBaseDisconnect( - {required NodeBase that, + Future ldkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId, dynamic hint}); - Future nodeBaseEventHandled({required NodeBase that, dynamic hint}); + Future ldkNodeEventHandled({required LdkNode that, dynamic hint}); - Future nodeBaseListBalances( - {required NodeBase that, dynamic hint}); + Future ldkNodeIsRunning({required LdkNode that, dynamic hint}); - Future> nodeBaseListChannels( - {required NodeBase that, dynamic hint}); + Future> ldkNodeListChannels( + {required LdkNode that, dynamic hint}); - Future> nodeBaseListPayments( - {required NodeBase that, dynamic hint}); + Future> ldkNodeListPayments( + {required LdkNode that, dynamic hint}); - Future> nodeBaseListPaymentsWithFilter( - {required NodeBase that, + Future> ldkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection, dynamic hint}); - Future> nodeBaseListPeers( - {required NodeBase that, dynamic hint}); + Future> ldkNodeListPeers( + {required LdkNode that, dynamic hint}); - Future?> nodeBaseListeningAddresses( - {required NodeBase that, dynamic hint}); + Future?> ldkNodeListeningAddresses( + {required LdkNode that, dynamic hint}); - Future
nodeBaseNewOnchainAddress( - {required NodeBase that, dynamic hint}); + Future
ldkNodeNewOnchainAddress( + {required LdkNode that, dynamic hint}); - Future nodeBaseNextEvent({required NodeBase that, dynamic hint}); + Future ldkNodeNextEvent({required LdkNode that, dynamic hint}); - Future nodeBaseNextEventAsync({required NodeBase that, dynamic hint}); + Future ldkNodeNodeId({required LdkNode that, dynamic hint}); - Future nodeBaseNodeId({required NodeBase that, dynamic hint}); + Future ldkNodePayment( + {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); - Future nodeBasePayment( - {required NodeBase that, required PaymentHash paymentHash, dynamic hint}); - - Future nodeBaseReceivePayment( - {required NodeBase that, - required int amountMsat, - required String description, - required int expirySecs, - dynamic hint}); - - Future nodeBaseReceivePaymentViaJitChannel( - {required NodeBase that, + Future ldkNodeReceivePayment( + {required LdkNode that, required int amountMsat, required String description, required int expirySecs, - int? maxTotalLspFeeLimitMsat, - dynamic hint}); - - Future nodeBaseReceiveVariableAmountPayment( - {required NodeBase that, - required String description, - required int expirySecs, dynamic hint}); - Future nodeBaseReceiveVariableAmountPaymentViaJitChannel( - {required NodeBase that, + Future ldkNodeReceiveVariableAmountPayment( + {required LdkNode that, required String description, required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, dynamic hint}); - Future nodeBaseRemovePayment( - {required NodeBase that, required PaymentHash paymentHash, dynamic hint}); + Future ldkNodeRemovePayment( + {required LdkNode that, required PaymentHash paymentHash, dynamic hint}); - Future nodeBaseSendAllToOnchainAddress( - {required NodeBase that, required Address address, dynamic hint}); + Future ldkNodeSendAllToOnchainAddress( + {required LdkNode that, required Address address, dynamic hint}); - Future nodeBaseSendPayment( - {required NodeBase that, required Bolt11Invoice invoice, dynamic hint}); + Future ldkNodeSendPayment( + {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); - Future nodeBaseSendPaymentProbes( - {required NodeBase that, required Bolt11Invoice invoice, dynamic hint}); + Future ldkNodeSendPaymentProbes( + {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}); - Future nodeBaseSendPaymentProbesUsingAmount( - {required NodeBase that, + Future ldkNodeSendPaymentProbesUsingAmount( + {required LdkNode that, required Bolt11Invoice invoice, required int amountMsat, dynamic hint}); - Future nodeBaseSendPaymentUsingAmount( - {required NodeBase that, + Future ldkNodeSendPaymentUsingAmount( + {required LdkNode that, required Bolt11Invoice invoice, required int amountMsat, dynamic hint}); - Future nodeBaseSendSpontaneousPayment( - {required NodeBase that, + Future ldkNodeSendSpontaneousPayment( + {required LdkNode that, required int amountMsat, required PublicKey nodeId, dynamic hint}); - Future nodeBaseSendSpontaneousPaymentProbes( - {required NodeBase that, + Future ldkNodeSendSpontaneousPaymentProbes( + {required LdkNode that, required int amountMsat, required PublicKey nodeId, dynamic hint}); - Future nodeBaseSendToOnchainAddress( - {required NodeBase that, + Future ldkNodeSendToOnchainAddress( + {required LdkNode that, required Address address, required int amountSats, dynamic hint}); - Future nodeBaseSignMessage( - {required NodeBase that, required List msg, dynamic hint}); + Future ldkNodeSignMessage( + {required LdkNode that, required List msg, dynamic hint}); - Future nodeBaseStart({required NodeBase that, dynamic hint}); + Future ldkNodeSpendableOnchainBalanceSats( + {required LdkNode that, dynamic hint}); - Future nodeBaseStatus({required NodeBase that, dynamic hint}); + Future ldkNodeStart({required LdkNode that, dynamic hint}); - Future nodeBaseStop({required NodeBase that, dynamic hint}); + Future ldkNodeStop({required LdkNode that, dynamic hint}); - Future nodeBaseSyncWallets({required NodeBase that, dynamic hint}); + Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}); - Future nodeBaseUpdateChannelConfig( - {required NodeBase that, - required UserChannelId userChannelId, + Future ldkNodeTotalOnchainBalanceSats( + {required LdkNode that, dynamic hint}); + + Future ldkNodeUpdateChannelConfig( + {required LdkNode that, + required ChannelId channelId, required PublicKey counterpartyNodeId, required ChannelConfig channelConfig, dynamic hint}); - Future nodeBaseVerifySignature( - {required NodeBase that, + Future ldkNodeVerifySignature( + {required LdkNode that, required List msg, required String sig, required PublicKey pkey, dynamic hint}); - Future nodeBaseWaitNextEvent({required NodeBase that, dynamic hint}); + Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}); - Future finalizeBuilder( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - LiquiditySourceConfig? liquiditySourceConfig, - dynamic hint}); + Future socketAddressAsString( + {required SocketAddress that, dynamic hint}); + + Future socketAddressFromStr( + {required String address, dynamic hint}); RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_NodeSqliteStore; @@ -254,114 +243,135 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { }); @override - Future mnemonicBaseGenerate({dynamic hint}) { + Future buildWithSqliteStore( + {required Config config, + ChainDataSourceConfig? chainDataSourceConfig, + EntropySourceConfig? entropySourceConfig, + GossipSourceConfig? gossipSourceConfig, + dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - return wire.wire_MnemonicBase_generate(port_); + var arg0 = cst_encode_box_autoadd_config(config); + var arg1 = cst_encode_opt_box_autoadd_chain_data_source_config( + chainDataSourceConfig); + var arg2 = cst_encode_opt_box_autoadd_entropy_source_config( + entropySourceConfig); + var arg3 = + cst_encode_opt_box_autoadd_gossip_source_config(gossipSourceConfig); + return wire.wire_build_with_sqlite_store(port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_mnemonic_base, - decodeErrorData: null, + decodeSuccessData: dco_decode_ldk_node, + decodeErrorData: dco_decode_builder_exception, ), - constMeta: kMnemonicBaseGenerateConstMeta, - argValues: [], + constMeta: kBuildWithSqliteStoreConstMeta, + argValues: [ + config, + chainDataSourceConfig, + entropySourceConfig, + gossipSourceConfig + ], apiImpl: this, hint: hint, )); } - TaskConstMeta get kMnemonicBaseGenerateConstMeta => const TaskConstMeta( - debugName: "MnemonicBase_generate", - argNames: [], + TaskConstMeta get kBuildWithSqliteStoreConstMeta => const TaskConstMeta( + debugName: "build_with_sqlite_store", + argNames: [ + "config", + "chainDataSourceConfig", + "entropySourceConfig", + "gossipSourceConfig" + ], ); @override - Future nodeBaseCloseChannel( - {required NodeBase that, - required UserChannelId userChannelId, - required PublicKey counterpartyNodeId, - dynamic hint}) { + Future ldkMnemonicGenerate({dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); - var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - return wire.wire_NodeBase_close_channel(port_, arg0, arg1, arg2); + return wire.wire_ldk_mnemonic_generate(port_); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeSuccessData: dco_decode_ldk_mnemonic, + decodeErrorData: null, ), - constMeta: kNodeBaseCloseChannelConstMeta, - argValues: [that, userChannelId, counterpartyNodeId], + constMeta: kLdkMnemonicGenerateConstMeta, + argValues: [], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseCloseChannelConstMeta => const TaskConstMeta( - debugName: "NodeBase_close_channel", - argNames: ["that", "userChannelId", "counterpartyNodeId"], + TaskConstMeta get kLdkMnemonicGenerateConstMeta => const TaskConstMeta( + debugName: "ldk_mnemonic_generate", + argNames: [], ); @override - Future nodeBaseConfig({required NodeBase that, dynamic hint}) { + Future ldkNodeCloseChannel( + {required LdkNode that, + required ChannelId channelId, + required PublicKey counterpartyNodeId, + dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_config(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_channel_id(channelId); + var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); + return wire.wire_ldk_node_close_channel(port_, arg0, arg1, arg2); }, codec: DcoCodec( - decodeSuccessData: dco_decode_config, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseConfigConstMeta, - argValues: [that], + constMeta: kLdkNodeCloseChannelConstMeta, + argValues: [that, channelId, counterpartyNodeId], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseConfigConstMeta => const TaskConstMeta( - debugName: "NodeBase_config", - argNames: ["that"], + TaskConstMeta get kLdkNodeCloseChannelConstMeta => const TaskConstMeta( + debugName: "ldk_node_close_channel", + argNames: ["that", "channelId", "counterpartyNodeId"], ); @override - Future nodeBaseConnect( - {required NodeBase that, + Future ldkNodeConnect( + {required LdkNode that, required PublicKey nodeId, required SocketAddress address, required bool persist, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_public_key(nodeId); var arg2 = cst_encode_box_autoadd_socket_address(address); var arg3 = cst_encode_bool(persist); - return wire.wire_NodeBase_connect(port_, arg0, arg1, arg2, arg3); + return wire.wire_ldk_node_connect(port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseConnectConstMeta, + constMeta: kLdkNodeConnectConstMeta, argValues: [that, nodeId, address, persist], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseConnectConstMeta => const TaskConstMeta( - debugName: "NodeBase_connect", + TaskConstMeta get kLdkNodeConnectConstMeta => const TaskConstMeta( + debugName: "ldk_node_connect", argNames: ["that", "nodeId", "address", "persist"], ); @override - Future nodeBaseConnectOpenChannel( - {required NodeBase that, - required SocketAddress address, + Future ldkNodeConnectOpenChannel( + {required LdkNode that, + required SocketAddress socketAddress, required PublicKey nodeId, required int channelAmountSats, int? pushToCounterpartyMsat, @@ -370,24 +380,24 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - var arg1 = cst_encode_box_autoadd_socket_address(address); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_socket_address(socketAddress); var arg2 = cst_encode_box_autoadd_public_key(nodeId); var arg3 = cst_encode_u_64(channelAmountSats); var arg4 = cst_encode_opt_box_autoadd_u_64(pushToCounterpartyMsat); var arg5 = cst_encode_bool(announceChannel); var arg6 = cst_encode_opt_box_autoadd_channel_config(channelConfig); - return wire.wire_NodeBase_connect_open_channel( + return wire.wire_ldk_node_connect_open_channel( port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); }, codec: DcoCodec( - decodeSuccessData: dco_decode_user_channel_id, - decodeErrorData: dco_decode_node_base_error, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseConnectOpenChannelConstMeta, + constMeta: kLdkNodeConnectOpenChannelConstMeta, argValues: [ that, - address, + socketAddress, nodeId, channelAmountSats, pushToCounterpartyMsat, @@ -399,11 +409,11 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { )); } - TaskConstMeta get kNodeBaseConnectOpenChannelConstMeta => const TaskConstMeta( - debugName: "NodeBase_connect_open_channel", + TaskConstMeta get kLdkNodeConnectOpenChannelConstMeta => const TaskConstMeta( + debugName: "ldk_node_connect_open_channel", argNames: [ "that", - "address", + "socketAddress", "nodeId", "channelAmountSats", "pushToCounterpartyMsat", @@ -413,996 +423,894 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); @override - Future nodeBaseDisconnect( - {required NodeBase that, + Future ldkNodeDisconnect( + {required LdkNode that, required PublicKey counterpartyNodeId, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_public_key(counterpartyNodeId); - return wire.wire_NodeBase_disconnect(port_, arg0, arg1); + return wire.wire_ldk_node_disconnect(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseDisconnectConstMeta, + constMeta: kLdkNodeDisconnectConstMeta, argValues: [that, counterpartyNodeId], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseDisconnectConstMeta => const TaskConstMeta( - debugName: "NodeBase_disconnect", + TaskConstMeta get kLdkNodeDisconnectConstMeta => const TaskConstMeta( + debugName: "ldk_node_disconnect", argNames: ["that", "counterpartyNodeId"], ); @override - Future nodeBaseEventHandled({required NodeBase that, dynamic hint}) { + Future ldkNodeEventHandled({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_event_handled(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_event_handled(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, decodeErrorData: null, ), - constMeta: kNodeBaseEventHandledConstMeta, + constMeta: kLdkNodeEventHandledConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseEventHandledConstMeta => const TaskConstMeta( - debugName: "NodeBase_event_handled", + TaskConstMeta get kLdkNodeEventHandledConstMeta => const TaskConstMeta( + debugName: "ldk_node_event_handled", argNames: ["that"], ); @override - Future nodeBaseListBalances( - {required NodeBase that, dynamic hint}) { + Future ldkNodeIsRunning({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_list_balances(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_is_running(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_balance_details, - decodeErrorData: dco_decode_node_base_error, + decodeSuccessData: dco_decode_bool, + decodeErrorData: null, ), - constMeta: kNodeBaseListBalancesConstMeta, + constMeta: kLdkNodeIsRunningConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseListBalancesConstMeta => const TaskConstMeta( - debugName: "NodeBase_list_balances", + TaskConstMeta get kLdkNodeIsRunningConstMeta => const TaskConstMeta( + debugName: "ldk_node_is_running", argNames: ["that"], ); @override - Future> nodeBaseListChannels( - {required NodeBase that, dynamic hint}) { + Future> ldkNodeListChannels( + {required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_list_channels(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_list_channels(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_channel_details, decodeErrorData: null, ), - constMeta: kNodeBaseListChannelsConstMeta, + constMeta: kLdkNodeListChannelsConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseListChannelsConstMeta => const TaskConstMeta( - debugName: "NodeBase_list_channels", + TaskConstMeta get kLdkNodeListChannelsConstMeta => const TaskConstMeta( + debugName: "ldk_node_list_channels", argNames: ["that"], ); @override - Future> nodeBaseListPayments( - {required NodeBase that, dynamic hint}) { + Future> ldkNodeListPayments( + {required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_list_payments(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_list_payments(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_payment_details, decodeErrorData: null, ), - constMeta: kNodeBaseListPaymentsConstMeta, + constMeta: kLdkNodeListPaymentsConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseListPaymentsConstMeta => const TaskConstMeta( - debugName: "NodeBase_list_payments", + TaskConstMeta get kLdkNodeListPaymentsConstMeta => const TaskConstMeta( + debugName: "ldk_node_list_payments", argNames: ["that"], ); @override - Future> nodeBaseListPaymentsWithFilter( - {required NodeBase that, + Future> ldkNodeListPaymentsWithFilter( + {required LdkNode that, required PaymentDirection paymentDirection, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_payment_direction(paymentDirection); - return wire.wire_NodeBase_list_payments_with_filter(port_, arg0, arg1); + return wire.wire_ldk_node_list_payments_with_filter(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_payment_details, decodeErrorData: null, ), - constMeta: kNodeBaseListPaymentsWithFilterConstMeta, + constMeta: kLdkNodeListPaymentsWithFilterConstMeta, argValues: [that, paymentDirection], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseListPaymentsWithFilterConstMeta => + TaskConstMeta get kLdkNodeListPaymentsWithFilterConstMeta => const TaskConstMeta( - debugName: "NodeBase_list_payments_with_filter", + debugName: "ldk_node_list_payments_with_filter", argNames: ["that", "paymentDirection"], ); @override - Future> nodeBaseListPeers( - {required NodeBase that, dynamic hint}) { + Future> ldkNodeListPeers( + {required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_list_peers(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_list_peers(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_list_peer_details, decodeErrorData: null, ), - constMeta: kNodeBaseListPeersConstMeta, + constMeta: kLdkNodeListPeersConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseListPeersConstMeta => const TaskConstMeta( - debugName: "NodeBase_list_peers", + TaskConstMeta get kLdkNodeListPeersConstMeta => const TaskConstMeta( + debugName: "ldk_node_list_peers", argNames: ["that"], ); @override - Future?> nodeBaseListeningAddresses( - {required NodeBase that, dynamic hint}) { + Future?> ldkNodeListeningAddresses( + {required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_listening_addresses(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_listening_addresses(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_opt_list_socket_address, decodeErrorData: null, ), - constMeta: kNodeBaseListeningAddressesConstMeta, + constMeta: kLdkNodeListeningAddressesConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseListeningAddressesConstMeta => const TaskConstMeta( - debugName: "NodeBase_listening_addresses", + TaskConstMeta get kLdkNodeListeningAddressesConstMeta => const TaskConstMeta( + debugName: "ldk_node_listening_addresses", argNames: ["that"], ); @override - Future
nodeBaseNewOnchainAddress( - {required NodeBase that, dynamic hint}) { + Future
ldkNodeNewOnchainAddress( + {required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_new_onchain_address(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_new_onchain_address(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_address, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseNewOnchainAddressConstMeta, + constMeta: kLdkNodeNewOnchainAddressConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseNewOnchainAddressConstMeta => const TaskConstMeta( - debugName: "NodeBase_new_onchain_address", + TaskConstMeta get kLdkNodeNewOnchainAddressConstMeta => const TaskConstMeta( + debugName: "ldk_node_new_onchain_address", argNames: ["that"], ); @override - Future nodeBaseNextEvent({required NodeBase that, dynamic hint}) { + Future ldkNodeNextEvent({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_next_event(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_next_event(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_opt_box_autoadd_event, decodeErrorData: null, ), - constMeta: kNodeBaseNextEventConstMeta, - argValues: [that], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kNodeBaseNextEventConstMeta => const TaskConstMeta( - debugName: "NodeBase_next_event", - argNames: ["that"], - ); - - @override - Future nodeBaseNextEventAsync({required NodeBase that, dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_next_event_async(port_, arg0); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_event, - decodeErrorData: null, - ), - constMeta: kNodeBaseNextEventAsyncConstMeta, + constMeta: kLdkNodeNextEventConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseNextEventAsyncConstMeta => const TaskConstMeta( - debugName: "NodeBase_next_event_async", + TaskConstMeta get kLdkNodeNextEventConstMeta => const TaskConstMeta( + debugName: "ldk_node_next_event", argNames: ["that"], ); @override - Future nodeBaseNodeId({required NodeBase that, dynamic hint}) { + Future ldkNodeNodeId({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_node_id(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_node_id(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_public_key, decodeErrorData: null, ), - constMeta: kNodeBaseNodeIdConstMeta, + constMeta: kLdkNodeNodeIdConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseNodeIdConstMeta => const TaskConstMeta( - debugName: "NodeBase_node_id", + TaskConstMeta get kLdkNodeNodeIdConstMeta => const TaskConstMeta( + debugName: "ldk_node_node_id", argNames: ["that"], ); @override - Future nodeBasePayment( - {required NodeBase that, - required PaymentHash paymentHash, - dynamic hint}) { + Future ldkNodePayment( + {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_NodeBase_payment(port_, arg0, arg1); + return wire.wire_ldk_node_payment(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_opt_box_autoadd_payment_details, decodeErrorData: null, ), - constMeta: kNodeBasePaymentConstMeta, + constMeta: kLdkNodePaymentConstMeta, argValues: [that, paymentHash], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBasePaymentConstMeta => const TaskConstMeta( - debugName: "NodeBase_payment", + TaskConstMeta get kLdkNodePaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_payment", argNames: ["that", "paymentHash"], ); @override - Future nodeBaseReceivePayment( - {required NodeBase that, + Future ldkNodeReceivePayment( + {required LdkNode that, required int amountMsat, required String description, required int expirySecs, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_u_64(amountMsat); var arg2 = cst_encode_String(description); var arg3 = cst_encode_u_32(expirySecs); - return wire.wire_NodeBase_receive_payment( + return wire.wire_ldk_node_receive_payment( port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseReceivePaymentConstMeta, + constMeta: kLdkNodeReceivePaymentConstMeta, argValues: [that, amountMsat, description, expirySecs], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseReceivePaymentConstMeta => const TaskConstMeta( - debugName: "NodeBase_receive_payment", + TaskConstMeta get kLdkNodeReceivePaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_receive_payment", argNames: ["that", "amountMsat", "description", "expirySecs"], ); @override - Future nodeBaseReceivePaymentViaJitChannel( - {required NodeBase that, - required int amountMsat, - required String description, - required int expirySecs, - int? maxTotalLspFeeLimitMsat, - dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - var arg1 = cst_encode_u_64(amountMsat); - var arg2 = cst_encode_String(description); - var arg3 = cst_encode_u_32(expirySecs); - var arg4 = cst_encode_opt_box_autoadd_u_64(maxTotalLspFeeLimitMsat); - return wire.wire_NodeBase_receive_payment_via_jit_channel( - port_, arg0, arg1, arg2, arg3, arg4); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_base_error, - ), - constMeta: kNodeBaseReceivePaymentViaJitChannelConstMeta, - argValues: [ - that, - amountMsat, - description, - expirySecs, - maxTotalLspFeeLimitMsat - ], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kNodeBaseReceivePaymentViaJitChannelConstMeta => - const TaskConstMeta( - debugName: "NodeBase_receive_payment_via_jit_channel", - argNames: [ - "that", - "amountMsat", - "description", - "expirySecs", - "maxTotalLspFeeLimitMsat" - ], - ); - - @override - Future nodeBaseReceiveVariableAmountPayment( - {required NodeBase that, + Future ldkNodeReceiveVariableAmountPayment( + {required LdkNode that, required String description, required int expirySecs, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_String(description); var arg2 = cst_encode_u_32(expirySecs); - return wire.wire_NodeBase_receive_variable_amount_payment( + return wire.wire_ldk_node_receive_variable_amount_payment( port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseReceiveVariableAmountPaymentConstMeta, + constMeta: kLdkNodeReceiveVariableAmountPaymentConstMeta, argValues: [that, description, expirySecs], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseReceiveVariableAmountPaymentConstMeta => + TaskConstMeta get kLdkNodeReceiveVariableAmountPaymentConstMeta => const TaskConstMeta( - debugName: "NodeBase_receive_variable_amount_payment", + debugName: "ldk_node_receive_variable_amount_payment", argNames: ["that", "description", "expirySecs"], ); @override - Future nodeBaseReceiveVariableAmountPaymentViaJitChannel( - {required NodeBase that, - required String description, - required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, - dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - var arg1 = cst_encode_String(description); - var arg2 = cst_encode_u_32(expirySecs); - var arg3 = - cst_encode_opt_box_autoadd_u_64(maxProportionalLspFeeLimitPpmMsat); - return wire - .wire_NodeBase_receive_variable_amount_payment_via_jit_channel( - port_, arg0, arg1, arg2, arg3); - }, - codec: DcoCodec( - decodeSuccessData: dco_decode_bolt_11_invoice, - decodeErrorData: dco_decode_node_base_error, - ), - constMeta: kNodeBaseReceiveVariableAmountPaymentViaJitChannelConstMeta, - argValues: [ - that, - description, - expirySecs, - maxProportionalLspFeeLimitPpmMsat - ], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta - get kNodeBaseReceiveVariableAmountPaymentViaJitChannelConstMeta => - const TaskConstMeta( - debugName: - "NodeBase_receive_variable_amount_payment_via_jit_channel", - argNames: [ - "that", - "description", - "expirySecs", - "maxProportionalLspFeeLimitPpmMsat" - ], - ); - - @override - Future nodeBaseRemovePayment( - {required NodeBase that, - required PaymentHash paymentHash, - dynamic hint}) { + Future ldkNodeRemovePayment( + {required LdkNode that, required PaymentHash paymentHash, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_payment_hash(paymentHash); - return wire.wire_NodeBase_remove_payment(port_, arg0, arg1); + return wire.wire_ldk_node_remove_payment(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseRemovePaymentConstMeta, + constMeta: kLdkNodeRemovePaymentConstMeta, argValues: [that, paymentHash], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseRemovePaymentConstMeta => const TaskConstMeta( - debugName: "NodeBase_remove_payment", + TaskConstMeta get kLdkNodeRemovePaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_remove_payment", argNames: ["that", "paymentHash"], ); @override - Future nodeBaseSendAllToOnchainAddress( - {required NodeBase that, required Address address, dynamic hint}) { + Future ldkNodeSendAllToOnchainAddress( + {required LdkNode that, required Address address, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_address(address); - return wire.wire_NodeBase_send_all_to_onchain_address( + return wire.wire_ldk_node_send_all_to_onchain_address( port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendAllToOnchainAddressConstMeta, + constMeta: kLdkNodeSendAllToOnchainAddressConstMeta, argValues: [that, address], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendAllToOnchainAddressConstMeta => + TaskConstMeta get kLdkNodeSendAllToOnchainAddressConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_all_to_onchain_address", + debugName: "ldk_node_send_all_to_onchain_address", argNames: ["that", "address"], ); @override - Future nodeBaseSendPayment( - {required NodeBase that, required Bolt11Invoice invoice, dynamic hint}) { + Future ldkNodeSendPayment( + {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_NodeBase_send_payment(port_, arg0, arg1); + return wire.wire_ldk_node_send_payment(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendPaymentConstMeta, + constMeta: kLdkNodeSendPaymentConstMeta, argValues: [that, invoice], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendPaymentConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_payment", + TaskConstMeta get kLdkNodeSendPaymentConstMeta => const TaskConstMeta( + debugName: "ldk_node_send_payment", argNames: ["that", "invoice"], ); @override - Future nodeBaseSendPaymentProbes( - {required NodeBase that, required Bolt11Invoice invoice, dynamic hint}) { + Future ldkNodeSendPaymentProbes( + {required LdkNode that, required Bolt11Invoice invoice, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); - return wire.wire_NodeBase_send_payment_probes(port_, arg0, arg1); + return wire.wire_ldk_node_send_payment_probes(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendPaymentProbesConstMeta, + constMeta: kLdkNodeSendPaymentProbesConstMeta, argValues: [that, invoice], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendPaymentProbesConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_payment_probes", + TaskConstMeta get kLdkNodeSendPaymentProbesConstMeta => const TaskConstMeta( + debugName: "ldk_node_send_payment_probes", argNames: ["that", "invoice"], ); @override - Future nodeBaseSendPaymentProbesUsingAmount( - {required NodeBase that, + Future ldkNodeSendPaymentProbesUsingAmount( + {required LdkNode that, required Bolt11Invoice invoice, required int amountMsat, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); var arg2 = cst_encode_u_64(amountMsat); - return wire.wire_NodeBase_send_payment_probes_using_amount( + return wire.wire_ldk_node_send_payment_probes_using_amount( port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendPaymentProbesUsingAmountConstMeta, + constMeta: kLdkNodeSendPaymentProbesUsingAmountConstMeta, argValues: [that, invoice, amountMsat], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendPaymentProbesUsingAmountConstMeta => + TaskConstMeta get kLdkNodeSendPaymentProbesUsingAmountConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_payment_probes_using_amount", + debugName: "ldk_node_send_payment_probes_using_amount", argNames: ["that", "invoice", "amountMsat"], ); @override - Future nodeBaseSendPaymentUsingAmount( - {required NodeBase that, + Future ldkNodeSendPaymentUsingAmount( + {required LdkNode that, required Bolt11Invoice invoice, required int amountMsat, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_bolt_11_invoice(invoice); var arg2 = cst_encode_u_64(amountMsat); - return wire.wire_NodeBase_send_payment_using_amount( + return wire.wire_ldk_node_send_payment_using_amount( port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendPaymentUsingAmountConstMeta, + constMeta: kLdkNodeSendPaymentUsingAmountConstMeta, argValues: [that, invoice, amountMsat], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendPaymentUsingAmountConstMeta => + TaskConstMeta get kLdkNodeSendPaymentUsingAmountConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_payment_using_amount", + debugName: "ldk_node_send_payment_using_amount", argNames: ["that", "invoice", "amountMsat"], ); @override - Future nodeBaseSendSpontaneousPayment( - {required NodeBase that, + Future ldkNodeSendSpontaneousPayment( + {required LdkNode that, required int amountMsat, required PublicKey nodeId, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_u_64(amountMsat); var arg2 = cst_encode_box_autoadd_public_key(nodeId); - return wire.wire_NodeBase_send_spontaneous_payment( + return wire.wire_ldk_node_send_spontaneous_payment( port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_payment_hash, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendSpontaneousPaymentConstMeta, + constMeta: kLdkNodeSendSpontaneousPaymentConstMeta, argValues: [that, amountMsat, nodeId], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendSpontaneousPaymentConstMeta => + TaskConstMeta get kLdkNodeSendSpontaneousPaymentConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_spontaneous_payment", + debugName: "ldk_node_send_spontaneous_payment", argNames: ["that", "amountMsat", "nodeId"], ); @override - Future nodeBaseSendSpontaneousPaymentProbes( - {required NodeBase that, + Future ldkNodeSendSpontaneousPaymentProbes( + {required LdkNode that, required int amountMsat, required PublicKey nodeId, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_u_64(amountMsat); var arg2 = cst_encode_box_autoadd_public_key(nodeId); - return wire.wire_NodeBase_send_spontaneous_payment_probes( + return wire.wire_ldk_node_send_spontaneous_payment_probes( port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendSpontaneousPaymentProbesConstMeta, + constMeta: kLdkNodeSendSpontaneousPaymentProbesConstMeta, argValues: [that, amountMsat, nodeId], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendSpontaneousPaymentProbesConstMeta => + TaskConstMeta get kLdkNodeSendSpontaneousPaymentProbesConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_spontaneous_payment_probes", + debugName: "ldk_node_send_spontaneous_payment_probes", argNames: ["that", "amountMsat", "nodeId"], ); @override - Future nodeBaseSendToOnchainAddress( - {required NodeBase that, + Future ldkNodeSendToOnchainAddress( + {required LdkNode that, required Address address, required int amountSats, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_box_autoadd_address(address); var arg2 = cst_encode_u_64(amountSats); - return wire.wire_NodeBase_send_to_onchain_address( + return wire.wire_ldk_node_send_to_onchain_address( port_, arg0, arg1, arg2); }, codec: DcoCodec( decodeSuccessData: dco_decode_txid, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSendToOnchainAddressConstMeta, + constMeta: kLdkNodeSendToOnchainAddressConstMeta, argValues: [that, address, amountSats], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSendToOnchainAddressConstMeta => + TaskConstMeta get kLdkNodeSendToOnchainAddressConstMeta => const TaskConstMeta( - debugName: "NodeBase_send_to_onchain_address", + debugName: "ldk_node_send_to_onchain_address", argNames: ["that", "address", "amountSats"], ); @override - Future nodeBaseSignMessage( - {required NodeBase that, required List msg, dynamic hint}) { + Future ldkNodeSignMessage( + {required LdkNode that, required List msg, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_list_prim_u_8_loose(msg); - return wire.wire_NodeBase_sign_message(port_, arg0, arg1); + return wire.wire_ldk_node_sign_message(port_, arg0, arg1); }, codec: DcoCodec( decodeSuccessData: dco_decode_String, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSignMessageConstMeta, + constMeta: kLdkNodeSignMessageConstMeta, argValues: [that, msg], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSignMessageConstMeta => const TaskConstMeta( - debugName: "NodeBase_sign_message", + TaskConstMeta get kLdkNodeSignMessageConstMeta => const TaskConstMeta( + debugName: "ldk_node_sign_message", argNames: ["that", "msg"], ); @override - Future nodeBaseStart({required NodeBase that, dynamic hint}) { + Future ldkNodeSpendableOnchainBalanceSats( + {required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_start(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_spendable_onchain_balance_sats(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeSuccessData: dco_decode_u_64, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseStartConstMeta, + constMeta: kLdkNodeSpendableOnchainBalanceSatsConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseStartConstMeta => const TaskConstMeta( - debugName: "NodeBase_start", + TaskConstMeta get kLdkNodeSpendableOnchainBalanceSatsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_spendable_onchain_balance_sats", argNames: ["that"], ); @override - Future nodeBaseStatus({required NodeBase that, dynamic hint}) { + Future ldkNodeStart({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_status(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_start(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_node_status, - decodeErrorData: null, + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseStatusConstMeta, + constMeta: kLdkNodeStartConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseStatusConstMeta => const TaskConstMeta( - debugName: "NodeBase_status", + TaskConstMeta get kLdkNodeStartConstMeta => const TaskConstMeta( + debugName: "ldk_node_start", argNames: ["that"], ); @override - Future nodeBaseStop({required NodeBase that, dynamic hint}) { + Future ldkNodeStop({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_stop(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_stop(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseStopConstMeta, + constMeta: kLdkNodeStopConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseStopConstMeta => const TaskConstMeta( - debugName: "NodeBase_stop", + TaskConstMeta get kLdkNodeStopConstMeta => const TaskConstMeta( + debugName: "ldk_node_stop", argNames: ["that"], ); @override - Future nodeBaseSyncWallets({required NodeBase that, dynamic hint}) { + Future ldkNodeSyncWallets({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_sync_wallets(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_sync_wallets(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, + ), + constMeta: kLdkNodeSyncWalletsConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLdkNodeSyncWalletsConstMeta => const TaskConstMeta( + debugName: "ldk_node_sync_wallets", + argNames: ["that"], + ); + + @override + Future ldkNodeTotalOnchainBalanceSats( + {required LdkNode that, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_total_onchain_balance_sats(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_u_64, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseSyncWalletsConstMeta, + constMeta: kLdkNodeTotalOnchainBalanceSatsConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseSyncWalletsConstMeta => const TaskConstMeta( - debugName: "NodeBase_sync_wallets", + TaskConstMeta get kLdkNodeTotalOnchainBalanceSatsConstMeta => + const TaskConstMeta( + debugName: "ldk_node_total_onchain_balance_sats", argNames: ["that"], ); @override - Future nodeBaseUpdateChannelConfig( - {required NodeBase that, - required UserChannelId userChannelId, + Future ldkNodeUpdateChannelConfig( + {required LdkNode that, + required ChannelId channelId, required PublicKey counterpartyNodeId, required ChannelConfig channelConfig, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - var arg1 = cst_encode_box_autoadd_user_channel_id(userChannelId); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + var arg1 = cst_encode_box_autoadd_channel_id(channelId); var arg2 = cst_encode_box_autoadd_public_key(counterpartyNodeId); var arg3 = cst_encode_box_autoadd_channel_config(channelConfig); - return wire.wire_NodeBase_update_channel_config( + return wire.wire_ldk_node_update_channel_config( port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_unit, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseUpdateChannelConfigConstMeta, - argValues: [that, userChannelId, counterpartyNodeId, channelConfig], + constMeta: kLdkNodeUpdateChannelConfigConstMeta, + argValues: [that, channelId, counterpartyNodeId, channelConfig], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseUpdateChannelConfigConstMeta => - const TaskConstMeta( - debugName: "NodeBase_update_channel_config", - argNames: [ - "that", - "userChannelId", - "counterpartyNodeId", - "channelConfig" - ], + TaskConstMeta get kLdkNodeUpdateChannelConfigConstMeta => const TaskConstMeta( + debugName: "ldk_node_update_channel_config", + argNames: ["that", "channelId", "counterpartyNodeId", "channelConfig"], ); @override - Future nodeBaseVerifySignature( - {required NodeBase that, + Future ldkNodeVerifySignature( + {required LdkNode that, required List msg, required String sig, required PublicKey pkey, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); + var arg0 = cst_encode_box_autoadd_ldk_node(that); var arg1 = cst_encode_list_prim_u_8_loose(msg); var arg2 = cst_encode_String(sig); var arg3 = cst_encode_box_autoadd_public_key(pkey); - return wire.wire_NodeBase_verify_signature( + return wire.wire_ldk_node_verify_signature( port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( decodeSuccessData: dco_decode_bool, - decodeErrorData: dco_decode_node_base_error, + decodeErrorData: dco_decode_node_exception, ), - constMeta: kNodeBaseVerifySignatureConstMeta, + constMeta: kLdkNodeVerifySignatureConstMeta, argValues: [that, msg, sig, pkey], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseVerifySignatureConstMeta => const TaskConstMeta( - debugName: "NodeBase_verify_signature", + TaskConstMeta get kLdkNodeVerifySignatureConstMeta => const TaskConstMeta( + debugName: "ldk_node_verify_signature", argNames: ["that", "msg", "sig", "pkey"], ); @override - Future nodeBaseWaitNextEvent({required NodeBase that, dynamic hint}) { + Future ldkNodeWaitNextEvent({required LdkNode that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_node_base(that); - return wire.wire_NodeBase_wait_next_event(port_, arg0); + var arg0 = cst_encode_box_autoadd_ldk_node(that); + return wire.wire_ldk_node_wait_next_event(port_, arg0); }, codec: DcoCodec( decodeSuccessData: dco_decode_event, decodeErrorData: null, ), - constMeta: kNodeBaseWaitNextEventConstMeta, + constMeta: kLdkNodeWaitNextEventConstMeta, argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kNodeBaseWaitNextEventConstMeta => const TaskConstMeta( - debugName: "NodeBase_wait_next_event", + TaskConstMeta get kLdkNodeWaitNextEventConstMeta => const TaskConstMeta( + debugName: "ldk_node_wait_next_event", argNames: ["that"], ); @override - Future finalizeBuilder( - {required Config config, - ChainDataSourceConfig? chainDataSourceConfig, - EntropySourceConfig? entropySourceConfig, - GossipSourceConfig? gossipSourceConfig, - LiquiditySourceConfig? liquiditySourceConfig, - dynamic hint}) { + Future socketAddressAsString( + {required SocketAddress that, dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { - var arg0 = cst_encode_box_autoadd_config(config); - var arg1 = cst_encode_opt_box_autoadd_chain_data_source_config( - chainDataSourceConfig); - var arg2 = cst_encode_opt_box_autoadd_entropy_source_config( - entropySourceConfig); - var arg3 = - cst_encode_opt_box_autoadd_gossip_source_config(gossipSourceConfig); - var arg4 = cst_encode_opt_box_autoadd_liquidity_source_config( - liquiditySourceConfig); - return wire.wire_finalize_builder(port_, arg0, arg1, arg2, arg3, arg4); + var arg0 = cst_encode_box_autoadd_socket_address(that); + return wire.wire_socket_address_as_string(port_, arg0); }, codec: DcoCodec( - decodeSuccessData: dco_decode_node_base, - decodeErrorData: dco_decode_builder_error, + decodeSuccessData: dco_decode_String, + decodeErrorData: null, ), - constMeta: kFinalizeBuilderConstMeta, - argValues: [ - config, - chainDataSourceConfig, - entropySourceConfig, - gossipSourceConfig, - liquiditySourceConfig - ], + constMeta: kSocketAddressAsStringConstMeta, + argValues: [that], apiImpl: this, hint: hint, )); } - TaskConstMeta get kFinalizeBuilderConstMeta => const TaskConstMeta( - debugName: "finalize_builder", - argNames: [ - "config", - "chainDataSourceConfig", - "entropySourceConfig", - "gossipSourceConfig", - "liquiditySourceConfig" - ], + TaskConstMeta get kSocketAddressAsStringConstMeta => const TaskConstMeta( + debugName: "socket_address_as_string", + argNames: ["that"], + ); + + @override + Future socketAddressFromStr( + {required String address, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_String(address); + return wire.wire_socket_address_from_str(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_socket_address, + decodeErrorData: dco_decode_builder_exception, + ), + constMeta: kSocketAddressFromStrConstMeta, + argValues: [address], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSocketAddressFromStrConstMeta => const TaskConstMeta( + debugName: "socket_address_from_str", + argNames: ["address"], ); RustArcIncrementStrongCountFnType @@ -1436,34 +1344,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } - @protected - BalanceDetails dco_decode_balance_details(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - final arr = raw as List; - if (arr.length != 5) - throw Exception('unexpected arr length: expect 5 but see ${arr.length}'); - return BalanceDetails( - totalOnchainBalanceSats: dco_decode_u_64(arr[0]), - spendableOnchainBalanceSats: dco_decode_u_64(arr[1]), - totalLightningBalanceSats: dco_decode_u_64(arr[2]), - lightningBalances: dco_decode_list_lightning_balance(arr[3]), - pendingBalancesFromChannelClosures: - dco_decode_list_pending_sweep_balance(arr[4]), - ); - } - - @protected - BestBlock dco_decode_best_block(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - final arr = raw as List; - if (arr.length != 2) - throw Exception('unexpected arr length: expect 2 but see ${arr.length}'); - return BestBlock( - blockHash: dco_decode_String(arr[0]), - height: dco_decode_u_32(arr[1]), - ); - } - @protected Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1512,12 +1392,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_channel_id(raw); } - @protected - ClosureReason dco_decode_box_autoadd_closure_reason(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_closure_reason(raw); - } - @protected Config dco_decode_box_autoadd_config(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1544,29 +1418,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_liquidity_source_config(raw); - } - - @protected - MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_max_dust_htlc_exposure(raw); - } - - @protected - MnemonicBase dco_decode_box_autoadd_mnemonic_base(dynamic raw) { + LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_mnemonic_base(raw); + return dco_decode_ldk_mnemonic(raw); } @protected - NodeBase dco_decode_box_autoadd_node_base(dynamic raw) { + LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_node_base(raw); + return dco_decode_ldk_node(raw); } @protected @@ -1581,13 +1441,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_payment_details(raw); } - @protected - PaymentFailureReason dco_decode_box_autoadd_payment_failure_reason( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_payment_failure_reason(raw); - } - @protected PaymentHash dco_decode_box_autoadd_payment_hash(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1618,18 +1471,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return dco_decode_socket_address(raw); } - @protected - Txid dco_decode_box_autoadd_txid(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return dco_decode_txid(raw); - } - - @protected - int dco_decode_box_autoadd_u_16(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw as int; - } - @protected int dco_decode_box_autoadd_u_32(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1649,9 +1490,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - BuilderError dco_decode_builder_error(dynamic raw) { + BuilderException dco_decode_builder_exception(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return BuilderError.values[raw as int]; + return BuilderException.values[raw as int]; } @protected @@ -1677,8 +1518,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { forwardingFeeProportionalMillionths: dco_decode_u_32(arr[0]), forwardingFeeBaseMsat: dco_decode_u_32(arr[1]), cltvExpiryDelta: dco_decode_u_16(arr[2]), - maxDustHtlcExposure: - dco_decode_opt_box_autoadd_max_dust_htlc_exposure(arr[3]), + maxDustHtlcExposure: dco_decode_max_dust_htlc_exposure(arr[3]), forceCloseAvoidanceMaxFeeSatoshis: dco_decode_u_64(arr[4]), acceptUnderpayingHtlcs: dco_decode_bool(arr[5]), ); @@ -1688,42 +1528,25 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ChannelDetails dco_decode_channel_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 28) - throw Exception('unexpected arr length: expect 28 but see ${arr.length}'); + if (arr.length != 16) + throw Exception('unexpected arr length: expect 16 but see ${arr.length}'); return ChannelDetails( channelId: dco_decode_channel_id(arr[0]), counterpartyNodeId: dco_decode_public_key(arr[1]), - fundingTxo: dco_decode_opt_box_autoadd_out_point(arr[2]), + fundingTxo: dco_decode_opt_String(arr[2]), channelValueSats: dco_decode_u_64(arr[3]), unspendablePunishmentReserve: dco_decode_opt_box_autoadd_u_64(arr[4]), userChannelId: dco_decode_user_channel_id(arr[5]), feerateSatPer1000Weight: dco_decode_u_32(arr[6]), - outboundCapacityMsat: dco_decode_u_64(arr[7]), - inboundCapacityMsat: dco_decode_u_64(arr[8]), - confirmationsRequired: dco_decode_opt_box_autoadd_u_32(arr[9]), - confirmations: dco_decode_opt_box_autoadd_u_32(arr[10]), - isOutbound: dco_decode_bool(arr[11]), - isChannelReady: dco_decode_bool(arr[12]), - isUsable: dco_decode_bool(arr[13]), - isPublic: dco_decode_bool(arr[14]), - cltvExpiryDelta: dco_decode_opt_box_autoadd_u_16(arr[15]), - counterpartyUnspendablePunishmentReserve: dco_decode_u_64(arr[16]), - counterpartyOutboundHtlcMinimumMsat: - dco_decode_opt_box_autoadd_u_64(arr[17]), - counterpartyOutboundHtlcMaximumMsat: - dco_decode_opt_box_autoadd_u_64(arr[18]), - counterpartyForwardingInfoFeeBaseMsat: - dco_decode_opt_box_autoadd_u_32(arr[19]), - counterpartyForwardingInfoFeeProportionalMillionths: - dco_decode_opt_box_autoadd_u_32(arr[20]), - counterpartyForwardingInfoCltvExpiryDelta: - dco_decode_opt_box_autoadd_u_16(arr[21]), - nextOutboundHtlcLimitMsat: dco_decode_u_64(arr[22]), - nextOutboundHtlcMinimumMsat: dco_decode_u_64(arr[23]), - forceCloseSpendDelay: dco_decode_opt_box_autoadd_u_16(arr[24]), - inboundHtlcMinimumMsat: dco_decode_u_64(arr[25]), - inboundHtlcMaximumMsat: dco_decode_opt_box_autoadd_u_64(arr[26]), - config: dco_decode_channel_config(arr[27]), + balanceMsat: dco_decode_u_64(arr[7]), + outboundCapacityMsat: dco_decode_u_64(arr[8]), + inboundCapacityMsat: dco_decode_u_64(arr[9]), + confirmationsRequired: dco_decode_opt_box_autoadd_u_32(arr[10]), + confirmations: dco_decode_opt_box_autoadd_u_32(arr[11]), + isOutbound: dco_decode_bool(arr[12]), + isChannelReady: dco_decode_bool(arr[13]), + isUsable: dco_decode_bool(arr[14]), + isPublic: dco_decode_bool(arr[15]), ); } @@ -1739,40 +1562,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - ClosureReason dco_decode_closure_reason(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - switch (raw[0]) { - case 0: - return ClosureReason_CounterpartyForceClosed( - peerMsg: dco_decode_String(raw[1]), - ); - case 1: - return ClosureReason_HolderForceClosed(); - case 2: - return ClosureReason_CooperativeClosure(); - case 3: - return ClosureReason_CommitmentTxConfirmed(); - case 4: - return ClosureReason_FundingTimedOut(); - case 5: - return ClosureReason_ProcessingError( - err: dco_decode_String(raw[1]), - ); - case 6: - return ClosureReason_DisconnectedPeer(); - case 7: - return ClosureReason_OutdatedChannelManager(); - case 8: - return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); - case 9: - return ClosureReason_FundingBatchClosure(); - default: - throw Exception("unreachable"); - } - } - - @protected - Config dco_decode_config(dynamic raw) { + Config dco_decode_config(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; if (arr.length != 11) @@ -1806,7 +1596,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); case 2: return EntropySourceConfig_Bip39Mnemonic( - mnemonic: dco_decode_box_autoadd_mnemonic_base(raw[1]), + mnemonic: dco_decode_box_autoadd_ldk_mnemonic(raw[1]), passphrase: dco_decode_opt_String(raw[2]), ); default: @@ -1821,12 +1611,10 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { case 0: return Event_PaymentSuccessful( paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), - feePaidMsat: dco_decode_opt_box_autoadd_u_64(raw[2]), ); case 1: return Event_PaymentFailed( paymentHash: dco_decode_box_autoadd_payment_hash(raw[1]), - reason: dco_decode_opt_box_autoadd_payment_failure_reason(raw[2]), ); case 2: return Event_PaymentReceived( @@ -1834,25 +1622,24 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { amountMsat: dco_decode_u_64(raw[2]), ); case 3: - return Event_ChannelPending( + return Event_ChannelReady( channelId: dco_decode_box_autoadd_channel_id(raw[1]), userChannelId: dco_decode_box_autoadd_user_channel_id(raw[2]), - formerTemporaryChannelId: dco_decode_box_autoadd_channel_id(raw[3]), - counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[4]), - fundingTxo: dco_decode_box_autoadd_out_point(raw[5]), + counterpartyNodeId: dco_decode_opt_box_autoadd_public_key(raw[3]), ); case 4: - return Event_ChannelReady( + return Event_ChannelClosed( channelId: dco_decode_box_autoadd_channel_id(raw[1]), userChannelId: dco_decode_box_autoadd_user_channel_id(raw[2]), counterpartyNodeId: dco_decode_opt_box_autoadd_public_key(raw[3]), ); case 5: - return Event_ChannelClosed( + return Event_ChannelPending( channelId: dco_decode_box_autoadd_channel_id(raw[1]), userChannelId: dco_decode_box_autoadd_user_channel_id(raw[2]), - counterpartyNodeId: dco_decode_opt_box_autoadd_public_key(raw[3]), - reason: dco_decode_opt_box_autoadd_closure_reason(raw[4]), + formerTemporaryChannelId: dco_decode_box_autoadd_channel_id(raw[3]), + counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[4]), + fundingTxo: dco_decode_box_autoadd_out_point(raw[5]), ); default: throw Exception("unreachable"); @@ -1881,67 +1668,24 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - LightningBalance dco_decode_lightning_balance(dynamic raw) { + LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - switch (raw[0]) { - case 0: - return LightningBalance_ClaimableOnChannelClose( - channelId: dco_decode_box_autoadd_channel_id(raw[1]), - counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), - amountSatoshis: dco_decode_u_64(raw[3]), - ); - case 1: - return LightningBalance_ClaimableAwaitingConfirmations( - channelId: dco_decode_box_autoadd_channel_id(raw[1]), - counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), - amountSatoshis: dco_decode_u_64(raw[3]), - confirmationHeight: dco_decode_u_32(raw[4]), - ); - case 2: - return LightningBalance_ContentiousClaimable( - channelId: dco_decode_box_autoadd_channel_id(raw[1]), - counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), - amountSatoshis: dco_decode_u_64(raw[3]), - timeoutHeight: dco_decode_u_32(raw[4]), - paymentHash: dco_decode_box_autoadd_payment_hash(raw[5]), - paymentPreimage: dco_decode_box_autoadd_payment_preimage(raw[6]), - ); - case 3: - return LightningBalance_MaybeTimeoutClaimableHTLC( - channelId: dco_decode_box_autoadd_channel_id(raw[1]), - counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), - amountSatoshis: dco_decode_u_64(raw[3]), - claimableHeight: dco_decode_u_32(raw[4]), - paymentHash: dco_decode_box_autoadd_payment_hash(raw[5]), - ); - case 4: - return LightningBalance_MaybePreimageClaimableHTLC( - channelId: dco_decode_box_autoadd_channel_id(raw[1]), - counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), - amountSatoshis: dco_decode_u_64(raw[3]), - expiryHeight: dco_decode_u_32(raw[4]), - paymentHash: dco_decode_box_autoadd_payment_hash(raw[5]), - ); - case 5: - return LightningBalance_CounterpartyRevokedOutputClaimable( - channelId: dco_decode_box_autoadd_channel_id(raw[1]), - counterpartyNodeId: dco_decode_box_autoadd_public_key(raw[2]), - amountSatoshis: dco_decode_u_64(raw[3]), - ); - default: - throw Exception("unreachable"); - } + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return LdkMnemonic( + seedPhrase: dco_decode_String(arr[0]), + ); } @protected - LiquiditySourceConfig dco_decode_liquidity_source_config(dynamic raw) { + LdkNode dco_decode_ldk_node(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); - return LiquiditySourceConfig( - lsps2Service: - dco_decode_record_socket_address_public_key_opt_string(arr[0]), + return LdkNode( + ptr: dco_decode_RustOpaque_NodeSqliteStore(arr[0]), ); } @@ -1951,12 +1695,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (raw as List).map(dco_decode_channel_details).toList(); } - @protected - List dco_decode_list_lightning_balance(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return (raw as List).map(dco_decode_lightning_balance).toList(); - } - @protected List dco_decode_list_payment_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1969,14 +1707,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (raw as List).map(dco_decode_peer_details).toList(); } - @protected - List dco_decode_list_pending_sweep_balance(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return (raw as List) - .map(dco_decode_pending_sweep_balance) - .toList(); - } - @protected List dco_decode_list_prim_u_8_loose(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2024,17 +1754,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - MnemonicBase dco_decode_mnemonic_base(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - final arr = raw as List; - if (arr.length != 1) - throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); - return MnemonicBase( - seedPhrase: dco_decode_String(arr[0]), - ); - } - @protected Network dco_decode_network(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2042,40 +1761,9 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeBase dco_decode_node_base(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - final arr = raw as List; - if (arr.length != 1) - throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); - return NodeBase( - ptr: dco_decode_RustOpaque_NodeSqliteStore(arr[0]), - ); - } - - @protected - NodeBaseError dco_decode_node_base_error(dynamic raw) { + NodeException dco_decode_node_exception(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return NodeBaseError.values[raw as int]; - } - - @protected - NodeStatus dco_decode_node_status(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - final arr = raw as List; - if (arr.length != 8) - throw Exception('unexpected arr length: expect 8 but see ${arr.length}'); - return NodeStatus( - isRunning: dco_decode_bool(arr[0]), - isListening: dco_decode_bool(arr[1]), - currentBestBlock: dco_decode_best_block(arr[2]), - latestWalletSyncTimestamp: dco_decode_opt_box_autoadd_u_64(arr[3]), - latestOnchainWalletSyncTimestamp: dco_decode_opt_box_autoadd_u_64(arr[4]), - latestFeeRateCacheUpdateTimestamp: - dco_decode_opt_box_autoadd_u_64(arr[5]), - latestRgsSnapshotTimestamp: dco_decode_opt_box_autoadd_u_64(arr[6]), - latestNodeAnnouncementBroadcastTimestamp: - dco_decode_opt_box_autoadd_u_64(arr[7]), - ); + return NodeException.values[raw as int]; } @protected @@ -2099,18 +1787,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw == null ? null : dco_decode_box_autoadd_channel_config(raw); } - @protected - ChannelId? dco_decode_opt_box_autoadd_channel_id(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null ? null : dco_decode_box_autoadd_channel_id(raw); - } - - @protected - ClosureReason? dco_decode_opt_box_autoadd_closure_reason(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null ? null : dco_decode_box_autoadd_closure_reason(raw); - } - @protected EntropySourceConfig? dco_decode_opt_box_autoadd_entropy_source_config( dynamic raw) { @@ -2135,45 +1811,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { : dco_decode_box_autoadd_gossip_source_config(raw); } - @protected - LiquiditySourceConfig? dco_decode_opt_box_autoadd_liquidity_source_config( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null - ? null - : dco_decode_box_autoadd_liquidity_source_config(raw); - } - - @protected - MaxDustHTLCExposure? dco_decode_opt_box_autoadd_max_dust_htlc_exposure( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null - ? null - : dco_decode_box_autoadd_max_dust_htlc_exposure(raw); - } - - @protected - OutPoint? dco_decode_opt_box_autoadd_out_point(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null ? null : dco_decode_box_autoadd_out_point(raw); - } - @protected PaymentDetails? dco_decode_opt_box_autoadd_payment_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs return raw == null ? null : dco_decode_box_autoadd_payment_details(raw); } - @protected - PaymentFailureReason? dco_decode_opt_box_autoadd_payment_failure_reason( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null - ? null - : dco_decode_box_autoadd_payment_failure_reason(raw); - } - @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2192,12 +1835,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return raw == null ? null : dco_decode_box_autoadd_public_key(raw); } - @protected - int? dco_decode_opt_box_autoadd_u_16(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null ? null : dco_decode_box_autoadd_u_16(raw); - } - @protected int? dco_decode_opt_box_autoadd_u_32(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2250,12 +1887,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return PaymentDirection.values[raw as int]; } - @protected - PaymentFailureReason dco_decode_payment_failure_reason(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return PaymentFailureReason.values[raw as int]; - } - @protected PaymentHash dco_decode_payment_hash(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2308,35 +1939,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { ); } - @protected - PendingSweepBalance dco_decode_pending_sweep_balance(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - switch (raw[0]) { - case 0: - return PendingSweepBalance_PendingBroadcast( - channelId: dco_decode_opt_box_autoadd_channel_id(raw[1]), - amountSatoshis: dco_decode_u_64(raw[2]), - ); - case 1: - return PendingSweepBalance_BroadcastAwaitingConfirmation( - channelId: dco_decode_opt_box_autoadd_channel_id(raw[1]), - latestBroadcastHeight: dco_decode_u_32(raw[2]), - latestSpendingTxid: dco_decode_box_autoadd_txid(raw[3]), - amountSatoshis: dco_decode_u_64(raw[4]), - ); - case 2: - return PendingSweepBalance_AwaitingThresholdConfirmations( - channelId: dco_decode_opt_box_autoadd_channel_id(raw[1]), - latestSpendingTxid: dco_decode_box_autoadd_txid(raw[2]), - confirmationHash: dco_decode_String(raw[3]), - confirmationHeight: dco_decode_u_32(raw[4]), - amountSatoshis: dco_decode_u_64(raw[5]), - ); - default: - throw Exception("unreachable"); - } - } - @protected PublicKey dco_decode_public_key(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -2344,22 +1946,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); return PublicKey( - hexCode: dco_decode_String(arr[0]), - ); - } - - @protected - (SocketAddress, PublicKey, String?) - dco_decode_record_socket_address_public_key_opt_string(dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - final arr = raw as List; - if (arr.length != 3) { - throw Exception('Expected 3 elements, got ${arr.length}'); - } - return ( - dco_decode_socket_address(arr[0]), - dco_decode_public_key(arr[1]), - dco_decode_opt_String(arr[2]), + hex: dco_decode_String(arr[0]), ); } @@ -2476,7 +2063,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); return UserChannelId( - data: dco_decode_list_prim_u_8_strict(arr[0]), + data: dco_decode_u_64(arr[0]), ); } @@ -2508,32 +2095,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return Address(s: var_s); } - @protected - BalanceDetails sse_decode_balance_details(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - var var_totalOnchainBalanceSats = sse_decode_u_64(deserializer); - var var_spendableOnchainBalanceSats = sse_decode_u_64(deserializer); - var var_totalLightningBalanceSats = sse_decode_u_64(deserializer); - var var_lightningBalances = sse_decode_list_lightning_balance(deserializer); - var var_pendingBalancesFromChannelClosures = - sse_decode_list_pending_sweep_balance(deserializer); - return BalanceDetails( - totalOnchainBalanceSats: var_totalOnchainBalanceSats, - spendableOnchainBalanceSats: var_spendableOnchainBalanceSats, - totalLightningBalanceSats: var_totalLightningBalanceSats, - lightningBalances: var_lightningBalances, - pendingBalancesFromChannelClosures: - var_pendingBalancesFromChannelClosures); - } - - @protected - BestBlock sse_decode_best_block(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - var var_blockHash = sse_decode_String(deserializer); - var var_height = sse_decode_u_32(deserializer); - return BestBlock(blockHash: var_blockHash, height: var_height); - } - @protected Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2580,13 +2141,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_channel_id(deserializer)); } - @protected - ClosureReason sse_decode_box_autoadd_closure_reason( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_closure_reason(deserializer)); - } - @protected Config sse_decode_box_autoadd_config(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2614,30 +2168,16 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_liquidity_source_config(deserializer)); - } - - @protected - MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_max_dust_htlc_exposure(deserializer)); - } - - @protected - MnemonicBase sse_decode_box_autoadd_mnemonic_base( + LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_mnemonic_base(deserializer)); + return (sse_decode_ldk_mnemonic(deserializer)); } @protected - NodeBase sse_decode_box_autoadd_node_base(SseDeserializer deserializer) { + LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_node_base(deserializer)); + return (sse_decode_ldk_node(deserializer)); } @protected @@ -2653,13 +2193,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_payment_details(deserializer)); } - @protected - PaymentFailureReason sse_decode_box_autoadd_payment_failure_reason( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_payment_failure_reason(deserializer)); - } - @protected PaymentHash sse_decode_box_autoadd_payment_hash( SseDeserializer deserializer) { @@ -2694,18 +2227,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return (sse_decode_socket_address(deserializer)); } - @protected - Txid sse_decode_box_autoadd_txid(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_txid(deserializer)); - } - - @protected - int sse_decode_box_autoadd_u_16(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return (sse_decode_u_16(deserializer)); - } - @protected int sse_decode_box_autoadd_u_32(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2726,10 +2247,10 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - BuilderError sse_decode_builder_error(SseDeserializer deserializer) { + BuilderException sse_decode_builder_exception(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var inner = sse_decode_i_32(deserializer); - return BuilderError.values[inner]; + return BuilderException.values[inner]; } @protected @@ -2754,7 +2275,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_forwardingFeeBaseMsat = sse_decode_u_32(deserializer); var var_cltvExpiryDelta = sse_decode_u_16(deserializer); var var_maxDustHtlcExposure = - sse_decode_opt_box_autoadd_max_dust_htlc_exposure(deserializer); + sse_decode_max_dust_htlc_exposure(deserializer); var var_forceCloseAvoidanceMaxFeeSatoshis = sse_decode_u_64(deserializer); var var_acceptUnderpayingHtlcs = sse_decode_bool(deserializer); return ChannelConfig( @@ -2773,12 +2294,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { // Codec=Sse (Serialization based), see doc to use other codecs var var_channelId = sse_decode_channel_id(deserializer); var var_counterpartyNodeId = sse_decode_public_key(deserializer); - var var_fundingTxo = sse_decode_opt_box_autoadd_out_point(deserializer); + var var_fundingTxo = sse_decode_opt_String(deserializer); var var_channelValueSats = sse_decode_u_64(deserializer); var var_unspendablePunishmentReserve = sse_decode_opt_box_autoadd_u_64(deserializer); var var_userChannelId = sse_decode_user_channel_id(deserializer); var var_feerateSatPer1000Weight = sse_decode_u_32(deserializer); + var var_balanceMsat = sse_decode_u_64(deserializer); var var_outboundCapacityMsat = sse_decode_u_64(deserializer); var var_inboundCapacityMsat = sse_decode_u_64(deserializer); var var_confirmationsRequired = @@ -2788,27 +2310,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_isChannelReady = sse_decode_bool(deserializer); var var_isUsable = sse_decode_bool(deserializer); var var_isPublic = sse_decode_bool(deserializer); - var var_cltvExpiryDelta = sse_decode_opt_box_autoadd_u_16(deserializer); - var var_counterpartyUnspendablePunishmentReserve = - sse_decode_u_64(deserializer); - var var_counterpartyOutboundHtlcMinimumMsat = - sse_decode_opt_box_autoadd_u_64(deserializer); - var var_counterpartyOutboundHtlcMaximumMsat = - sse_decode_opt_box_autoadd_u_64(deserializer); - var var_counterpartyForwardingInfoFeeBaseMsat = - sse_decode_opt_box_autoadd_u_32(deserializer); - var var_counterpartyForwardingInfoFeeProportionalMillionths = - sse_decode_opt_box_autoadd_u_32(deserializer); - var var_counterpartyForwardingInfoCltvExpiryDelta = - sse_decode_opt_box_autoadd_u_16(deserializer); - var var_nextOutboundHtlcLimitMsat = sse_decode_u_64(deserializer); - var var_nextOutboundHtlcMinimumMsat = sse_decode_u_64(deserializer); - var var_forceCloseSpendDelay = - sse_decode_opt_box_autoadd_u_16(deserializer); - var var_inboundHtlcMinimumMsat = sse_decode_u_64(deserializer); - var var_inboundHtlcMaximumMsat = - sse_decode_opt_box_autoadd_u_64(deserializer); - var var_config = sse_decode_channel_config(deserializer); return ChannelDetails( channelId: var_channelId, counterpartyNodeId: var_counterpartyNodeId, @@ -2817,6 +2318,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { unspendablePunishmentReserve: var_unspendablePunishmentReserve, userChannelId: var_userChannelId, feerateSatPer1000Weight: var_feerateSatPer1000Weight, + balanceMsat: var_balanceMsat, outboundCapacityMsat: var_outboundCapacityMsat, inboundCapacityMsat: var_inboundCapacityMsat, confirmationsRequired: var_confirmationsRequired, @@ -2824,26 +2326,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { isOutbound: var_isOutbound, isChannelReady: var_isChannelReady, isUsable: var_isUsable, - isPublic: var_isPublic, - cltvExpiryDelta: var_cltvExpiryDelta, - counterpartyUnspendablePunishmentReserve: - var_counterpartyUnspendablePunishmentReserve, - counterpartyOutboundHtlcMinimumMsat: - var_counterpartyOutboundHtlcMinimumMsat, - counterpartyOutboundHtlcMaximumMsat: - var_counterpartyOutboundHtlcMaximumMsat, - counterpartyForwardingInfoFeeBaseMsat: - var_counterpartyForwardingInfoFeeBaseMsat, - counterpartyForwardingInfoFeeProportionalMillionths: - var_counterpartyForwardingInfoFeeProportionalMillionths, - counterpartyForwardingInfoCltvExpiryDelta: - var_counterpartyForwardingInfoCltvExpiryDelta, - nextOutboundHtlcLimitMsat: var_nextOutboundHtlcLimitMsat, - nextOutboundHtlcMinimumMsat: var_nextOutboundHtlcMinimumMsat, - forceCloseSpendDelay: var_forceCloseSpendDelay, - inboundHtlcMinimumMsat: var_inboundHtlcMinimumMsat, - inboundHtlcMaximumMsat: var_inboundHtlcMaximumMsat, - config: var_config); + isPublic: var_isPublic); } @protected @@ -2853,39 +2336,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ChannelId(data: var_data); } - @protected - ClosureReason sse_decode_closure_reason(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - var tag_ = sse_decode_i_32(deserializer); - switch (tag_) { - case 0: - var var_peerMsg = sse_decode_String(deserializer); - return ClosureReason_CounterpartyForceClosed(peerMsg: var_peerMsg); - case 1: - return ClosureReason_HolderForceClosed(); - case 2: - return ClosureReason_CooperativeClosure(); - case 3: - return ClosureReason_CommitmentTxConfirmed(); - case 4: - return ClosureReason_FundingTimedOut(); - case 5: - var var_err = sse_decode_String(deserializer); - return ClosureReason_ProcessingError(err: var_err); - case 6: - return ClosureReason_DisconnectedPeer(); - case 7: - return ClosureReason_OutdatedChannelManager(); - case 8: - return ClosureReason_CounterpartyCoopClosedUnfundedChannel(); - case 9: - return ClosureReason_FundingBatchClosure(); - default: - throw UnimplementedError(''); - } - } - @protected Config sse_decode_config(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -2929,7 +2379,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_field0 = sse_decode_u_8_array_64(deserializer); return EntropySourceConfig_SeedBytes(var_field0); case 2: - var var_mnemonic = sse_decode_box_autoadd_mnemonic_base(deserializer); + var var_mnemonic = sse_decode_box_autoadd_ldk_mnemonic(deserializer); var var_passphrase = sse_decode_opt_String(deserializer); return EntropySourceConfig_Bip39Mnemonic( mnemonic: var_mnemonic, passphrase: var_passphrase); @@ -2946,15 +2396,10 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { switch (tag_) { case 0: var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - var var_feePaidMsat = sse_decode_opt_box_autoadd_u_64(deserializer); - return Event_PaymentSuccessful( - paymentHash: var_paymentHash, feePaidMsat: var_feePaidMsat); + return Event_PaymentSuccessful(paymentHash: var_paymentHash); case 1: var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - var var_reason = - sse_decode_opt_box_autoadd_payment_failure_reason(deserializer); - return Event_PaymentFailed( - paymentHash: var_paymentHash, reason: var_reason); + return Event_PaymentFailed(paymentHash: var_paymentHash); case 2: var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); var var_amountMsat = sse_decode_u_64(deserializer); @@ -2964,24 +2409,19 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); var var_userChannelId = sse_decode_box_autoadd_user_channel_id(deserializer); - var var_formerTemporaryChannelId = - sse_decode_box_autoadd_channel_id(deserializer); var var_counterpartyNodeId = - sse_decode_box_autoadd_public_key(deserializer); - var var_fundingTxo = sse_decode_box_autoadd_out_point(deserializer); - return Event_ChannelPending( + sse_decode_opt_box_autoadd_public_key(deserializer); + return Event_ChannelReady( channelId: var_channelId, userChannelId: var_userChannelId, - formerTemporaryChannelId: var_formerTemporaryChannelId, - counterpartyNodeId: var_counterpartyNodeId, - fundingTxo: var_fundingTxo); + counterpartyNodeId: var_counterpartyNodeId); case 4: var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); var var_userChannelId = sse_decode_box_autoadd_user_channel_id(deserializer); var var_counterpartyNodeId = sse_decode_opt_box_autoadd_public_key(deserializer); - return Event_ChannelReady( + return Event_ChannelClosed( channelId: var_channelId, userChannelId: var_userChannelId, counterpartyNodeId: var_counterpartyNodeId); @@ -2989,15 +2429,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); var var_userChannelId = sse_decode_box_autoadd_user_channel_id(deserializer); + var var_formerTemporaryChannelId = + sse_decode_box_autoadd_channel_id(deserializer); var var_counterpartyNodeId = - sse_decode_opt_box_autoadd_public_key(deserializer); - var var_reason = - sse_decode_opt_box_autoadd_closure_reason(deserializer); - return Event_ChannelClosed( + sse_decode_box_autoadd_public_key(deserializer); + var var_fundingTxo = sse_decode_box_autoadd_out_point(deserializer); + return Event_ChannelPending( channelId: var_channelId, userChannelId: var_userChannelId, + formerTemporaryChannelId: var_formerTemporaryChannelId, counterpartyNodeId: var_counterpartyNodeId, - reason: var_reason); + fundingTxo: var_fundingTxo); default: throw UnimplementedError(''); } @@ -3027,94 +2469,17 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer) { + LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - - var tag_ = sse_decode_i_32(deserializer); - switch (tag_) { - case 0: - var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); - var var_counterpartyNodeId = - sse_decode_box_autoadd_public_key(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - return LightningBalance_ClaimableOnChannelClose( - channelId: var_channelId, - counterpartyNodeId: var_counterpartyNodeId, - amountSatoshis: var_amountSatoshis); - case 1: - var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); - var var_counterpartyNodeId = - sse_decode_box_autoadd_public_key(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - var var_confirmationHeight = sse_decode_u_32(deserializer); - return LightningBalance_ClaimableAwaitingConfirmations( - channelId: var_channelId, - counterpartyNodeId: var_counterpartyNodeId, - amountSatoshis: var_amountSatoshis, - confirmationHeight: var_confirmationHeight); - case 2: - var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); - var var_counterpartyNodeId = - sse_decode_box_autoadd_public_key(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - var var_timeoutHeight = sse_decode_u_32(deserializer); - var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - var var_paymentPreimage = - sse_decode_box_autoadd_payment_preimage(deserializer); - return LightningBalance_ContentiousClaimable( - channelId: var_channelId, - counterpartyNodeId: var_counterpartyNodeId, - amountSatoshis: var_amountSatoshis, - timeoutHeight: var_timeoutHeight, - paymentHash: var_paymentHash, - paymentPreimage: var_paymentPreimage); - case 3: - var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); - var var_counterpartyNodeId = - sse_decode_box_autoadd_public_key(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - var var_claimableHeight = sse_decode_u_32(deserializer); - var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return LightningBalance_MaybeTimeoutClaimableHTLC( - channelId: var_channelId, - counterpartyNodeId: var_counterpartyNodeId, - amountSatoshis: var_amountSatoshis, - claimableHeight: var_claimableHeight, - paymentHash: var_paymentHash); - case 4: - var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); - var var_counterpartyNodeId = - sse_decode_box_autoadd_public_key(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - var var_expiryHeight = sse_decode_u_32(deserializer); - var var_paymentHash = sse_decode_box_autoadd_payment_hash(deserializer); - return LightningBalance_MaybePreimageClaimableHTLC( - channelId: var_channelId, - counterpartyNodeId: var_counterpartyNodeId, - amountSatoshis: var_amountSatoshis, - expiryHeight: var_expiryHeight, - paymentHash: var_paymentHash); - case 5: - var var_channelId = sse_decode_box_autoadd_channel_id(deserializer); - var var_counterpartyNodeId = - sse_decode_box_autoadd_public_key(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - return LightningBalance_CounterpartyRevokedOutputClaimable( - channelId: var_channelId, - counterpartyNodeId: var_counterpartyNodeId, - amountSatoshis: var_amountSatoshis); - default: - throw UnimplementedError(''); - } + var var_seedPhrase = sse_decode_String(deserializer); + return LdkMnemonic(seedPhrase: var_seedPhrase); } @protected - LiquiditySourceConfig sse_decode_liquidity_source_config( - SseDeserializer deserializer) { + LdkNode sse_decode_ldk_node(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_lsps2Service = - sse_decode_record_socket_address_public_key_opt_string(deserializer); - return LiquiditySourceConfig(lsps2Service: var_lsps2Service); + var var_ptr = sse_decode_RustOpaque_NodeSqliteStore(deserializer); + return LdkNode(ptr: var_ptr); } @protected @@ -3130,19 +2495,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ans_; } - @protected - List sse_decode_list_lightning_balance( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - var len_ = sse_decode_i_32(deserializer); - var ans_ = []; - for (var idx_ = 0; idx_ < len_; ++idx_) { - ans_.add(sse_decode_lightning_balance(deserializer)); - } - return ans_; - } - @protected List sse_decode_list_payment_details( SseDeserializer deserializer) { @@ -3168,19 +2520,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return ans_; } - @protected - List sse_decode_list_pending_sweep_balance( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - var len_ = sse_decode_i_32(deserializer); - var ans_ = []; - for (var idx_ = 0; idx_ < len_; ++idx_) { - ans_.add(sse_decode_pending_sweep_balance(deserializer)); - } - return ans_; - } - @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3245,13 +2584,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - MnemonicBase sse_decode_mnemonic_base(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - var var_seedPhrase = sse_decode_String(deserializer); - return MnemonicBase(seedPhrase: var_seedPhrase); - } - @protected Network sse_decode_network(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3260,46 +2592,10 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - NodeBase sse_decode_node_base(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - var var_ptr = sse_decode_RustOpaque_NodeSqliteStore(deserializer); - return NodeBase(ptr: var_ptr); - } - - @protected - NodeBaseError sse_decode_node_base_error(SseDeserializer deserializer) { + NodeException sse_decode_node_exception(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var inner = sse_decode_i_32(deserializer); - return NodeBaseError.values[inner]; - } - - @protected - NodeStatus sse_decode_node_status(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - var var_isRunning = sse_decode_bool(deserializer); - var var_isListening = sse_decode_bool(deserializer); - var var_currentBestBlock = sse_decode_best_block(deserializer); - var var_latestWalletSyncTimestamp = - sse_decode_opt_box_autoadd_u_64(deserializer); - var var_latestOnchainWalletSyncTimestamp = - sse_decode_opt_box_autoadd_u_64(deserializer); - var var_latestFeeRateCacheUpdateTimestamp = - sse_decode_opt_box_autoadd_u_64(deserializer); - var var_latestRgsSnapshotTimestamp = - sse_decode_opt_box_autoadd_u_64(deserializer); - var var_latestNodeAnnouncementBroadcastTimestamp = - sse_decode_opt_box_autoadd_u_64(deserializer); - return NodeStatus( - isRunning: var_isRunning, - isListening: var_isListening, - currentBestBlock: var_currentBestBlock, - latestWalletSyncTimestamp: var_latestWalletSyncTimestamp, - latestOnchainWalletSyncTimestamp: var_latestOnchainWalletSyncTimestamp, - latestFeeRateCacheUpdateTimestamp: - var_latestFeeRateCacheUpdateTimestamp, - latestRgsSnapshotTimestamp: var_latestRgsSnapshotTimestamp, - latestNodeAnnouncementBroadcastTimestamp: - var_latestNodeAnnouncementBroadcastTimestamp); + return NodeException.values[inner]; } @protected @@ -3337,30 +2633,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - ChannelId? sse_decode_opt_box_autoadd_channel_id( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - if (sse_decode_bool(deserializer)) { - return (sse_decode_box_autoadd_channel_id(deserializer)); - } else { - return null; - } - } - - @protected - ClosureReason? sse_decode_opt_box_autoadd_closure_reason( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - if (sse_decode_bool(deserializer)) { - return (sse_decode_box_autoadd_closure_reason(deserializer)); - } else { - return null; - } - } - @protected EntropySourceConfig? sse_decode_opt_box_autoadd_entropy_source_config( SseDeserializer deserializer) { @@ -3396,41 +2668,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - LiquiditySourceConfig? sse_decode_opt_box_autoadd_liquidity_source_config( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - if (sse_decode_bool(deserializer)) { - return (sse_decode_box_autoadd_liquidity_source_config(deserializer)); - } else { - return null; - } - } - - @protected - MaxDustHTLCExposure? sse_decode_opt_box_autoadd_max_dust_htlc_exposure( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - if (sse_decode_bool(deserializer)) { - return (sse_decode_box_autoadd_max_dust_htlc_exposure(deserializer)); - } else { - return null; - } - } - - @protected - OutPoint? sse_decode_opt_box_autoadd_out_point(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - if (sse_decode_bool(deserializer)) { - return (sse_decode_box_autoadd_out_point(deserializer)); - } else { - return null; - } - } - @protected PaymentDetails? sse_decode_opt_box_autoadd_payment_details( SseDeserializer deserializer) { @@ -3443,18 +2680,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - PaymentFailureReason? sse_decode_opt_box_autoadd_payment_failure_reason( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - if (sse_decode_bool(deserializer)) { - return (sse_decode_box_autoadd_payment_failure_reason(deserializer)); - } else { - return null; - } - } - @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer) { @@ -3491,17 +2716,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - int? sse_decode_opt_box_autoadd_u_16(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - if (sse_decode_bool(deserializer)) { - return (sse_decode_box_autoadd_u_16(deserializer)); - } else { - return null; - } - } - @protected int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3560,22 +2774,14 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { secret: var_secret, amountMsat: var_amountMsat, direction: var_direction, - status: var_status); - } - - @protected - PaymentDirection sse_decode_payment_direction(SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - var inner = sse_decode_i_32(deserializer); - return PaymentDirection.values[inner]; + status: var_status); } @protected - PaymentFailureReason sse_decode_payment_failure_reason( - SseDeserializer deserializer) { + PaymentDirection sse_decode_payment_direction(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var inner = sse_decode_i_32(deserializer); - return PaymentFailureReason.values[inner]; + return PaymentDirection.values[inner]; } @protected @@ -3616,61 +2822,11 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { nodeId: var_nodeId, address: var_address, isConnected: var_isConnected); } - @protected - PendingSweepBalance sse_decode_pending_sweep_balance( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - var tag_ = sse_decode_i_32(deserializer); - switch (tag_) { - case 0: - var var_channelId = sse_decode_opt_box_autoadd_channel_id(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - return PendingSweepBalance_PendingBroadcast( - channelId: var_channelId, amountSatoshis: var_amountSatoshis); - case 1: - var var_channelId = sse_decode_opt_box_autoadd_channel_id(deserializer); - var var_latestBroadcastHeight = sse_decode_u_32(deserializer); - var var_latestSpendingTxid = sse_decode_box_autoadd_txid(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - return PendingSweepBalance_BroadcastAwaitingConfirmation( - channelId: var_channelId, - latestBroadcastHeight: var_latestBroadcastHeight, - latestSpendingTxid: var_latestSpendingTxid, - amountSatoshis: var_amountSatoshis); - case 2: - var var_channelId = sse_decode_opt_box_autoadd_channel_id(deserializer); - var var_latestSpendingTxid = sse_decode_box_autoadd_txid(deserializer); - var var_confirmationHash = sse_decode_String(deserializer); - var var_confirmationHeight = sse_decode_u_32(deserializer); - var var_amountSatoshis = sse_decode_u_64(deserializer); - return PendingSweepBalance_AwaitingThresholdConfirmations( - channelId: var_channelId, - latestSpendingTxid: var_latestSpendingTxid, - confirmationHash: var_confirmationHash, - confirmationHeight: var_confirmationHeight, - amountSatoshis: var_amountSatoshis); - default: - throw UnimplementedError(''); - } - } - @protected PublicKey sse_decode_public_key(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_hexCode = sse_decode_String(deserializer); - return PublicKey(hexCode: var_hexCode); - } - - @protected - (SocketAddress, PublicKey, String?) - sse_decode_record_socket_address_public_key_opt_string( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - var var_field0 = sse_decode_socket_address(deserializer); - var var_field1 = sse_decode_public_key(deserializer); - var var_field2 = sse_decode_opt_String(deserializer); - return (var_field0, var_field1, var_field2); + var var_hex = sse_decode_String(deserializer); + return PublicKey(hex: var_hex); } @protected @@ -3783,7 +2939,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { @protected UserChannelId sse_decode_user_channel_id(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - var var_data = sse_decode_list_prim_u_8_strict(deserializer); + var var_data = sse_decode_u_64(deserializer); return UserChannelId(data: var_data); } @@ -3807,7 +2963,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_builder_error(BuilderError raw) { + int cst_encode_builder_exception(BuilderException raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_i_32(raw.index); } @@ -3831,7 +2987,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - int cst_encode_node_base_error(NodeBaseError raw) { + int cst_encode_node_exception(NodeException raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_i_32(raw.index); } @@ -3842,12 +2998,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { return cst_encode_i_32(raw.index); } - @protected - int cst_encode_payment_failure_reason(PaymentFailureReason raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_i_32(raw.index); - } - @protected int cst_encode_payment_status(PaymentStatus raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -3903,25 +3053,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_String(self.s, serializer); } - @protected - void sse_encode_balance_details( - BalanceDetails self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_u_64(self.totalOnchainBalanceSats, serializer); - sse_encode_u_64(self.spendableOnchainBalanceSats, serializer); - sse_encode_u_64(self.totalLightningBalanceSats, serializer); - sse_encode_list_lightning_balance(self.lightningBalances, serializer); - sse_encode_list_pending_sweep_balance( - self.pendingBalancesFromChannelClosures, serializer); - } - - @protected - void sse_encode_best_block(BestBlock self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_String(self.blockHash, serializer); - sse_encode_u_32(self.height, serializer); - } - @protected void sse_encode_bolt_11_invoice( Bolt11Invoice self, SseSerializer serializer) { @@ -3969,13 +3100,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_channel_id(self, serializer); } - @protected - void sse_encode_box_autoadd_closure_reason( - ClosureReason self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_closure_reason(self, serializer); - } - @protected void sse_encode_box_autoadd_config(Config self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4003,31 +3127,16 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_box_autoadd_liquidity_source_config( - LiquiditySourceConfig self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_liquidity_source_config(self, serializer); - } - - @protected - void sse_encode_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_max_dust_htlc_exposure(self, serializer); - } - - @protected - void sse_encode_box_autoadd_mnemonic_base( - MnemonicBase self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_mnemonic( + LdkMnemonic self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_mnemonic_base(self, serializer); + sse_encode_ldk_mnemonic(self, serializer); } @protected - void sse_encode_box_autoadd_node_base( - NodeBase self, SseSerializer serializer) { + void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_node_base(self, serializer); + sse_encode_ldk_node(self, serializer); } @protected @@ -4044,13 +3153,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_payment_details(self, serializer); } - @protected - void sse_encode_box_autoadd_payment_failure_reason( - PaymentFailureReason self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_payment_failure_reason(self, serializer); - } - @protected void sse_encode_box_autoadd_payment_hash( PaymentHash self, SseSerializer serializer) { @@ -4086,18 +3188,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_socket_address(self, serializer); } - @protected - void sse_encode_box_autoadd_txid(Txid self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_txid(self, serializer); - } - - @protected - void sse_encode_box_autoadd_u_16(int self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_u_16(self, serializer); - } - @protected void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4118,7 +3208,8 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_builder_error(BuilderError self, SseSerializer serializer) { + void sse_encode_builder_exception( + BuilderException self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.index, serializer); } @@ -4140,8 +3231,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_u_32(self.forwardingFeeProportionalMillionths, serializer); sse_encode_u_32(self.forwardingFeeBaseMsat, serializer); sse_encode_u_16(self.cltvExpiryDelta, serializer); - sse_encode_opt_box_autoadd_max_dust_htlc_exposure( - self.maxDustHtlcExposure, serializer); + sse_encode_max_dust_htlc_exposure(self.maxDustHtlcExposure, serializer); sse_encode_u_64(self.forceCloseAvoidanceMaxFeeSatoshis, serializer); sse_encode_bool(self.acceptUnderpayingHtlcs, serializer); } @@ -4152,12 +3242,13 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_channel_id(self.channelId, serializer); sse_encode_public_key(self.counterpartyNodeId, serializer); - sse_encode_opt_box_autoadd_out_point(self.fundingTxo, serializer); + sse_encode_opt_String(self.fundingTxo, serializer); sse_encode_u_64(self.channelValueSats, serializer); sse_encode_opt_box_autoadd_u_64( self.unspendablePunishmentReserve, serializer); sse_encode_user_channel_id(self.userChannelId, serializer); sse_encode_u_32(self.feerateSatPer1000Weight, serializer); + sse_encode_u_64(self.balanceMsat, serializer); sse_encode_u_64(self.outboundCapacityMsat, serializer); sse_encode_u_64(self.inboundCapacityMsat, serializer); sse_encode_opt_box_autoadd_u_32(self.confirmationsRequired, serializer); @@ -4166,24 +3257,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_bool(self.isChannelReady, serializer); sse_encode_bool(self.isUsable, serializer); sse_encode_bool(self.isPublic, serializer); - sse_encode_opt_box_autoadd_u_16(self.cltvExpiryDelta, serializer); - sse_encode_u_64(self.counterpartyUnspendablePunishmentReserve, serializer); - sse_encode_opt_box_autoadd_u_64( - self.counterpartyOutboundHtlcMinimumMsat, serializer); - sse_encode_opt_box_autoadd_u_64( - self.counterpartyOutboundHtlcMaximumMsat, serializer); - sse_encode_opt_box_autoadd_u_32( - self.counterpartyForwardingInfoFeeBaseMsat, serializer); - sse_encode_opt_box_autoadd_u_32( - self.counterpartyForwardingInfoFeeProportionalMillionths, serializer); - sse_encode_opt_box_autoadd_u_16( - self.counterpartyForwardingInfoCltvExpiryDelta, serializer); - sse_encode_u_64(self.nextOutboundHtlcLimitMsat, serializer); - sse_encode_u_64(self.nextOutboundHtlcMinimumMsat, serializer); - sse_encode_opt_box_autoadd_u_16(self.forceCloseSpendDelay, serializer); - sse_encode_u_64(self.inboundHtlcMinimumMsat, serializer); - sse_encode_opt_box_autoadd_u_64(self.inboundHtlcMaximumMsat, serializer); - sse_encode_channel_config(self.config, serializer); } @protected @@ -4192,35 +3265,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_u_8_array_32(self.data, serializer); } - @protected - void sse_encode_closure_reason(ClosureReason self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - switch (self) { - case ClosureReason_CounterpartyForceClosed(peerMsg: final peerMsg): - sse_encode_i_32(0, serializer); - sse_encode_String(peerMsg, serializer); - case ClosureReason_HolderForceClosed(): - sse_encode_i_32(1, serializer); - case ClosureReason_CooperativeClosure(): - sse_encode_i_32(2, serializer); - case ClosureReason_CommitmentTxConfirmed(): - sse_encode_i_32(3, serializer); - case ClosureReason_FundingTimedOut(): - sse_encode_i_32(4, serializer); - case ClosureReason_ProcessingError(err: final err): - sse_encode_i_32(5, serializer); - sse_encode_String(err, serializer); - case ClosureReason_DisconnectedPeer(): - sse_encode_i_32(6, serializer); - case ClosureReason_OutdatedChannelManager(): - sse_encode_i_32(7, serializer); - case ClosureReason_CounterpartyCoopClosedUnfundedChannel(): - sse_encode_i_32(8, serializer); - case ClosureReason_FundingBatchClosure(): - sse_encode_i_32(9, serializer); - } - } - @protected void sse_encode_config(Config self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4253,7 +3297,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { passphrase: final passphrase ): sse_encode_i_32(2, serializer); - sse_encode_box_autoadd_mnemonic_base(mnemonic, serializer); + sse_encode_box_autoadd_ldk_mnemonic(mnemonic, serializer); sse_encode_opt_String(passphrase, serializer); } } @@ -4262,20 +3306,12 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { void sse_encode_event(Event self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs switch (self) { - case Event_PaymentSuccessful( - paymentHash: final paymentHash, - feePaidMsat: final feePaidMsat - ): + case Event_PaymentSuccessful(paymentHash: final paymentHash): sse_encode_i_32(0, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - sse_encode_opt_box_autoadd_u_64(feePaidMsat, serializer); - case Event_PaymentFailed( - paymentHash: final paymentHash, - reason: final reason - ): + case Event_PaymentFailed(paymentHash: final paymentHash): sse_encode_i_32(1, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - sse_encode_opt_box_autoadd_payment_failure_reason(reason, serializer); case Event_PaymentReceived( paymentHash: final paymentHash, amountMsat: final amountMsat @@ -4283,20 +3319,16 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(2, serializer); sse_encode_box_autoadd_payment_hash(paymentHash, serializer); sse_encode_u_64(amountMsat, serializer); - case Event_ChannelPending( + case Event_ChannelReady( channelId: final channelId, userChannelId: final userChannelId, - formerTemporaryChannelId: final formerTemporaryChannelId, - counterpartyNodeId: final counterpartyNodeId, - fundingTxo: final fundingTxo + counterpartyNodeId: final counterpartyNodeId ): sse_encode_i_32(3, serializer); sse_encode_box_autoadd_channel_id(channelId, serializer); sse_encode_box_autoadd_user_channel_id(userChannelId, serializer); - sse_encode_box_autoadd_channel_id(formerTemporaryChannelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_box_autoadd_out_point(fundingTxo, serializer); - case Event_ChannelReady( + sse_encode_opt_box_autoadd_public_key(counterpartyNodeId, serializer); + case Event_ChannelClosed( channelId: final channelId, userChannelId: final userChannelId, counterpartyNodeId: final counterpartyNodeId @@ -4305,17 +3337,19 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_box_autoadd_channel_id(channelId, serializer); sse_encode_box_autoadd_user_channel_id(userChannelId, serializer); sse_encode_opt_box_autoadd_public_key(counterpartyNodeId, serializer); - case Event_ChannelClosed( + case Event_ChannelPending( channelId: final channelId, userChannelId: final userChannelId, + formerTemporaryChannelId: final formerTemporaryChannelId, counterpartyNodeId: final counterpartyNodeId, - reason: final reason + fundingTxo: final fundingTxo ): sse_encode_i_32(5, serializer); sse_encode_box_autoadd_channel_id(channelId, serializer); sse_encode_box_autoadd_user_channel_id(userChannelId, serializer); - sse_encode_opt_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_opt_box_autoadd_closure_reason(reason, serializer); + sse_encode_box_autoadd_channel_id(formerTemporaryChannelId, serializer); + sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); + sse_encode_box_autoadd_out_point(fundingTxo, serializer); } } @@ -4339,89 +3373,15 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_lightning_balance( - LightningBalance self, SseSerializer serializer) { + void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - switch (self) { - case LightningBalance_ClaimableOnChannelClose( - channelId: final channelId, - counterpartyNodeId: final counterpartyNodeId, - amountSatoshis: final amountSatoshis - ): - sse_encode_i_32(0, serializer); - sse_encode_box_autoadd_channel_id(channelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_u_64(amountSatoshis, serializer); - case LightningBalance_ClaimableAwaitingConfirmations( - channelId: final channelId, - counterpartyNodeId: final counterpartyNodeId, - amountSatoshis: final amountSatoshis, - confirmationHeight: final confirmationHeight - ): - sse_encode_i_32(1, serializer); - sse_encode_box_autoadd_channel_id(channelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_u_64(amountSatoshis, serializer); - sse_encode_u_32(confirmationHeight, serializer); - case LightningBalance_ContentiousClaimable( - channelId: final channelId, - counterpartyNodeId: final counterpartyNodeId, - amountSatoshis: final amountSatoshis, - timeoutHeight: final timeoutHeight, - paymentHash: final paymentHash, - paymentPreimage: final paymentPreimage - ): - sse_encode_i_32(2, serializer); - sse_encode_box_autoadd_channel_id(channelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_u_64(amountSatoshis, serializer); - sse_encode_u_32(timeoutHeight, serializer); - sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - sse_encode_box_autoadd_payment_preimage(paymentPreimage, serializer); - case LightningBalance_MaybeTimeoutClaimableHTLC( - channelId: final channelId, - counterpartyNodeId: final counterpartyNodeId, - amountSatoshis: final amountSatoshis, - claimableHeight: final claimableHeight, - paymentHash: final paymentHash - ): - sse_encode_i_32(3, serializer); - sse_encode_box_autoadd_channel_id(channelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_u_64(amountSatoshis, serializer); - sse_encode_u_32(claimableHeight, serializer); - sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - case LightningBalance_MaybePreimageClaimableHTLC( - channelId: final channelId, - counterpartyNodeId: final counterpartyNodeId, - amountSatoshis: final amountSatoshis, - expiryHeight: final expiryHeight, - paymentHash: final paymentHash - ): - sse_encode_i_32(4, serializer); - sse_encode_box_autoadd_channel_id(channelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_u_64(amountSatoshis, serializer); - sse_encode_u_32(expiryHeight, serializer); - sse_encode_box_autoadd_payment_hash(paymentHash, serializer); - case LightningBalance_CounterpartyRevokedOutputClaimable( - channelId: final channelId, - counterpartyNodeId: final counterpartyNodeId, - amountSatoshis: final amountSatoshis - ): - sse_encode_i_32(5, serializer); - sse_encode_box_autoadd_channel_id(channelId, serializer); - sse_encode_box_autoadd_public_key(counterpartyNodeId, serializer); - sse_encode_u_64(amountSatoshis, serializer); - } + sse_encode_String(self.seedPhrase, serializer); } @protected - void sse_encode_liquidity_source_config( - LiquiditySourceConfig self, SseSerializer serializer) { + void sse_encode_ldk_node(LdkNode self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_record_socket_address_public_key_opt_string( - self.lsps2Service, serializer); + sse_encode_RustOpaque_NodeSqliteStore(self.ptr, serializer); } @protected @@ -4434,16 +3394,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - void sse_encode_list_lightning_balance( - List self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_i_32(self.length, serializer); - for (final item in self) { - sse_encode_lightning_balance(item, serializer); - } - } - @protected void sse_encode_list_payment_details( List self, SseSerializer serializer) { @@ -4464,16 +3414,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - void sse_encode_list_pending_sweep_balance( - List self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_i_32(self.length, serializer); - for (final item in self) { - sse_encode_pending_sweep_balance(item, serializer); - } - } - @protected void sse_encode_list_prim_u_8_loose( List self, SseSerializer serializer) { @@ -4531,12 +3471,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - void sse_encode_mnemonic_base(MnemonicBase self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_String(self.seedPhrase, serializer); - } - @protected void sse_encode_network(Network self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4544,35 +3478,11 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } @protected - void sse_encode_node_base(NodeBase self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_RustOpaque_NodeSqliteStore(self.ptr, serializer); - } - - @protected - void sse_encode_node_base_error( - NodeBaseError self, SseSerializer serializer) { + void sse_encode_node_exception(NodeException self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.index, serializer); } - @protected - void sse_encode_node_status(NodeStatus self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_bool(self.isRunning, serializer); - sse_encode_bool(self.isListening, serializer); - sse_encode_best_block(self.currentBestBlock, serializer); - sse_encode_opt_box_autoadd_u_64(self.latestWalletSyncTimestamp, serializer); - sse_encode_opt_box_autoadd_u_64( - self.latestOnchainWalletSyncTimestamp, serializer); - sse_encode_opt_box_autoadd_u_64( - self.latestFeeRateCacheUpdateTimestamp, serializer); - sse_encode_opt_box_autoadd_u_64( - self.latestRgsSnapshotTimestamp, serializer); - sse_encode_opt_box_autoadd_u_64( - self.latestNodeAnnouncementBroadcastTimestamp, serializer); - } - @protected void sse_encode_opt_String(String? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4605,28 +3515,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - void sse_encode_opt_box_autoadd_channel_id( - ChannelId? self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - sse_encode_bool(self != null, serializer); - if (self != null) { - sse_encode_box_autoadd_channel_id(self, serializer); - } - } - - @protected - void sse_encode_opt_box_autoadd_closure_reason( - ClosureReason? self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - sse_encode_bool(self != null, serializer); - if (self != null) { - sse_encode_box_autoadd_closure_reason(self, serializer); - } - } - @protected void sse_encode_opt_box_autoadd_entropy_source_config( EntropySourceConfig? self, SseSerializer serializer) { @@ -4659,39 +3547,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - void sse_encode_opt_box_autoadd_liquidity_source_config( - LiquiditySourceConfig? self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - sse_encode_bool(self != null, serializer); - if (self != null) { - sse_encode_box_autoadd_liquidity_source_config(self, serializer); - } - } - - @protected - void sse_encode_opt_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure? self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - sse_encode_bool(self != null, serializer); - if (self != null) { - sse_encode_box_autoadd_max_dust_htlc_exposure(self, serializer); - } - } - - @protected - void sse_encode_opt_box_autoadd_out_point( - OutPoint? self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - sse_encode_bool(self != null, serializer); - if (self != null) { - sse_encode_box_autoadd_out_point(self, serializer); - } - } - @protected void sse_encode_opt_box_autoadd_payment_details( PaymentDetails? self, SseSerializer serializer) { @@ -4703,17 +3558,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - void sse_encode_opt_box_autoadd_payment_failure_reason( - PaymentFailureReason? self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - sse_encode_bool(self != null, serializer); - if (self != null) { - sse_encode_box_autoadd_payment_failure_reason(self, serializer); - } - } - @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer) { @@ -4747,16 +3591,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { } } - @protected - void sse_encode_opt_box_autoadd_u_16(int? self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - - sse_encode_bool(self != null, serializer); - if (self != null) { - sse_encode_box_autoadd_u_16(self, serializer); - } - } - @protected void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4814,13 +3648,6 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_i_32(self.index, serializer); } - @protected - void sse_encode_payment_failure_reason( - PaymentFailureReason self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_i_32(self.index, serializer); - } - @protected void sse_encode_payment_hash(PaymentHash self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -4854,58 +3681,10 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { sse_encode_bool(self.isConnected, serializer); } - @protected - void sse_encode_pending_sweep_balance( - PendingSweepBalance self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - switch (self) { - case PendingSweepBalance_PendingBroadcast( - channelId: final channelId, - amountSatoshis: final amountSatoshis - ): - sse_encode_i_32(0, serializer); - sse_encode_opt_box_autoadd_channel_id(channelId, serializer); - sse_encode_u_64(amountSatoshis, serializer); - case PendingSweepBalance_BroadcastAwaitingConfirmation( - channelId: final channelId, - latestBroadcastHeight: final latestBroadcastHeight, - latestSpendingTxid: final latestSpendingTxid, - amountSatoshis: final amountSatoshis - ): - sse_encode_i_32(1, serializer); - sse_encode_opt_box_autoadd_channel_id(channelId, serializer); - sse_encode_u_32(latestBroadcastHeight, serializer); - sse_encode_box_autoadd_txid(latestSpendingTxid, serializer); - sse_encode_u_64(amountSatoshis, serializer); - case PendingSweepBalance_AwaitingThresholdConfirmations( - channelId: final channelId, - latestSpendingTxid: final latestSpendingTxid, - confirmationHash: final confirmationHash, - confirmationHeight: final confirmationHeight, - amountSatoshis: final amountSatoshis - ): - sse_encode_i_32(2, serializer); - sse_encode_opt_box_autoadd_channel_id(channelId, serializer); - sse_encode_box_autoadd_txid(latestSpendingTxid, serializer); - sse_encode_String(confirmationHash, serializer); - sse_encode_u_32(confirmationHeight, serializer); - sse_encode_u_64(amountSatoshis, serializer); - } - } - @protected void sse_encode_public_key(PublicKey self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_String(self.hexCode, serializer); - } - - @protected - void sse_encode_record_socket_address_public_key_opt_string( - (SocketAddress, PublicKey, String?) self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_socket_address(self.$1, serializer); - sse_encode_public_key(self.$2, serializer); - sse_encode_opt_String(self.$3, serializer); + sse_encode_String(self.hex, serializer); } @protected @@ -5010,7 +3789,7 @@ class LdkCoreApiImpl extends LdkCoreApiImplPlatform implements LdkCoreApi { void sse_encode_user_channel_id( UserChannelId self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_list_prim_u_8_strict(self.data, serializer); + sse_encode_u_64(self.data, serializer); } @protected diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index 32bbc0e..f729196 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -33,12 +33,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Address dco_decode_address(dynamic raw); - @protected - BalanceDetails dco_decode_balance_details(dynamic raw); - - @protected - BestBlock dco_decode_best_block(dynamic raw); - @protected Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw); @@ -61,9 +55,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_box_autoadd_channel_id(dynamic raw); - @protected - ClosureReason dco_decode_box_autoadd_closure_reason(dynamic raw); - @protected Config dco_decode_box_autoadd_config(dynamic raw); @@ -77,18 +68,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); @protected - LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( - dynamic raw); - - @protected - MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( - dynamic raw); - - @protected - MnemonicBase dco_decode_box_autoadd_mnemonic_base(dynamic raw); + LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); @protected - NodeBase dco_decode_box_autoadd_node_base(dynamic raw); + LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); @@ -96,10 +79,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PaymentDetails dco_decode_box_autoadd_payment_details(dynamic raw); - @protected - PaymentFailureReason dco_decode_box_autoadd_payment_failure_reason( - dynamic raw); - @protected PaymentHash dco_decode_box_autoadd_payment_hash(dynamic raw); @@ -115,12 +94,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw); - @protected - Txid dco_decode_box_autoadd_txid(dynamic raw); - - @protected - int dco_decode_box_autoadd_u_16(dynamic raw); - @protected int dco_decode_box_autoadd_u_32(dynamic raw); @@ -131,7 +104,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); @protected - BuilderError dco_decode_builder_error(dynamic raw); + BuilderException dco_decode_builder_exception(dynamic raw); @protected ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); @@ -145,9 +118,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_channel_id(dynamic raw); - @protected - ClosureReason dco_decode_closure_reason(dynamic raw); - @protected Config dco_decode_config(dynamic raw); @@ -164,26 +134,20 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_i_32(dynamic raw); @protected - LightningBalance dco_decode_lightning_balance(dynamic raw); + LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); @protected - LiquiditySourceConfig dco_decode_liquidity_source_config(dynamic raw); + LdkNode dco_decode_ldk_node(dynamic raw); @protected List dco_decode_list_channel_details(dynamic raw); - @protected - List dco_decode_list_lightning_balance(dynamic raw); - @protected List dco_decode_list_payment_details(dynamic raw); @protected List dco_decode_list_peer_details(dynamic raw); - @protected - List dco_decode_list_pending_sweep_balance(dynamic raw); - @protected List dco_decode_list_prim_u_8_loose(dynamic raw); @@ -202,20 +166,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); - @protected - MnemonicBase dco_decode_mnemonic_base(dynamic raw); - @protected Network dco_decode_network(dynamic raw); @protected - NodeBase dco_decode_node_base(dynamic raw); - - @protected - NodeBaseError dco_decode_node_base_error(dynamic raw); - - @protected - NodeStatus dco_decode_node_status(dynamic raw); + NodeException dco_decode_node_exception(dynamic raw); @protected String? dco_decode_opt_String(dynamic raw); @@ -227,12 +182,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelConfig? dco_decode_opt_box_autoadd_channel_config(dynamic raw); - @protected - ChannelId? dco_decode_opt_box_autoadd_channel_id(dynamic raw); - - @protected - ClosureReason? dco_decode_opt_box_autoadd_closure_reason(dynamic raw); - @protected EntropySourceConfig? dco_decode_opt_box_autoadd_entropy_source_config( dynamic raw); @@ -244,24 +193,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig? dco_decode_opt_box_autoadd_gossip_source_config( dynamic raw); - @protected - LiquiditySourceConfig? dco_decode_opt_box_autoadd_liquidity_source_config( - dynamic raw); - - @protected - MaxDustHTLCExposure? dco_decode_opt_box_autoadd_max_dust_htlc_exposure( - dynamic raw); - - @protected - OutPoint? dco_decode_opt_box_autoadd_out_point(dynamic raw); - @protected PaymentDetails? dco_decode_opt_box_autoadd_payment_details(dynamic raw); - @protected - PaymentFailureReason? dco_decode_opt_box_autoadd_payment_failure_reason( - dynamic raw); - @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); @@ -271,9 +205,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PublicKey? dco_decode_opt_box_autoadd_public_key(dynamic raw); - @protected - int? dco_decode_opt_box_autoadd_u_16(dynamic raw); - @protected int? dco_decode_opt_box_autoadd_u_32(dynamic raw); @@ -292,9 +223,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PaymentDirection dco_decode_payment_direction(dynamic raw); - @protected - PaymentFailureReason dco_decode_payment_failure_reason(dynamic raw); - @protected PaymentHash dco_decode_payment_hash(dynamic raw); @@ -310,16 +238,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PeerDetails dco_decode_peer_details(dynamic raw); - @protected - PendingSweepBalance dco_decode_pending_sweep_balance(dynamic raw); - @protected PublicKey dco_decode_public_key(dynamic raw); - @protected - (SocketAddress, PublicKey, String?) - dco_decode_record_socket_address_public_key_opt_string(dynamic raw); - @protected SocketAddress dco_decode_socket_address(dynamic raw); @@ -372,12 +293,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Address sse_decode_address(SseDeserializer deserializer); - @protected - BalanceDetails sse_decode_balance_details(SseDeserializer deserializer); - - @protected - BestBlock sse_decode_best_block(SseDeserializer deserializer); - @protected Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); @@ -402,10 +317,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); - @protected - ClosureReason sse_decode_box_autoadd_closure_reason( - SseDeserializer deserializer); - @protected Config sse_decode_box_autoadd_config(SseDeserializer deserializer); @@ -421,19 +332,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( - SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - MnemonicBase sse_decode_box_autoadd_mnemonic_base( - SseDeserializer deserializer); + LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); @protected - NodeBase sse_decode_box_autoadd_node_base(SseDeserializer deserializer); + LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); @protected OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); @@ -442,10 +344,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { PaymentDetails sse_decode_box_autoadd_payment_details( SseDeserializer deserializer); - @protected - PaymentFailureReason sse_decode_box_autoadd_payment_failure_reason( - SseDeserializer deserializer); - @protected PaymentHash sse_decode_box_autoadd_payment_hash(SseDeserializer deserializer); @@ -464,12 +362,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { SocketAddress sse_decode_box_autoadd_socket_address( SseDeserializer deserializer); - @protected - Txid sse_decode_box_autoadd_txid(SseDeserializer deserializer); - - @protected - int sse_decode_box_autoadd_u_16(SseDeserializer deserializer); - @protected int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); @@ -481,7 +373,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - BuilderError sse_decode_builder_error(SseDeserializer deserializer); + BuilderException sse_decode_builder_exception(SseDeserializer deserializer); @protected ChainDataSourceConfig sse_decode_chain_data_source_config( @@ -496,9 +388,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId sse_decode_channel_id(SseDeserializer deserializer); - @protected - ClosureReason sse_decode_closure_reason(SseDeserializer deserializer); - @protected Config sse_decode_config(SseDeserializer deserializer); @@ -517,20 +406,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int sse_decode_i_32(SseDeserializer deserializer); @protected - LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer); + LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); @protected - LiquiditySourceConfig sse_decode_liquidity_source_config( - SseDeserializer deserializer); + LdkNode sse_decode_ldk_node(SseDeserializer deserializer); @protected List sse_decode_list_channel_details( SseDeserializer deserializer); - @protected - List sse_decode_list_lightning_balance( - SseDeserializer deserializer); - @protected List sse_decode_list_payment_details( SseDeserializer deserializer); @@ -538,10 +422,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected List sse_decode_list_peer_details(SseDeserializer deserializer); - @protected - List sse_decode_list_pending_sweep_balance( - SseDeserializer deserializer); - @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); @@ -562,20 +442,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer); - @protected - MnemonicBase sse_decode_mnemonic_base(SseDeserializer deserializer); - @protected Network sse_decode_network(SseDeserializer deserializer); @protected - NodeBase sse_decode_node_base(SseDeserializer deserializer); - - @protected - NodeBaseError sse_decode_node_base_error(SseDeserializer deserializer); - - @protected - NodeStatus sse_decode_node_status(SseDeserializer deserializer); + NodeException sse_decode_node_exception(SseDeserializer deserializer); @protected String? sse_decode_opt_String(SseDeserializer deserializer); @@ -588,14 +459,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { ChannelConfig? sse_decode_opt_box_autoadd_channel_config( SseDeserializer deserializer); - @protected - ChannelId? sse_decode_opt_box_autoadd_channel_id( - SseDeserializer deserializer); - - @protected - ClosureReason? sse_decode_opt_box_autoadd_closure_reason( - SseDeserializer deserializer); - @protected EntropySourceConfig? sse_decode_opt_box_autoadd_entropy_source_config( SseDeserializer deserializer); @@ -607,25 +470,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig? sse_decode_opt_box_autoadd_gossip_source_config( SseDeserializer deserializer); - @protected - LiquiditySourceConfig? sse_decode_opt_box_autoadd_liquidity_source_config( - SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure? sse_decode_opt_box_autoadd_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - OutPoint? sse_decode_opt_box_autoadd_out_point(SseDeserializer deserializer); - @protected PaymentDetails? sse_decode_opt_box_autoadd_payment_details( SseDeserializer deserializer); - @protected - PaymentFailureReason? sse_decode_opt_box_autoadd_payment_failure_reason( - SseDeserializer deserializer); - @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -638,9 +486,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { PublicKey? sse_decode_opt_box_autoadd_public_key( SseDeserializer deserializer); - @protected - int? sse_decode_opt_box_autoadd_u_16(SseDeserializer deserializer); - @protected int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); @@ -660,10 +505,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PaymentDirection sse_decode_payment_direction(SseDeserializer deserializer); - @protected - PaymentFailureReason sse_decode_payment_failure_reason( - SseDeserializer deserializer); - @protected PaymentHash sse_decode_payment_hash(SseDeserializer deserializer); @@ -679,18 +520,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PeerDetails sse_decode_peer_details(SseDeserializer deserializer); - @protected - PendingSweepBalance sse_decode_pending_sweep_balance( - SseDeserializer deserializer); - @protected PublicKey sse_decode_public_key(SseDeserializer deserializer); - @protected - (SocketAddress, PublicKey, String?) - sse_decode_record_socket_address_public_key_opt_string( - SseDeserializer deserializer); - @protected SocketAddress sse_decode_socket_address(SseDeserializer deserializer); @@ -784,15 +616,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } - @protected - ffi.Pointer cst_encode_box_autoadd_closure_reason( - ClosureReason raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_closure_reason(); - cst_api_fill_to_wire_closure_reason(raw, ptr.ref); - return ptr; - } - @protected ffi.Pointer cst_encode_box_autoadd_config(Config raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -828,39 +651,19 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer - cst_encode_box_autoadd_liquidity_source_config( - LiquiditySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_liquidity_source_config(); - cst_api_fill_to_wire_liquidity_source_config(raw, ptr.ref); - return ptr; - } - - @protected - ffi.Pointer - cst_encode_box_autoadd_max_dust_htlc_exposure(MaxDustHTLCExposure raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_max_dust_htlc_exposure(); - cst_api_fill_to_wire_max_dust_htlc_exposure(raw, ptr.ref); - return ptr; - } - - @protected - ffi.Pointer cst_encode_box_autoadd_mnemonic_base( - MnemonicBase raw) { + ffi.Pointer cst_encode_box_autoadd_ldk_mnemonic( + LdkMnemonic raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_mnemonic_base(); - cst_api_fill_to_wire_mnemonic_base(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_ldk_mnemonic(); + cst_api_fill_to_wire_ldk_mnemonic(raw, ptr.ref); return ptr; } @protected - ffi.Pointer cst_encode_box_autoadd_node_base( - NodeBase raw) { + ffi.Pointer cst_encode_box_autoadd_ldk_node(LdkNode raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_node_base(); - cst_api_fill_to_wire_node_base(raw, ptr.ref); + final ptr = wire.cst_new_box_autoadd_ldk_node(); + cst_api_fill_to_wire_ldk_node(raw, ptr.ref); return ptr; } @@ -882,14 +685,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } - @protected - ffi.Pointer cst_encode_box_autoadd_payment_failure_reason( - PaymentFailureReason raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return wire.cst_new_box_autoadd_payment_failure_reason( - cst_encode_payment_failure_reason(raw)); - } - @protected ffi.Pointer cst_encode_box_autoadd_payment_hash( PaymentHash raw) { @@ -935,20 +730,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ptr; } - @protected - ffi.Pointer cst_encode_box_autoadd_txid(Txid raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - final ptr = wire.cst_new_box_autoadd_txid(); - cst_api_fill_to_wire_txid(raw, ptr.ref); - return ptr; - } - - @protected - ffi.Pointer cst_encode_box_autoadd_u_16(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return wire.cst_new_box_autoadd_u_16(cst_encode_u_16(raw)); - } - @protected ffi.Pointer cst_encode_box_autoadd_u_32(int raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -981,17 +762,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ans; } - @protected - ffi.Pointer - cst_encode_list_lightning_balance(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - final ans = wire.cst_new_list_lightning_balance(raw.length); - for (var i = 0; i < raw.length; ++i) { - cst_api_fill_to_wire_lightning_balance(raw[i], ans.ref.ptr[i]); - } - return ans; - } - @protected ffi.Pointer cst_encode_list_payment_details( List raw) { @@ -1014,17 +784,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return ans; } - @protected - ffi.Pointer - cst_encode_list_pending_sweep_balance(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - final ans = wire.cst_new_list_pending_sweep_balance(raw.length); - for (var i = 0; i < raw.length; ++i) { - cst_api_fill_to_wire_pending_sweep_balance(raw[i], ans.ref.ptr[i]); - } - return ans; - } - @protected ffi.Pointer cst_encode_list_prim_u_8_loose( List raw) { @@ -1091,22 +850,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { : cst_encode_box_autoadd_channel_config(raw); } - @protected - ffi.Pointer cst_encode_opt_box_autoadd_channel_id( - ChannelId? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? ffi.nullptr : cst_encode_box_autoadd_channel_id(raw); - } - - @protected - ffi.Pointer - cst_encode_opt_box_autoadd_closure_reason(ClosureReason? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? ffi.nullptr - : cst_encode_box_autoadd_closure_reason(raw); - } - @protected ffi.Pointer cst_encode_opt_box_autoadd_entropy_source_config( @@ -1132,33 +875,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { : cst_encode_box_autoadd_gossip_source_config(raw); } - @protected - ffi.Pointer - cst_encode_opt_box_autoadd_liquidity_source_config( - LiquiditySourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? ffi.nullptr - : cst_encode_box_autoadd_liquidity_source_config(raw); - } - - @protected - ffi.Pointer - cst_encode_opt_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? ffi.nullptr - : cst_encode_box_autoadd_max_dust_htlc_exposure(raw); - } - - @protected - ffi.Pointer cst_encode_opt_box_autoadd_out_point( - OutPoint? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? ffi.nullptr : cst_encode_box_autoadd_out_point(raw); - } - @protected ffi.Pointer cst_encode_opt_box_autoadd_payment_details(PaymentDetails? raw) { @@ -1168,15 +884,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { : cst_encode_box_autoadd_payment_details(raw); } - @protected - ffi.Pointer cst_encode_opt_box_autoadd_payment_failure_reason( - PaymentFailureReason? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? ffi.nullptr - : cst_encode_box_autoadd_payment_failure_reason(raw); - } - @protected ffi.Pointer cst_encode_opt_box_autoadd_payment_preimage(PaymentPreimage? raw) { @@ -1202,12 +909,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw == null ? ffi.nullptr : cst_encode_box_autoadd_public_key(raw); } - @protected - ffi.Pointer cst_encode_opt_box_autoadd_u_16(int? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_16(raw); - } - @protected ffi.Pointer cst_encode_opt_box_autoadd_u_32(int? raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1283,29 +984,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.s = cst_encode_String(apiObj.s); } - @protected - void cst_api_fill_to_wire_balance_details( - BalanceDetails apiObj, wire_cst_balance_details wireObj) { - wireObj.total_onchain_balance_sats = - cst_encode_u_64(apiObj.totalOnchainBalanceSats); - wireObj.spendable_onchain_balance_sats = - cst_encode_u_64(apiObj.spendableOnchainBalanceSats); - wireObj.total_lightning_balance_sats = - cst_encode_u_64(apiObj.totalLightningBalanceSats); - wireObj.lightning_balances = - cst_encode_list_lightning_balance(apiObj.lightningBalances); - wireObj.pending_balances_from_channel_closures = - cst_encode_list_pending_sweep_balance( - apiObj.pendingBalancesFromChannelClosures); - } - - @protected - void cst_api_fill_to_wire_best_block( - BestBlock apiObj, wire_cst_best_block wireObj) { - wireObj.block_hash = cst_encode_String(apiObj.blockHash); - wireObj.height = cst_encode_u_32(apiObj.height); - } - @protected void cst_api_fill_to_wire_bolt_11_invoice( Bolt11Invoice apiObj, wire_cst_bolt_11_invoice wireObj) { @@ -1343,12 +1021,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_channel_id(apiObj, wireObj.ref); } - @protected - void cst_api_fill_to_wire_box_autoadd_closure_reason( - ClosureReason apiObj, ffi.Pointer wireObj) { - cst_api_fill_to_wire_closure_reason(apiObj, wireObj.ref); - } - @protected void cst_api_fill_to_wire_box_autoadd_config( Config apiObj, ffi.Pointer wireObj) { @@ -1376,29 +1048,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_box_autoadd_liquidity_source_config( - LiquiditySourceConfig apiObj, - ffi.Pointer wireObj) { - cst_api_fill_to_wire_liquidity_source_config(apiObj, wireObj.ref); - } - - @protected - void cst_api_fill_to_wire_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure apiObj, - ffi.Pointer wireObj) { - cst_api_fill_to_wire_max_dust_htlc_exposure(apiObj, wireObj.ref); - } - - @protected - void cst_api_fill_to_wire_box_autoadd_mnemonic_base( - MnemonicBase apiObj, ffi.Pointer wireObj) { - cst_api_fill_to_wire_mnemonic_base(apiObj, wireObj.ref); + void cst_api_fill_to_wire_box_autoadd_ldk_mnemonic( + LdkMnemonic apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_mnemonic(apiObj, wireObj.ref); } @protected - void cst_api_fill_to_wire_box_autoadd_node_base( - NodeBase apiObj, ffi.Pointer wireObj) { - cst_api_fill_to_wire_node_base(apiObj, wireObj.ref); + void cst_api_fill_to_wire_box_autoadd_ldk_node( + LdkNode apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_ldk_node(apiObj, wireObj.ref); } @protected @@ -1443,12 +1101,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_socket_address(apiObj, wireObj.ref); } - @protected - void cst_api_fill_to_wire_box_autoadd_txid( - Txid apiObj, ffi.Pointer wireObj) { - cst_api_fill_to_wire_txid(apiObj, wireObj.ref); - } - @protected void cst_api_fill_to_wire_box_autoadd_user_channel_id( UserChannelId apiObj, ffi.Pointer wireObj) { @@ -1474,9 +1126,8 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.forwarding_fee_base_msat = cst_encode_u_32(apiObj.forwardingFeeBaseMsat); wireObj.cltv_expiry_delta = cst_encode_u_16(apiObj.cltvExpiryDelta); - wireObj.max_dust_htlc_exposure = - cst_encode_opt_box_autoadd_max_dust_htlc_exposure( - apiObj.maxDustHtlcExposure); + cst_api_fill_to_wire_max_dust_htlc_exposure( + apiObj.maxDustHtlcExposure, wireObj.max_dust_htlc_exposure); wireObj.force_close_avoidance_max_fee_satoshis = cst_encode_u_64(apiObj.forceCloseAvoidanceMaxFeeSatoshis); wireObj.accept_underpaying_htlcs = @@ -1489,8 +1140,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_channel_id(apiObj.channelId, wireObj.channel_id); cst_api_fill_to_wire_public_key( apiObj.counterpartyNodeId, wireObj.counterparty_node_id); - wireObj.funding_txo = - cst_encode_opt_box_autoadd_out_point(apiObj.fundingTxo); + wireObj.funding_txo = cst_encode_opt_String(apiObj.fundingTxo); wireObj.channel_value_sats = cst_encode_u_64(apiObj.channelValueSats); wireObj.unspendable_punishment_reserve = cst_encode_opt_box_autoadd_u_64(apiObj.unspendablePunishmentReserve); @@ -1498,6 +1148,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { apiObj.userChannelId, wireObj.user_channel_id); wireObj.feerate_sat_per_1000_weight = cst_encode_u_32(apiObj.feerateSatPer1000Weight); + wireObj.balance_msat = cst_encode_u_64(apiObj.balanceMsat); wireObj.outbound_capacity_msat = cst_encode_u_64(apiObj.outboundCapacityMsat); wireObj.inbound_capacity_msat = cst_encode_u_64(apiObj.inboundCapacityMsat); @@ -1509,36 +1160,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.is_channel_ready = cst_encode_bool(apiObj.isChannelReady); wireObj.is_usable = cst_encode_bool(apiObj.isUsable); wireObj.is_public = cst_encode_bool(apiObj.isPublic); - wireObj.cltv_expiry_delta = - cst_encode_opt_box_autoadd_u_16(apiObj.cltvExpiryDelta); - wireObj.counterparty_unspendable_punishment_reserve = - cst_encode_u_64(apiObj.counterpartyUnspendablePunishmentReserve); - wireObj.counterparty_outbound_htlc_minimum_msat = - cst_encode_opt_box_autoadd_u_64( - apiObj.counterpartyOutboundHtlcMinimumMsat); - wireObj.counterparty_outbound_htlc_maximum_msat = - cst_encode_opt_box_autoadd_u_64( - apiObj.counterpartyOutboundHtlcMaximumMsat); - wireObj.counterparty_forwarding_info_fee_base_msat = - cst_encode_opt_box_autoadd_u_32( - apiObj.counterpartyForwardingInfoFeeBaseMsat); - wireObj.counterparty_forwarding_info_fee_proportional_millionths = - cst_encode_opt_box_autoadd_u_32( - apiObj.counterpartyForwardingInfoFeeProportionalMillionths); - wireObj.counterparty_forwarding_info_cltv_expiry_delta = - cst_encode_opt_box_autoadd_u_16( - apiObj.counterpartyForwardingInfoCltvExpiryDelta); - wireObj.next_outbound_htlc_limit_msat = - cst_encode_u_64(apiObj.nextOutboundHtlcLimitMsat); - wireObj.next_outbound_htlc_minimum_msat = - cst_encode_u_64(apiObj.nextOutboundHtlcMinimumMsat); - wireObj.force_close_spend_delay = - cst_encode_opt_box_autoadd_u_16(apiObj.forceCloseSpendDelay); - wireObj.inbound_htlc_minimum_msat = - cst_encode_u_64(apiObj.inboundHtlcMinimumMsat); - wireObj.inbound_htlc_maximum_msat = - cst_encode_opt_box_autoadd_u_64(apiObj.inboundHtlcMaximumMsat); - cst_api_fill_to_wire_channel_config(apiObj.config, wireObj.config); } @protected @@ -1547,55 +1168,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.data = cst_encode_u_8_array_32(apiObj.data); } - @protected - void cst_api_fill_to_wire_closure_reason( - ClosureReason apiObj, wire_cst_closure_reason wireObj) { - if (apiObj is ClosureReason_CounterpartyForceClosed) { - var pre_peer_msg = cst_encode_String(apiObj.peerMsg); - wireObj.tag = 0; - wireObj.kind.CounterpartyForceClosed.peer_msg = pre_peer_msg; - return; - } - if (apiObj is ClosureReason_HolderForceClosed) { - wireObj.tag = 1; - return; - } - if (apiObj is ClosureReason_CooperativeClosure) { - wireObj.tag = 2; - return; - } - if (apiObj is ClosureReason_CommitmentTxConfirmed) { - wireObj.tag = 3; - return; - } - if (apiObj is ClosureReason_FundingTimedOut) { - wireObj.tag = 4; - return; - } - if (apiObj is ClosureReason_ProcessingError) { - var pre_err = cst_encode_String(apiObj.err); - wireObj.tag = 5; - wireObj.kind.ProcessingError.err = pre_err; - return; - } - if (apiObj is ClosureReason_DisconnectedPeer) { - wireObj.tag = 6; - return; - } - if (apiObj is ClosureReason_OutdatedChannelManager) { - wireObj.tag = 7; - return; - } - if (apiObj is ClosureReason_CounterpartyCoopClosedUnfundedChannel) { - wireObj.tag = 8; - return; - } - if (apiObj is ClosureReason_FundingBatchClosure) { - wireObj.tag = 9; - return; - } - } - @protected void cst_api_fill_to_wire_config(Config apiObj, wire_cst_config wireObj) { wireObj.storage_dir_path = cst_encode_String(apiObj.storageDirPath); @@ -1634,7 +1206,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return; } if (apiObj is EntropySourceConfig_Bip39Mnemonic) { - var pre_mnemonic = cst_encode_box_autoadd_mnemonic_base(apiObj.mnemonic); + var pre_mnemonic = cst_encode_box_autoadd_ldk_mnemonic(apiObj.mnemonic); var pre_passphrase = cst_encode_opt_String(apiObj.passphrase); wireObj.tag = 2; wireObj.kind.Bip39Mnemonic.mnemonic = pre_mnemonic; @@ -1648,21 +1220,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { if (apiObj is Event_PaymentSuccessful) { var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); - var pre_fee_paid_msat = - cst_encode_opt_box_autoadd_u_64(apiObj.feePaidMsat); wireObj.tag = 0; wireObj.kind.PaymentSuccessful.payment_hash = pre_payment_hash; - wireObj.kind.PaymentSuccessful.fee_paid_msat = pre_fee_paid_msat; return; } if (apiObj is Event_PaymentFailed) { var pre_payment_hash = cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); - var pre_reason = - cst_encode_opt_box_autoadd_payment_failure_reason(apiObj.reason); wireObj.tag = 1; wireObj.kind.PaymentFailed.payment_hash = pre_payment_hash; - wireObj.kind.PaymentFailed.reason = pre_reason; return; } if (apiObj is Event_PaymentReceived) { @@ -1674,50 +1240,48 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.kind.PaymentReceived.amount_msat = pre_amount_msat; return; } - if (apiObj is Event_ChannelPending) { + if (apiObj is Event_ChannelReady) { var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); var pre_user_channel_id = cst_encode_box_autoadd_user_channel_id(apiObj.userChannelId); - var pre_former_temporary_channel_id = - cst_encode_box_autoadd_channel_id(apiObj.formerTemporaryChannelId); var pre_counterparty_node_id = - cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_funding_txo = cst_encode_box_autoadd_out_point(apiObj.fundingTxo); + cst_encode_opt_box_autoadd_public_key(apiObj.counterpartyNodeId); wireObj.tag = 3; - wireObj.kind.ChannelPending.channel_id = pre_channel_id; - wireObj.kind.ChannelPending.user_channel_id = pre_user_channel_id; - wireObj.kind.ChannelPending.former_temporary_channel_id = - pre_former_temporary_channel_id; - wireObj.kind.ChannelPending.counterparty_node_id = - pre_counterparty_node_id; - wireObj.kind.ChannelPending.funding_txo = pre_funding_txo; + wireObj.kind.ChannelReady.channel_id = pre_channel_id; + wireObj.kind.ChannelReady.user_channel_id = pre_user_channel_id; + wireObj.kind.ChannelReady.counterparty_node_id = pre_counterparty_node_id; return; } - if (apiObj is Event_ChannelReady) { + if (apiObj is Event_ChannelClosed) { var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); var pre_user_channel_id = cst_encode_box_autoadd_user_channel_id(apiObj.userChannelId); var pre_counterparty_node_id = cst_encode_opt_box_autoadd_public_key(apiObj.counterpartyNodeId); wireObj.tag = 4; - wireObj.kind.ChannelReady.channel_id = pre_channel_id; - wireObj.kind.ChannelReady.user_channel_id = pre_user_channel_id; - wireObj.kind.ChannelReady.counterparty_node_id = pre_counterparty_node_id; + wireObj.kind.ChannelClosed.channel_id = pre_channel_id; + wireObj.kind.ChannelClosed.user_channel_id = pre_user_channel_id; + wireObj.kind.ChannelClosed.counterparty_node_id = + pre_counterparty_node_id; return; } - if (apiObj is Event_ChannelClosed) { + if (apiObj is Event_ChannelPending) { var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); var pre_user_channel_id = cst_encode_box_autoadd_user_channel_id(apiObj.userChannelId); + var pre_former_temporary_channel_id = + cst_encode_box_autoadd_channel_id(apiObj.formerTemporaryChannelId); var pre_counterparty_node_id = - cst_encode_opt_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_reason = cst_encode_opt_box_autoadd_closure_reason(apiObj.reason); + cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); + var pre_funding_txo = cst_encode_box_autoadd_out_point(apiObj.fundingTxo); wireObj.tag = 5; - wireObj.kind.ChannelClosed.channel_id = pre_channel_id; - wireObj.kind.ChannelClosed.user_channel_id = pre_user_channel_id; - wireObj.kind.ChannelClosed.counterparty_node_id = + wireObj.kind.ChannelPending.channel_id = pre_channel_id; + wireObj.kind.ChannelPending.user_channel_id = pre_user_channel_id; + wireObj.kind.ChannelPending.former_temporary_channel_id = + pre_former_temporary_channel_id; + wireObj.kind.ChannelPending.counterparty_node_id = pre_counterparty_node_id; - wireObj.kind.ChannelClosed.reason = pre_reason; + wireObj.kind.ChannelPending.funding_txo = pre_funding_txo; return; } } @@ -1738,115 +1302,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - void cst_api_fill_to_wire_lightning_balance( - LightningBalance apiObj, wire_cst_lightning_balance wireObj) { - if (apiObj is LightningBalance_ClaimableOnChannelClose) { - var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); - var pre_counterparty_node_id = - cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - wireObj.tag = 0; - wireObj.kind.ClaimableOnChannelClose.channel_id = pre_channel_id; - wireObj.kind.ClaimableOnChannelClose.counterparty_node_id = - pre_counterparty_node_id; - wireObj.kind.ClaimableOnChannelClose.amount_satoshis = - pre_amount_satoshis; - return; - } - if (apiObj is LightningBalance_ClaimableAwaitingConfirmations) { - var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); - var pre_counterparty_node_id = - cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - var pre_confirmation_height = cst_encode_u_32(apiObj.confirmationHeight); - wireObj.tag = 1; - wireObj.kind.ClaimableAwaitingConfirmations.channel_id = pre_channel_id; - wireObj.kind.ClaimableAwaitingConfirmations.counterparty_node_id = - pre_counterparty_node_id; - wireObj.kind.ClaimableAwaitingConfirmations.amount_satoshis = - pre_amount_satoshis; - wireObj.kind.ClaimableAwaitingConfirmations.confirmation_height = - pre_confirmation_height; - return; - } - if (apiObj is LightningBalance_ContentiousClaimable) { - var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); - var pre_counterparty_node_id = - cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - var pre_timeout_height = cst_encode_u_32(apiObj.timeoutHeight); - var pre_payment_hash = - cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); - var pre_payment_preimage = - cst_encode_box_autoadd_payment_preimage(apiObj.paymentPreimage); - wireObj.tag = 2; - wireObj.kind.ContentiousClaimable.channel_id = pre_channel_id; - wireObj.kind.ContentiousClaimable.counterparty_node_id = - pre_counterparty_node_id; - wireObj.kind.ContentiousClaimable.amount_satoshis = pre_amount_satoshis; - wireObj.kind.ContentiousClaimable.timeout_height = pre_timeout_height; - wireObj.kind.ContentiousClaimable.payment_hash = pre_payment_hash; - wireObj.kind.ContentiousClaimable.payment_preimage = pre_payment_preimage; - return; - } - if (apiObj is LightningBalance_MaybeTimeoutClaimableHTLC) { - var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); - var pre_counterparty_node_id = - cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - var pre_claimable_height = cst_encode_u_32(apiObj.claimableHeight); - var pre_payment_hash = - cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); - wireObj.tag = 3; - wireObj.kind.MaybeTimeoutClaimableHTLC.channel_id = pre_channel_id; - wireObj.kind.MaybeTimeoutClaimableHTLC.counterparty_node_id = - pre_counterparty_node_id; - wireObj.kind.MaybeTimeoutClaimableHTLC.amount_satoshis = - pre_amount_satoshis; - wireObj.kind.MaybeTimeoutClaimableHTLC.claimable_height = - pre_claimable_height; - wireObj.kind.MaybeTimeoutClaimableHTLC.payment_hash = pre_payment_hash; - return; - } - if (apiObj is LightningBalance_MaybePreimageClaimableHTLC) { - var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); - var pre_counterparty_node_id = - cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - var pre_expiry_height = cst_encode_u_32(apiObj.expiryHeight); - var pre_payment_hash = - cst_encode_box_autoadd_payment_hash(apiObj.paymentHash); - wireObj.tag = 4; - wireObj.kind.MaybePreimageClaimableHTLC.channel_id = pre_channel_id; - wireObj.kind.MaybePreimageClaimableHTLC.counterparty_node_id = - pre_counterparty_node_id; - wireObj.kind.MaybePreimageClaimableHTLC.amount_satoshis = - pre_amount_satoshis; - wireObj.kind.MaybePreimageClaimableHTLC.expiry_height = pre_expiry_height; - wireObj.kind.MaybePreimageClaimableHTLC.payment_hash = pre_payment_hash; - return; - } - if (apiObj is LightningBalance_CounterpartyRevokedOutputClaimable) { - var pre_channel_id = cst_encode_box_autoadd_channel_id(apiObj.channelId); - var pre_counterparty_node_id = - cst_encode_box_autoadd_public_key(apiObj.counterpartyNodeId); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - wireObj.tag = 5; - wireObj.kind.CounterpartyRevokedOutputClaimable.channel_id = - pre_channel_id; - wireObj.kind.CounterpartyRevokedOutputClaimable.counterparty_node_id = - pre_counterparty_node_id; - wireObj.kind.CounterpartyRevokedOutputClaimable.amount_satoshis = - pre_amount_satoshis; - return; - } + void cst_api_fill_to_wire_ldk_mnemonic( + LdkMnemonic apiObj, wire_cst_ldk_mnemonic wireObj) { + wireObj.seed_phrase = cst_encode_String(apiObj.seedPhrase); } @protected - void cst_api_fill_to_wire_liquidity_source_config( - LiquiditySourceConfig apiObj, wire_cst_liquidity_source_config wireObj) { - cst_api_fill_to_wire_record_socket_address_public_key_opt_string( - apiObj.lsps2Service, wireObj.lsps2_service); + void cst_api_fill_to_wire_ldk_node( + LdkNode apiObj, wire_cst_ldk_node wireObj) { + wireObj.ptr = cst_encode_RustOpaque_NodeSqliteStore(apiObj.ptr); } @protected @@ -1866,40 +1330,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } } - @protected - void cst_api_fill_to_wire_mnemonic_base( - MnemonicBase apiObj, wire_cst_mnemonic_base wireObj) { - wireObj.seed_phrase = cst_encode_String(apiObj.seedPhrase); - } - - @protected - void cst_api_fill_to_wire_node_base( - NodeBase apiObj, wire_cst_node_base wireObj) { - wireObj.ptr = cst_encode_RustOpaque_NodeSqliteStore(apiObj.ptr); - } - - @protected - void cst_api_fill_to_wire_node_status( - NodeStatus apiObj, wire_cst_node_status wireObj) { - wireObj.is_running = cst_encode_bool(apiObj.isRunning); - wireObj.is_listening = cst_encode_bool(apiObj.isListening); - cst_api_fill_to_wire_best_block( - apiObj.currentBestBlock, wireObj.current_best_block); - wireObj.latest_wallet_sync_timestamp = - cst_encode_opt_box_autoadd_u_64(apiObj.latestWalletSyncTimestamp); - wireObj.latest_onchain_wallet_sync_timestamp = - cst_encode_opt_box_autoadd_u_64( - apiObj.latestOnchainWalletSyncTimestamp); - wireObj.latest_fee_rate_cache_update_timestamp = - cst_encode_opt_box_autoadd_u_64( - apiObj.latestFeeRateCacheUpdateTimestamp); - wireObj.latest_rgs_snapshot_timestamp = - cst_encode_opt_box_autoadd_u_64(apiObj.latestRgsSnapshotTimestamp); - wireObj.latest_node_announcement_broadcast_timestamp = - cst_encode_opt_box_autoadd_u_64( - apiObj.latestNodeAnnouncementBroadcastTimestamp); - } - @protected void cst_api_fill_to_wire_out_point( OutPoint apiObj, wire_cst_out_point wireObj) { @@ -1945,71 +1375,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { wireObj.is_connected = cst_encode_bool(apiObj.isConnected); } - @protected - void cst_api_fill_to_wire_pending_sweep_balance( - PendingSweepBalance apiObj, wire_cst_pending_sweep_balance wireObj) { - if (apiObj is PendingSweepBalance_PendingBroadcast) { - var pre_channel_id = - cst_encode_opt_box_autoadd_channel_id(apiObj.channelId); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - wireObj.tag = 0; - wireObj.kind.PendingBroadcast.channel_id = pre_channel_id; - wireObj.kind.PendingBroadcast.amount_satoshis = pre_amount_satoshis; - return; - } - if (apiObj is PendingSweepBalance_BroadcastAwaitingConfirmation) { - var pre_channel_id = - cst_encode_opt_box_autoadd_channel_id(apiObj.channelId); - var pre_latest_broadcast_height = - cst_encode_u_32(apiObj.latestBroadcastHeight); - var pre_latest_spending_txid = - cst_encode_box_autoadd_txid(apiObj.latestSpendingTxid); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - wireObj.tag = 1; - wireObj.kind.BroadcastAwaitingConfirmation.channel_id = pre_channel_id; - wireObj.kind.BroadcastAwaitingConfirmation.latest_broadcast_height = - pre_latest_broadcast_height; - wireObj.kind.BroadcastAwaitingConfirmation.latest_spending_txid = - pre_latest_spending_txid; - wireObj.kind.BroadcastAwaitingConfirmation.amount_satoshis = - pre_amount_satoshis; - return; - } - if (apiObj is PendingSweepBalance_AwaitingThresholdConfirmations) { - var pre_channel_id = - cst_encode_opt_box_autoadd_channel_id(apiObj.channelId); - var pre_latest_spending_txid = - cst_encode_box_autoadd_txid(apiObj.latestSpendingTxid); - var pre_confirmation_hash = cst_encode_String(apiObj.confirmationHash); - var pre_confirmation_height = cst_encode_u_32(apiObj.confirmationHeight); - var pre_amount_satoshis = cst_encode_u_64(apiObj.amountSatoshis); - wireObj.tag = 2; - wireObj.kind.AwaitingThresholdConfirmations.channel_id = pre_channel_id; - wireObj.kind.AwaitingThresholdConfirmations.latest_spending_txid = - pre_latest_spending_txid; - wireObj.kind.AwaitingThresholdConfirmations.confirmation_hash = - pre_confirmation_hash; - wireObj.kind.AwaitingThresholdConfirmations.confirmation_height = - pre_confirmation_height; - wireObj.kind.AwaitingThresholdConfirmations.amount_satoshis = - pre_amount_satoshis; - return; - } - } - @protected void cst_api_fill_to_wire_public_key( PublicKey apiObj, wire_cst_public_key wireObj) { - wireObj.hex_code = cst_encode_String(apiObj.hexCode); - } - - @protected - void cst_api_fill_to_wire_record_socket_address_public_key_opt_string( - (SocketAddress, PublicKey, String?) apiObj, - wire_cst_record_socket_address_public_key_opt_string wireObj) { - cst_api_fill_to_wire_socket_address(apiObj.$1, wireObj.field0); - cst_api_fill_to_wire_public_key(apiObj.$2, wireObj.field1); - wireObj.field2 = cst_encode_opt_String(apiObj.$3); + wireObj.hex = cst_encode_String(apiObj.hex); } @protected @@ -2067,7 +1436,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void cst_api_fill_to_wire_user_channel_id( UserChannelId apiObj, wire_cst_user_channel_id wireObj) { - wireObj.data = cst_encode_list_prim_u_8_strict(apiObj.data); + wireObj.data = cst_encode_u_64(apiObj.data); } @protected @@ -2077,7 +1446,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { bool cst_encode_bool(bool raw); @protected - int cst_encode_builder_error(BuilderError raw); + int cst_encode_builder_exception(BuilderException raw); @protected int cst_encode_i_32(int raw); @@ -2089,14 +1458,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int cst_encode_network(Network raw); @protected - int cst_encode_node_base_error(NodeBaseError raw); + int cst_encode_node_exception(NodeException raw); @protected int cst_encode_payment_direction(PaymentDirection raw); - @protected - int cst_encode_payment_failure_reason(PaymentFailureReason raw); - @protected int cst_encode_payment_status(PaymentStatus raw); @@ -2125,13 +1491,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_address(Address self, SseSerializer serializer); - @protected - void sse_encode_balance_details( - BalanceDetails self, SseSerializer serializer); - - @protected - void sse_encode_best_block(BestBlock self, SseSerializer serializer); - @protected void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); @@ -2157,10 +1516,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_channel_id( ChannelId self, SseSerializer serializer); - @protected - void sse_encode_box_autoadd_closure_reason( - ClosureReason self, SseSerializer serializer); - @protected void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); @@ -2176,20 +1531,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_liquidity_source_config( - LiquiditySourceConfig self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_mnemonic( + LdkMnemonic self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_mnemonic_base( - MnemonicBase self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_node_base( - NodeBase self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); @protected void sse_encode_box_autoadd_out_point( @@ -2199,10 +1545,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_payment_details( PaymentDetails self, SseSerializer serializer); - @protected - void sse_encode_box_autoadd_payment_failure_reason( - PaymentFailureReason self, SseSerializer serializer); - @protected void sse_encode_box_autoadd_payment_hash( PaymentHash self, SseSerializer serializer); @@ -2223,12 +1565,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_socket_address( SocketAddress self, SseSerializer serializer); - @protected - void sse_encode_box_autoadd_txid(Txid self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_u_16(int self, SseSerializer serializer); - @protected void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); @@ -2240,7 +1576,8 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId self, SseSerializer serializer); @protected - void sse_encode_builder_error(BuilderError self, SseSerializer serializer); + void sse_encode_builder_exception( + BuilderException self, SseSerializer serializer); @protected void sse_encode_chain_data_source_config( @@ -2256,9 +1593,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_channel_id(ChannelId self, SseSerializer serializer); - @protected - void sse_encode_closure_reason(ClosureReason self, SseSerializer serializer); - @protected void sse_encode_config(Config self, SseSerializer serializer); @@ -2277,21 +1611,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_i_32(int self, SseSerializer serializer); @protected - void sse_encode_lightning_balance( - LightningBalance self, SseSerializer serializer); + void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); @protected - void sse_encode_liquidity_source_config( - LiquiditySourceConfig self, SseSerializer serializer); + void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); @protected void sse_encode_list_channel_details( List self, SseSerializer serializer); - @protected - void sse_encode_list_lightning_balance( - List self, SseSerializer serializer); - @protected void sse_encode_list_payment_details( List self, SseSerializer serializer); @@ -2300,10 +1628,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_list_peer_details( List self, SseSerializer serializer); - @protected - void sse_encode_list_pending_sweep_balance( - List self, SseSerializer serializer); - @protected void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); @@ -2326,20 +1650,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer); - @protected - void sse_encode_mnemonic_base(MnemonicBase self, SseSerializer serializer); - @protected void sse_encode_network(Network self, SseSerializer serializer); @protected - void sse_encode_node_base(NodeBase self, SseSerializer serializer); - - @protected - void sse_encode_node_base_error(NodeBaseError self, SseSerializer serializer); - - @protected - void sse_encode_node_status(NodeStatus self, SseSerializer serializer); + void sse_encode_node_exception(NodeException self, SseSerializer serializer); @protected void sse_encode_opt_String(String? self, SseSerializer serializer); @@ -2352,14 +1667,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_channel_config( ChannelConfig? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_channel_id( - ChannelId? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_closure_reason( - ClosureReason? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_entropy_source_config( EntropySourceConfig? self, SseSerializer serializer); @@ -2371,26 +1678,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_gossip_source_config( GossipSourceConfig? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_liquidity_source_config( - LiquiditySourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_out_point( - OutPoint? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_payment_details( PaymentDetails? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_payment_failure_reason( - PaymentFailureReason? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer); @@ -2403,9 +1694,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_public_key( PublicKey? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_u_16(int? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); @@ -2427,10 +1715,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_payment_direction( PaymentDirection self, SseSerializer serializer); - @protected - void sse_encode_payment_failure_reason( - PaymentFailureReason self, SseSerializer serializer); - @protected void sse_encode_payment_hash(PaymentHash self, SseSerializer serializer); @@ -2447,17 +1731,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_peer_details(PeerDetails self, SseSerializer serializer); - @protected - void sse_encode_pending_sweep_balance( - PendingSweepBalance self, SseSerializer serializer); - @protected void sse_encode_public_key(PublicKey self, SseSerializer serializer); - @protected - void sse_encode_record_socket_address_public_key_opt_string( - (SocketAddress, PublicKey, String?) self, SseSerializer serializer); - @protected void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); @@ -2542,75 +1818,92 @@ class LdkCoreWire implements BaseWire { late final _store_dart_post_cobject = _store_dart_post_cobjectPtr .asFunction(); - void wire_MnemonicBase_generate( + void wire_build_with_sqlite_store( + int port_, + ffi.Pointer config, + ffi.Pointer chain_data_source_config, + ffi.Pointer entropy_source_config, + ffi.Pointer gossip_source_config, + ) { + return _wire_build_with_sqlite_store( + port_, + config, + chain_data_source_config, + entropy_source_config, + gossip_source_config, + ); + } + + late final _wire_build_with_sqlite_storePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_ldk_node_wire_build_with_sqlite_store'); + late final _wire_build_with_sqlite_store = + _wire_build_with_sqlite_storePtr.asFunction< + void Function( + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + void wire_ldk_mnemonic_generate( int port_, ) { - return _wire_MnemonicBase_generate( + return _wire_ldk_mnemonic_generate( port_, ); } - late final _wire_MnemonicBase_generatePtr = + late final _wire_ldk_mnemonic_generatePtr = _lookup>( - 'frbgen_ldk_node_wire_MnemonicBase_generate'); - late final _wire_MnemonicBase_generate = - _wire_MnemonicBase_generatePtr.asFunction(); + 'frbgen_ldk_node_wire_ldk_mnemonic_generate'); + late final _wire_ldk_mnemonic_generate = + _wire_ldk_mnemonic_generatePtr.asFunction(); - void wire_NodeBase_close_channel( + void wire_ldk_node_close_channel( int port_, - ffi.Pointer that, - ffi.Pointer user_channel_id, + ffi.Pointer that, + ffi.Pointer channel_id, ffi.Pointer counterparty_node_id, ) { - return _wire_NodeBase_close_channel( + return _wire_ldk_node_close_channel( port_, that, - user_channel_id, + channel_id, counterparty_node_id, ); } - late final _wire_NodeBase_close_channelPtr = _lookup< + late final _wire_ldk_node_close_channelPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_close_channel'); - late final _wire_NodeBase_close_channel = - _wire_NodeBase_close_channelPtr.asFunction< + 'frbgen_ldk_node_wire_ldk_node_close_channel'); + late final _wire_ldk_node_close_channel = + _wire_ldk_node_close_channelPtr.asFunction< void Function( int, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_config( - int port_, - ffi.Pointer that, - ) { - return _wire_NodeBase_config( - port_, - that, - ); - } - - late final _wire_NodeBase_configPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_config'); - late final _wire_NodeBase_config = _wire_NodeBase_configPtr - .asFunction)>(); - - void wire_NodeBase_connect( + void wire_ldk_node_connect( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer node_id, ffi.Pointer address, bool persist, ) { - return _wire_NodeBase_connect( + return _wire_ldk_node_connect( port_, that, node_id, @@ -2619,36 +1912,36 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_connectPtr = _lookup< + late final _wire_ldk_node_connectPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Bool)>>('frbgen_ldk_node_wire_NodeBase_connect'); - late final _wire_NodeBase_connect = _wire_NodeBase_connectPtr.asFunction< + ffi.Bool)>>('frbgen_ldk_node_wire_ldk_node_connect'); + late final _wire_ldk_node_connect = _wire_ldk_node_connectPtr.asFunction< void Function( int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, bool)>(); - void wire_NodeBase_connect_open_channel( + void wire_ldk_node_connect_open_channel( int port_, - ffi.Pointer that, - ffi.Pointer address, + ffi.Pointer that, + ffi.Pointer socket_address, ffi.Pointer node_id, int channel_amount_sats, ffi.Pointer push_to_counterparty_msat, bool announce_channel, ffi.Pointer channel_config, ) { - return _wire_NodeBase_connect_open_channel( + return _wire_ldk_node_connect_open_channel( port_, that, - address, + socket_address, node_id, channel_amount_sats, push_to_counterparty_msat, @@ -2657,23 +1950,23 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_connect_open_channelPtr = _lookup< + late final _wire_ldk_node_connect_open_channelPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Uint64, ffi.Pointer, ffi.Bool, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_connect_open_channel'); - late final _wire_NodeBase_connect_open_channel = - _wire_NodeBase_connect_open_channelPtr.asFunction< + 'frbgen_ldk_node_wire_ldk_node_connect_open_channel'); + late final _wire_ldk_node_connect_open_channel = + _wire_ldk_node_connect_open_channelPtr.asFunction< void Function( int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, int, @@ -2681,251 +1974,233 @@ class LdkCoreWire implements BaseWire { bool, ffi.Pointer)>(); - void wire_NodeBase_disconnect( + void wire_ldk_node_disconnect( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer counterparty_node_id, ) { - return _wire_NodeBase_disconnect( + return _wire_ldk_node_disconnect( port_, that, counterparty_node_id, ); } - late final _wire_NodeBase_disconnectPtr = _lookup< + late final _wire_ldk_node_disconnectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_disconnect'); - late final _wire_NodeBase_disconnect = - _wire_NodeBase_disconnectPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_disconnect'); + late final _wire_ldk_node_disconnect = + _wire_ldk_node_disconnectPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_event_handled( + void wire_ldk_node_event_handled( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_event_handled( + return _wire_ldk_node_event_handled( port_, that, ); } - late final _wire_NodeBase_event_handledPtr = _lookup< + late final _wire_ldk_node_event_handledPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_event_handled'); - late final _wire_NodeBase_event_handled = _wire_NodeBase_event_handledPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_event_handled'); + late final _wire_ldk_node_event_handled = _wire_ldk_node_event_handledPtr + .asFunction)>(); - void wire_NodeBase_list_balances( + void wire_ldk_node_is_running( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_list_balances( + return _wire_ldk_node_is_running( port_, that, ); } - late final _wire_NodeBase_list_balancesPtr = _lookup< + late final _wire_ldk_node_is_runningPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_list_balances'); - late final _wire_NodeBase_list_balances = _wire_NodeBase_list_balancesPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_is_running'); + late final _wire_ldk_node_is_running = _wire_ldk_node_is_runningPtr + .asFunction)>(); - void wire_NodeBase_list_channels( + void wire_ldk_node_list_channels( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_list_channels( + return _wire_ldk_node_list_channels( port_, that, ); } - late final _wire_NodeBase_list_channelsPtr = _lookup< + late final _wire_ldk_node_list_channelsPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_list_channels'); - late final _wire_NodeBase_list_channels = _wire_NodeBase_list_channelsPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_list_channels'); + late final _wire_ldk_node_list_channels = _wire_ldk_node_list_channelsPtr + .asFunction)>(); - void wire_NodeBase_list_payments( + void wire_ldk_node_list_payments( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_list_payments( + return _wire_ldk_node_list_payments( port_, that, ); } - late final _wire_NodeBase_list_paymentsPtr = _lookup< + late final _wire_ldk_node_list_paymentsPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_list_payments'); - late final _wire_NodeBase_list_payments = _wire_NodeBase_list_paymentsPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_list_payments'); + late final _wire_ldk_node_list_payments = _wire_ldk_node_list_paymentsPtr + .asFunction)>(); - void wire_NodeBase_list_payments_with_filter( + void wire_ldk_node_list_payments_with_filter( int port_, - ffi.Pointer that, + ffi.Pointer that, int payment_direction, ) { - return _wire_NodeBase_list_payments_with_filter( + return _wire_ldk_node_list_payments_with_filter( port_, that, payment_direction, ); } - late final _wire_NodeBase_list_payments_with_filterPtr = _lookup< + late final _wire_ldk_node_list_payments_with_filterPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int64, ffi.Pointer, ffi.Int32)>>( - 'frbgen_ldk_node_wire_NodeBase_list_payments_with_filter'); - late final _wire_NodeBase_list_payments_with_filter = - _wire_NodeBase_list_payments_with_filterPtr.asFunction< - void Function(int, ffi.Pointer, int)>(); - - void wire_NodeBase_list_peers( - int port_, - ffi.Pointer that, - ) { - return _wire_NodeBase_list_peers( - port_, - that, - ); - } + ffi.Int64, ffi.Pointer, ffi.Int32)>>( + 'frbgen_ldk_node_wire_ldk_node_list_payments_with_filter'); + late final _wire_ldk_node_list_payments_with_filter = + _wire_ldk_node_list_payments_with_filterPtr.asFunction< + void Function(int, ffi.Pointer, int)>(); - late final _wire_NodeBase_list_peersPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_list_peers'); - late final _wire_NodeBase_list_peers = _wire_NodeBase_list_peersPtr - .asFunction)>(); - - void wire_NodeBase_listening_addresses( + void wire_ldk_node_list_peers( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_listening_addresses( + return _wire_ldk_node_list_peers( port_, that, ); } - late final _wire_NodeBase_listening_addressesPtr = _lookup< + late final _wire_ldk_node_list_peersPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_listening_addresses'); - late final _wire_NodeBase_listening_addresses = - _wire_NodeBase_listening_addressesPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_list_peers'); + late final _wire_ldk_node_list_peers = _wire_ldk_node_list_peersPtr + .asFunction)>(); - void wire_NodeBase_new_onchain_address( + void wire_ldk_node_listening_addresses( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_new_onchain_address( + return _wire_ldk_node_listening_addresses( port_, that, ); } - late final _wire_NodeBase_new_onchain_addressPtr = _lookup< + late final _wire_ldk_node_listening_addressesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_new_onchain_address'); - late final _wire_NodeBase_new_onchain_address = - _wire_NodeBase_new_onchain_addressPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_listening_addresses'); + late final _wire_ldk_node_listening_addresses = + _wire_ldk_node_listening_addressesPtr + .asFunction)>(); - void wire_NodeBase_next_event( + void wire_ldk_node_new_onchain_address( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_next_event( + return _wire_ldk_node_new_onchain_address( port_, that, ); } - late final _wire_NodeBase_next_eventPtr = _lookup< + late final _wire_ldk_node_new_onchain_addressPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_next_event'); - late final _wire_NodeBase_next_event = _wire_NodeBase_next_eventPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_new_onchain_address'); + late final _wire_ldk_node_new_onchain_address = + _wire_ldk_node_new_onchain_addressPtr + .asFunction)>(); - void wire_NodeBase_next_event_async( + void wire_ldk_node_next_event( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_next_event_async( + return _wire_ldk_node_next_event( port_, that, ); } - late final _wire_NodeBase_next_event_asyncPtr = _lookup< + late final _wire_ldk_node_next_eventPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_next_event_async'); - late final _wire_NodeBase_next_event_async = - _wire_NodeBase_next_event_asyncPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_next_event'); + late final _wire_ldk_node_next_event = _wire_ldk_node_next_eventPtr + .asFunction)>(); - void wire_NodeBase_node_id( + void wire_ldk_node_node_id( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_node_id( + return _wire_ldk_node_node_id( port_, that, ); } - late final _wire_NodeBase_node_idPtr = _lookup< + late final _wire_ldk_node_node_idPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_node_id'); - late final _wire_NodeBase_node_id = _wire_NodeBase_node_idPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_node_id'); + late final _wire_ldk_node_node_id = _wire_ldk_node_node_idPtr + .asFunction)>(); - void wire_NodeBase_payment( + void wire_ldk_node_payment( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer payment_hash, ) { - return _wire_NodeBase_payment( + return _wire_ldk_node_payment( port_, that, payment_hash, ); } - late final _wire_NodeBase_paymentPtr = _lookup< + late final _wire_ldk_node_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_payment'); - late final _wire_NodeBase_payment = _wire_NodeBase_paymentPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_payment'); + late final _wire_ldk_node_payment = _wire_ldk_node_paymentPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_receive_payment( + void wire_ldk_node_receive_payment( int port_, - ffi.Pointer that, + ffi.Pointer that, int amount_msat, ffi.Pointer description, int expiry_secs, ) { - return _wire_NodeBase_receive_payment( + return _wire_ldk_node_receive_payment( port_, that, amount_msat, @@ -2934,64 +2209,26 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_receive_paymentPtr = _lookup< + late final _wire_ldk_node_receive_paymentPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, + ffi.Pointer, ffi.Uint64, ffi.Pointer, - ffi.Uint32)>>('frbgen_ldk_node_wire_NodeBase_receive_payment'); - late final _wire_NodeBase_receive_payment = - _wire_NodeBase_receive_paymentPtr.asFunction< - void Function(int, ffi.Pointer, int, + ffi.Uint32)>>('frbgen_ldk_node_wire_ldk_node_receive_payment'); + late final _wire_ldk_node_receive_payment = + _wire_ldk_node_receive_paymentPtr.asFunction< + void Function(int, ffi.Pointer, int, ffi.Pointer, int)>(); - void wire_NodeBase_receive_payment_via_jit_channel( - int port_, - ffi.Pointer that, - int amount_msat, - ffi.Pointer description, - int expiry_secs, - ffi.Pointer max_total_lsp_fee_limit_msat, - ) { - return _wire_NodeBase_receive_payment_via_jit_channel( - port_, - that, - amount_msat, - description, - expiry_secs, - max_total_lsp_fee_limit_msat, - ); - } - - late final _wire_NodeBase_receive_payment_via_jit_channelPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Uint64, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_receive_payment_via_jit_channel'); - late final _wire_NodeBase_receive_payment_via_jit_channel = - _wire_NodeBase_receive_payment_via_jit_channelPtr.asFunction< - void Function( - int, - ffi.Pointer, - int, - ffi.Pointer, - int, - ffi.Pointer)>(); - - void wire_NodeBase_receive_variable_amount_payment( + void wire_ldk_node_receive_variable_amount_payment( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer description, int expiry_secs, ) { - return _wire_NodeBase_receive_variable_amount_payment( + return _wire_ldk_node_receive_variable_amount_payment( port_, that, description, @@ -2999,147 +2236,111 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_receive_variable_amount_paymentPtr = _lookup< + late final _wire_ldk_node_receive_variable_amount_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer, ffi.Uint32)>>( - 'frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment'); - late final _wire_NodeBase_receive_variable_amount_payment = - _wire_NodeBase_receive_variable_amount_paymentPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_receive_variable_amount_payment'); + late final _wire_ldk_node_receive_variable_amount_payment = + _wire_ldk_node_receive_variable_amount_paymentPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer, int)>(); - void wire_NodeBase_receive_variable_amount_payment_via_jit_channel( - int port_, - ffi.Pointer that, - ffi.Pointer description, - int expiry_secs, - ffi.Pointer max_proportional_lsp_fee_limit_ppm_msat, - ) { - return _wire_NodeBase_receive_variable_amount_payment_via_jit_channel( - port_, - that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat, - ); - } - - late final _wire_NodeBase_receive_variable_amount_payment_via_jit_channelPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment_via_jit_channel'); - late final _wire_NodeBase_receive_variable_amount_payment_via_jit_channel = - _wire_NodeBase_receive_variable_amount_payment_via_jit_channelPtr - .asFunction< - void Function( - int, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - void wire_NodeBase_remove_payment( + void wire_ldk_node_remove_payment( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer payment_hash, ) { - return _wire_NodeBase_remove_payment( + return _wire_ldk_node_remove_payment( port_, that, payment_hash, ); } - late final _wire_NodeBase_remove_paymentPtr = _lookup< + late final _wire_ldk_node_remove_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_remove_payment'); - late final _wire_NodeBase_remove_payment = - _wire_NodeBase_remove_paymentPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_remove_payment'); + late final _wire_ldk_node_remove_payment = + _wire_ldk_node_remove_paymentPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_send_all_to_onchain_address( + void wire_ldk_node_send_all_to_onchain_address( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer address, ) { - return _wire_NodeBase_send_all_to_onchain_address( + return _wire_ldk_node_send_all_to_onchain_address( port_, that, address, ); } - late final _wire_NodeBase_send_all_to_onchain_addressPtr = _lookup< + late final _wire_ldk_node_send_all_to_onchain_addressPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_send_all_to_onchain_address'); - late final _wire_NodeBase_send_all_to_onchain_address = - _wire_NodeBase_send_all_to_onchain_addressPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_send_all_to_onchain_address'); + late final _wire_ldk_node_send_all_to_onchain_address = + _wire_ldk_node_send_all_to_onchain_addressPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_send_payment( + void wire_ldk_node_send_payment( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer invoice, ) { - return _wire_NodeBase_send_payment( + return _wire_ldk_node_send_payment( port_, that, invoice, ); } - late final _wire_NodeBase_send_paymentPtr = _lookup< + late final _wire_ldk_node_send_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_send_payment'); - late final _wire_NodeBase_send_payment = - _wire_NodeBase_send_paymentPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_send_payment'); + late final _wire_ldk_node_send_payment = + _wire_ldk_node_send_paymentPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_send_payment_probes( + void wire_ldk_node_send_payment_probes( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer invoice, ) { - return _wire_NodeBase_send_payment_probes( + return _wire_ldk_node_send_payment_probes( port_, that, invoice, ); } - late final _wire_NodeBase_send_payment_probesPtr = _lookup< + late final _wire_ldk_node_send_payment_probesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_send_payment_probes'); - late final _wire_NodeBase_send_payment_probes = - _wire_NodeBase_send_payment_probesPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_send_payment_probes'); + late final _wire_ldk_node_send_payment_probes = + _wire_ldk_node_send_payment_probesPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_send_payment_probes_using_amount( + void wire_ldk_node_send_payment_probes_using_amount( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer invoice, int amount_msat, ) { - return _wire_NodeBase_send_payment_probes_using_amount( + return _wire_ldk_node_send_payment_probes_using_amount( port_, that, invoice, @@ -3147,23 +2348,23 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_send_payment_probes_using_amountPtr = _lookup< + late final _wire_ldk_node_send_payment_probes_using_amountPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer, ffi.Uint64)>>( - 'frbgen_ldk_node_wire_NodeBase_send_payment_probes_using_amount'); - late final _wire_NodeBase_send_payment_probes_using_amount = - _wire_NodeBase_send_payment_probes_using_amountPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_send_payment_probes_using_amount'); + late final _wire_ldk_node_send_payment_probes_using_amount = + _wire_ldk_node_send_payment_probes_using_amountPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer, int)>(); - void wire_NodeBase_send_payment_using_amount( + void wire_ldk_node_send_payment_using_amount( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer invoice, int amount_msat, ) { - return _wire_NodeBase_send_payment_using_amount( + return _wire_ldk_node_send_payment_using_amount( port_, that, invoice, @@ -3171,23 +2372,23 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_send_payment_using_amountPtr = _lookup< + late final _wire_ldk_node_send_payment_using_amountPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer, ffi.Uint64)>>( - 'frbgen_ldk_node_wire_NodeBase_send_payment_using_amount'); - late final _wire_NodeBase_send_payment_using_amount = - _wire_NodeBase_send_payment_using_amountPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_send_payment_using_amount'); + late final _wire_ldk_node_send_payment_using_amount = + _wire_ldk_node_send_payment_using_amountPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer, int)>(); - void wire_NodeBase_send_spontaneous_payment( + void wire_ldk_node_send_spontaneous_payment( int port_, - ffi.Pointer that, + ffi.Pointer that, int amount_msat, ffi.Pointer node_id, ) { - return _wire_NodeBase_send_spontaneous_payment( + return _wire_ldk_node_send_spontaneous_payment( port_, that, amount_msat, @@ -3195,23 +2396,23 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_send_spontaneous_paymentPtr = _lookup< + late final _wire_ldk_node_send_spontaneous_paymentPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Uint64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment'); - late final _wire_NodeBase_send_spontaneous_payment = - _wire_NodeBase_send_spontaneous_paymentPtr.asFunction< - void Function(int, ffi.Pointer, int, + 'frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment'); + late final _wire_ldk_node_send_spontaneous_payment = + _wire_ldk_node_send_spontaneous_paymentPtr.asFunction< + void Function(int, ffi.Pointer, int, ffi.Pointer)>(); - void wire_NodeBase_send_spontaneous_payment_probes( + void wire_ldk_node_send_spontaneous_payment_probes( int port_, - ffi.Pointer that, + ffi.Pointer that, int amount_msat, ffi.Pointer node_id, ) { - return _wire_NodeBase_send_spontaneous_payment_probes( + return _wire_ldk_node_send_spontaneous_payment_probes( port_, that, amount_msat, @@ -3219,23 +2420,23 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_send_spontaneous_payment_probesPtr = _lookup< + late final _wire_ldk_node_send_spontaneous_payment_probesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Uint64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment_probes'); - late final _wire_NodeBase_send_spontaneous_payment_probes = - _wire_NodeBase_send_spontaneous_payment_probesPtr.asFunction< - void Function(int, ffi.Pointer, int, + 'frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes'); + late final _wire_ldk_node_send_spontaneous_payment_probes = + _wire_ldk_node_send_spontaneous_payment_probesPtr.asFunction< + void Function(int, ffi.Pointer, int, ffi.Pointer)>(); - void wire_NodeBase_send_to_onchain_address( + void wire_ldk_node_send_to_onchain_address( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer address, int amount_sats, ) { - return _wire_NodeBase_send_to_onchain_address( + return _wire_ldk_node_send_to_onchain_address( port_, that, address, @@ -3243,148 +2444,167 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_send_to_onchain_addressPtr = _lookup< + late final _wire_ldk_node_send_to_onchain_addressPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer, ffi.Uint64)>>( - 'frbgen_ldk_node_wire_NodeBase_send_to_onchain_address'); - late final _wire_NodeBase_send_to_onchain_address = - _wire_NodeBase_send_to_onchain_addressPtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_send_to_onchain_address'); + late final _wire_ldk_node_send_to_onchain_address = + _wire_ldk_node_send_to_onchain_addressPtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer, int)>(); - void wire_NodeBase_sign_message( + void wire_ldk_node_sign_message( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer msg, ) { - return _wire_NodeBase_sign_message( + return _wire_ldk_node_sign_message( port_, that, msg, ); } - late final _wire_NodeBase_sign_messagePtr = _lookup< + late final _wire_ldk_node_sign_messagePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_sign_message'); - late final _wire_NodeBase_sign_message = - _wire_NodeBase_sign_messagePtr.asFunction< - void Function(int, ffi.Pointer, + 'frbgen_ldk_node_wire_ldk_node_sign_message'); + late final _wire_ldk_node_sign_message = + _wire_ldk_node_sign_messagePtr.asFunction< + void Function(int, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_start( + void wire_ldk_node_spendable_onchain_balance_sats( + int port_, + ffi.Pointer that, + ) { + return _wire_ldk_node_spendable_onchain_balance_sats( + port_, + that, + ); + } + + late final _wire_ldk_node_spendable_onchain_balance_satsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_spendable_onchain_balance_sats'); + late final _wire_ldk_node_spendable_onchain_balance_sats = + _wire_ldk_node_spendable_onchain_balance_satsPtr + .asFunction)>(); + + void wire_ldk_node_start( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_start( + return _wire_ldk_node_start( port_, that, ); } - late final _wire_NodeBase_startPtr = _lookup< + late final _wire_ldk_node_startPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_start'); - late final _wire_NodeBase_start = _wire_NodeBase_startPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_start'); + late final _wire_ldk_node_start = _wire_ldk_node_startPtr + .asFunction)>(); - void wire_NodeBase_status( + void wire_ldk_node_stop( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_status( + return _wire_ldk_node_stop( port_, that, ); } - late final _wire_NodeBase_statusPtr = _lookup< + late final _wire_ldk_node_stopPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_status'); - late final _wire_NodeBase_status = _wire_NodeBase_statusPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_stop'); + late final _wire_ldk_node_stop = _wire_ldk_node_stopPtr + .asFunction)>(); - void wire_NodeBase_stop( + void wire_ldk_node_sync_wallets( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_stop( + return _wire_ldk_node_sync_wallets( port_, that, ); } - late final _wire_NodeBase_stopPtr = _lookup< + late final _wire_ldk_node_sync_walletsPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_stop'); - late final _wire_NodeBase_stop = _wire_NodeBase_stopPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_sync_wallets'); + late final _wire_ldk_node_sync_wallets = _wire_ldk_node_sync_walletsPtr + .asFunction)>(); - void wire_NodeBase_sync_wallets( + void wire_ldk_node_total_onchain_balance_sats( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_sync_wallets( + return _wire_ldk_node_total_onchain_balance_sats( port_, that, ); } - late final _wire_NodeBase_sync_walletsPtr = _lookup< + late final _wire_ldk_node_total_onchain_balance_satsPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_sync_wallets'); - late final _wire_NodeBase_sync_wallets = _wire_NodeBase_sync_walletsPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_total_onchain_balance_sats'); + late final _wire_ldk_node_total_onchain_balance_sats = + _wire_ldk_node_total_onchain_balance_satsPtr + .asFunction)>(); - void wire_NodeBase_update_channel_config( + void wire_ldk_node_update_channel_config( int port_, - ffi.Pointer that, - ffi.Pointer user_channel_id, + ffi.Pointer that, + ffi.Pointer channel_id, ffi.Pointer counterparty_node_id, ffi.Pointer channel_config, ) { - return _wire_NodeBase_update_channel_config( + return _wire_ldk_node_update_channel_config( port_, that, - user_channel_id, + channel_id, counterparty_node_id, channel_config, ); } - late final _wire_NodeBase_update_channel_configPtr = _lookup< + late final _wire_ldk_node_update_channel_configPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_update_channel_config'); - late final _wire_NodeBase_update_channel_config = - _wire_NodeBase_update_channel_configPtr.asFunction< + 'frbgen_ldk_node_wire_ldk_node_update_channel_config'); + late final _wire_ldk_node_update_channel_config = + _wire_ldk_node_update_channel_configPtr.asFunction< void Function( int, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_verify_signature( + void wire_ldk_node_verify_signature( int port_, - ffi.Pointer that, + ffi.Pointer that, ffi.Pointer msg, ffi.Pointer sig, ffi.Pointer pkey, ) { - return _wire_NodeBase_verify_signature( + return _wire_ldk_node_verify_signature( port_, that, msg, @@ -3393,77 +2613,77 @@ class LdkCoreWire implements BaseWire { ); } - late final _wire_NodeBase_verify_signaturePtr = _lookup< + late final _wire_ldk_node_verify_signaturePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_verify_signature'); - late final _wire_NodeBase_verify_signature = - _wire_NodeBase_verify_signaturePtr.asFunction< + 'frbgen_ldk_node_wire_ldk_node_verify_signature'); + late final _wire_ldk_node_verify_signature = + _wire_ldk_node_verify_signaturePtr.asFunction< void Function( int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void wire_NodeBase_wait_next_event( + void wire_ldk_node_wait_next_event( int port_, - ffi.Pointer that, + ffi.Pointer that, ) { - return _wire_NodeBase_wait_next_event( + return _wire_ldk_node_wait_next_event( port_, that, ); } - late final _wire_NodeBase_wait_next_eventPtr = _lookup< + late final _wire_ldk_node_wait_next_eventPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer)>>( - 'frbgen_ldk_node_wire_NodeBase_wait_next_event'); - late final _wire_NodeBase_wait_next_event = _wire_NodeBase_wait_next_eventPtr - .asFunction)>(); + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_ldk_node_wait_next_event'); + late final _wire_ldk_node_wait_next_event = _wire_ldk_node_wait_next_eventPtr + .asFunction)>(); - void wire_finalize_builder( + void wire_socket_address_as_string( int port_, - ffi.Pointer config, - ffi.Pointer chain_data_source_config, - ffi.Pointer entropy_source_config, - ffi.Pointer gossip_source_config, - ffi.Pointer liquidity_source_config, + ffi.Pointer that, ) { - return _wire_finalize_builder( + return _wire_socket_address_as_string( port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config, + that, ); } - late final _wire_finalize_builderPtr = _lookup< + late final _wire_socket_address_as_stringPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - 'frbgen_ldk_node_wire_finalize_builder'); - late final _wire_finalize_builder = _wire_finalize_builderPtr.asFunction< - void Function( - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_socket_address_as_string'); + late final _wire_socket_address_as_string = _wire_socket_address_as_stringPtr + .asFunction)>(); + + void wire_socket_address_from_str( + int port_, + ffi.Pointer address, + ) { + return _wire_socket_address_from_str( + port_, + address, + ); + } + + late final _wire_socket_address_from_strPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer)>>( + 'frbgen_ldk_node_wire_socket_address_from_str'); + late final _wire_socket_address_from_str = + _wire_socket_address_from_strPtr.asFunction< + void Function(int, ffi.Pointer)>(); void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( ffi.Pointer ptr, @@ -3551,17 +2771,6 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_channel_idPtr .asFunction Function()>(); - ffi.Pointer cst_new_box_autoadd_closure_reason() { - return _cst_new_box_autoadd_closure_reason(); - } - - late final _cst_new_box_autoadd_closure_reasonPtr = _lookup< - ffi.NativeFunction Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_closure_reason'); - late final _cst_new_box_autoadd_closure_reason = - _cst_new_box_autoadd_closure_reasonPtr - .asFunction Function()>(); - ffi.Pointer cst_new_box_autoadd_config() { return _cst_new_box_autoadd_config(); } @@ -3608,52 +2817,26 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_gossip_source_configPtr .asFunction Function()>(); - ffi.Pointer - cst_new_box_autoadd_liquidity_source_config() { - return _cst_new_box_autoadd_liquidity_source_config(); - } - - late final _cst_new_box_autoadd_liquidity_source_configPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_liquidity_source_config'); - late final _cst_new_box_autoadd_liquidity_source_config = - _cst_new_box_autoadd_liquidity_source_configPtr.asFunction< - ffi.Pointer Function()>(); - - ffi.Pointer - cst_new_box_autoadd_max_dust_htlc_exposure() { - return _cst_new_box_autoadd_max_dust_htlc_exposure(); - } - - late final _cst_new_box_autoadd_max_dust_htlc_exposurePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure'); - late final _cst_new_box_autoadd_max_dust_htlc_exposure = - _cst_new_box_autoadd_max_dust_htlc_exposurePtr.asFunction< - ffi.Pointer Function()>(); - - ffi.Pointer cst_new_box_autoadd_mnemonic_base() { - return _cst_new_box_autoadd_mnemonic_base(); + ffi.Pointer cst_new_box_autoadd_ldk_mnemonic() { + return _cst_new_box_autoadd_ldk_mnemonic(); } - late final _cst_new_box_autoadd_mnemonic_basePtr = _lookup< - ffi.NativeFunction Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_mnemonic_base'); - late final _cst_new_box_autoadd_mnemonic_base = - _cst_new_box_autoadd_mnemonic_basePtr - .asFunction Function()>(); + late final _cst_new_box_autoadd_ldk_mnemonicPtr = _lookup< + ffi.NativeFunction Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic'); + late final _cst_new_box_autoadd_ldk_mnemonic = + _cst_new_box_autoadd_ldk_mnemonicPtr + .asFunction Function()>(); - ffi.Pointer cst_new_box_autoadd_node_base() { - return _cst_new_box_autoadd_node_base(); + ffi.Pointer cst_new_box_autoadd_ldk_node() { + return _cst_new_box_autoadd_ldk_node(); } - late final _cst_new_box_autoadd_node_basePtr = - _lookup Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_node_base'); - late final _cst_new_box_autoadd_node_base = _cst_new_box_autoadd_node_basePtr - .asFunction Function()>(); + late final _cst_new_box_autoadd_ldk_nodePtr = + _lookup Function()>>( + 'frbgen_ldk_node_cst_new_box_autoadd_ldk_node'); + late final _cst_new_box_autoadd_ldk_node = _cst_new_box_autoadd_ldk_nodePtr + .asFunction Function()>(); ffi.Pointer cst_new_box_autoadd_out_point() { return _cst_new_box_autoadd_out_point(); @@ -3676,21 +2859,6 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_payment_detailsPtr .asFunction Function()>(); - ffi.Pointer cst_new_box_autoadd_payment_failure_reason( - int value, - ) { - return _cst_new_box_autoadd_payment_failure_reason( - value, - ); - } - - late final _cst_new_box_autoadd_payment_failure_reasonPtr = - _lookup Function(ffi.Int32)>>( - 'frbgen_ldk_node_cst_new_box_autoadd_payment_failure_reason'); - late final _cst_new_box_autoadd_payment_failure_reason = - _cst_new_box_autoadd_payment_failure_reasonPtr - .asFunction Function(int)>(); - ffi.Pointer cst_new_box_autoadd_payment_hash() { return _cst_new_box_autoadd_payment_hash(); } @@ -3748,30 +2916,6 @@ class LdkCoreWire implements BaseWire { _cst_new_box_autoadd_socket_addressPtr .asFunction Function()>(); - ffi.Pointer cst_new_box_autoadd_txid() { - return _cst_new_box_autoadd_txid(); - } - - late final _cst_new_box_autoadd_txidPtr = - _lookup Function()>>( - 'frbgen_ldk_node_cst_new_box_autoadd_txid'); - late final _cst_new_box_autoadd_txid = _cst_new_box_autoadd_txidPtr - .asFunction Function()>(); - - ffi.Pointer cst_new_box_autoadd_u_16( - int value, - ) { - return _cst_new_box_autoadd_u_16( - value, - ); - } - - late final _cst_new_box_autoadd_u_16Ptr = - _lookup Function(ffi.Uint16)>>( - 'frbgen_ldk_node_cst_new_box_autoadd_u_16'); - late final _cst_new_box_autoadd_u_16 = _cst_new_box_autoadd_u_16Ptr - .asFunction Function(int)>(); - ffi.Pointer cst_new_box_autoadd_u_32( int value, ) { @@ -3826,22 +2970,6 @@ class LdkCoreWire implements BaseWire { late final _cst_new_list_channel_details = _cst_new_list_channel_detailsPtr .asFunction Function(int)>(); - ffi.Pointer cst_new_list_lightning_balance( - int len, - ) { - return _cst_new_list_lightning_balance( - len, - ); - } - - late final _cst_new_list_lightning_balancePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int32)>>('frbgen_ldk_node_cst_new_list_lightning_balance'); - late final _cst_new_list_lightning_balance = - _cst_new_list_lightning_balancePtr.asFunction< - ffi.Pointer Function(int)>(); - ffi.Pointer cst_new_list_payment_details( int len, ) { @@ -3872,24 +3000,6 @@ class LdkCoreWire implements BaseWire { late final _cst_new_list_peer_details = _cst_new_list_peer_detailsPtr .asFunction Function(int)>(); - ffi.Pointer - cst_new_list_pending_sweep_balance( - int len, - ) { - return _cst_new_list_pending_sweep_balance( - len, - ); - } - - late final _cst_new_list_pending_sweep_balancePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int32)>>( - 'frbgen_ldk_node_cst_new_list_pending_sweep_balance'); - late final _cst_new_list_pending_sweep_balance = - _cst_new_list_pending_sweep_balancePtr.asFunction< - ffi.Pointer Function(int)>(); - ffi.Pointer cst_new_list_prim_u_8_loose( int len, ) { @@ -3966,11 +3076,6 @@ typedef DartPostCObjectFnType = ffi.Pointer< ffi.Bool Function(DartPort port_id, ffi.Pointer message)>>; typedef DartPort = ffi.Int64; -final class wire_cst_node_base extends ffi.Struct { - @ffi.UintPtr() - external int ptr; -} - final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external ffi.Pointer ptr; @@ -3978,14 +3083,6 @@ final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external int len; } -final class wire_cst_user_channel_id extends ffi.Struct { - external ffi.Pointer data; -} - -final class wire_cst_public_key extends ffi.Struct { - external ffi.Pointer hex_code; -} - final class wire_cst_SocketAddress_TcpIpV4 extends ffi.Struct { external ffi.Pointer addr; @@ -4043,67 +3140,6 @@ final class wire_cst_socket_address extends ffi.Struct { external SocketAddressKind kind; } -final class wire_cst_MaxDustHTLCExposure_FixedLimitMsat extends ffi.Struct { - @ffi.Uint64() - external int field0; -} - -final class wire_cst_MaxDustHTLCExposure_FeeRateMultiplier extends ffi.Struct { - @ffi.Uint64() - external int field0; -} - -final class MaxDustHTLCExposureKind extends ffi.Union { - external wire_cst_MaxDustHTLCExposure_FixedLimitMsat FixedLimitMsat; - - external wire_cst_MaxDustHTLCExposure_FeeRateMultiplier FeeRateMultiplier; -} - -final class wire_cst_max_dust_htlc_exposure extends ffi.Struct { - @ffi.Int32() - external int tag; - - external MaxDustHTLCExposureKind kind; -} - -final class wire_cst_channel_config extends ffi.Struct { - @ffi.Uint32() - external int forwarding_fee_proportional_millionths; - - @ffi.Uint32() - external int forwarding_fee_base_msat; - - @ffi.Uint16() - external int cltv_expiry_delta; - - external ffi.Pointer max_dust_htlc_exposure; - - @ffi.Uint64() - external int force_close_avoidance_max_fee_satoshis; - - @ffi.Bool() - external bool accept_underpaying_htlcs; -} - -final class wire_cst_payment_hash extends ffi.Struct { - external ffi.Pointer data; -} - -final class wire_cst_address extends ffi.Struct { - external ffi.Pointer s; -} - -final class wire_cst_bolt_11_invoice extends ffi.Struct { - external ffi.Pointer signed_raw_invoice; -} - -final class wire_cst_list_prim_u_8_loose extends ffi.Struct { - external ffi.Pointer ptr; - - @ffi.Int32() - external int len; -} - final class wire_cst_list_socket_address extends ffi.Struct { external ffi.Pointer ptr; @@ -4111,6 +3147,10 @@ final class wire_cst_list_socket_address extends ffi.Struct { external int len; } +final class wire_cst_public_key extends ffi.Struct { + external ffi.Pointer hex; +} + final class wire_cst_list_public_key extends ffi.Struct { external ffi.Pointer ptr; @@ -4172,12 +3212,12 @@ final class wire_cst_EntropySourceConfig_SeedBytes extends ffi.Struct { external ffi.Pointer field0; } -final class wire_cst_mnemonic_base extends ffi.Struct { +final class wire_cst_ldk_mnemonic extends ffi.Struct { external ffi.Pointer seed_phrase; } final class wire_cst_EntropySourceConfig_Bip39Mnemonic extends ffi.Struct { - external ffi.Pointer mnemonic; + external ffi.Pointer mnemonic; external ffi.Pointer passphrase; } @@ -4212,55 +3252,82 @@ final class wire_cst_gossip_source_config extends ffi.Struct { external GossipSourceConfigKind kind; } -final class wire_cst_record_socket_address_public_key_opt_string - extends ffi.Struct { - external wire_cst_socket_address field0; - - external wire_cst_public_key field1; - - external ffi.Pointer field2; -} - -final class wire_cst_liquidity_source_config extends ffi.Struct { - external wire_cst_record_socket_address_public_key_opt_string lsps2_service; +final class wire_cst_ldk_node extends ffi.Struct { + @ffi.UintPtr() + external int ptr; } final class wire_cst_channel_id extends ffi.Struct { external ffi.Pointer data; } -final class wire_cst_ClosureReason_CounterpartyForceClosed extends ffi.Struct { - external ffi.Pointer peer_msg; +final class wire_cst_MaxDustHTLCExposure_FixedLimitMsat extends ffi.Struct { + @ffi.Uint64() + external int field0; } -final class wire_cst_ClosureReason_ProcessingError extends ffi.Struct { - external ffi.Pointer err; +final class wire_cst_MaxDustHTLCExposure_FeeRateMultiplier extends ffi.Struct { + @ffi.Uint64() + external int field0; } -final class ClosureReasonKind extends ffi.Union { - external wire_cst_ClosureReason_CounterpartyForceClosed - CounterpartyForceClosed; +final class MaxDustHTLCExposureKind extends ffi.Union { + external wire_cst_MaxDustHTLCExposure_FixedLimitMsat FixedLimitMsat; - external wire_cst_ClosureReason_ProcessingError ProcessingError; + external wire_cst_MaxDustHTLCExposure_FeeRateMultiplier FeeRateMultiplier; } -final class wire_cst_closure_reason extends ffi.Struct { +final class wire_cst_max_dust_htlc_exposure extends ffi.Struct { @ffi.Int32() external int tag; - external ClosureReasonKind kind; + external MaxDustHTLCExposureKind kind; +} + +final class wire_cst_channel_config extends ffi.Struct { + @ffi.Uint32() + external int forwarding_fee_proportional_millionths; + + @ffi.Uint32() + external int forwarding_fee_base_msat; + + @ffi.Uint16() + external int cltv_expiry_delta; + + external wire_cst_max_dust_htlc_exposure max_dust_htlc_exposure; + + @ffi.Uint64() + external int force_close_avoidance_max_fee_satoshis; + + @ffi.Bool() + external bool accept_underpaying_htlcs; +} + +final class wire_cst_payment_hash extends ffi.Struct { + external ffi.Pointer data; +} + +final class wire_cst_address extends ffi.Struct { + external ffi.Pointer s; +} + +final class wire_cst_bolt_11_invoice extends ffi.Struct { + external ffi.Pointer signed_raw_invoice; +} + +final class wire_cst_list_prim_u_8_loose extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; } final class wire_cst_Event_PaymentSuccessful extends ffi.Struct { external ffi.Pointer payment_hash; - - external ffi.Pointer fee_paid_msat; } final class wire_cst_Event_PaymentFailed extends ffi.Struct { external ffi.Pointer payment_hash; - - external ffi.Pointer reason; } final class wire_cst_Event_PaymentReceived extends ffi.Struct { @@ -4270,30 +3337,20 @@ final class wire_cst_Event_PaymentReceived extends ffi.Struct { external int amount_msat; } -final class wire_cst_txid extends ffi.Struct { - external ffi.Pointer hash; -} - -final class wire_cst_out_point extends ffi.Struct { - external wire_cst_txid txid; - - @ffi.Uint32() - external int vout; +final class wire_cst_user_channel_id extends ffi.Struct { + @ffi.Uint64() + external int data; } -final class wire_cst_Event_ChannelPending extends ffi.Struct { +final class wire_cst_Event_ChannelReady extends ffi.Struct { external ffi.Pointer channel_id; external ffi.Pointer user_channel_id; - external ffi.Pointer former_temporary_channel_id; - external ffi.Pointer counterparty_node_id; - - external ffi.Pointer funding_txo; } -final class wire_cst_Event_ChannelReady extends ffi.Struct { +final class wire_cst_Event_ChannelClosed extends ffi.Struct { external ffi.Pointer channel_id; external ffi.Pointer user_channel_id; @@ -4301,14 +3358,27 @@ final class wire_cst_Event_ChannelReady extends ffi.Struct { external ffi.Pointer counterparty_node_id; } -final class wire_cst_Event_ChannelClosed extends ffi.Struct { +final class wire_cst_txid extends ffi.Struct { + external ffi.Pointer hash; +} + +final class wire_cst_out_point extends ffi.Struct { + external wire_cst_txid txid; + + @ffi.Uint32() + external int vout; +} + +final class wire_cst_Event_ChannelPending extends ffi.Struct { external ffi.Pointer channel_id; external ffi.Pointer user_channel_id; + external ffi.Pointer former_temporary_channel_id; + external ffi.Pointer counterparty_node_id; - external ffi.Pointer reason; + external ffi.Pointer funding_txo; } final class EventKind extends ffi.Union { @@ -4318,11 +3388,11 @@ final class EventKind extends ffi.Union { external wire_cst_Event_PaymentReceived PaymentReceived; - external wire_cst_Event_ChannelPending ChannelPending; - external wire_cst_Event_ChannelReady ChannelReady; external wire_cst_Event_ChannelClosed ChannelClosed; + + external wire_cst_Event_ChannelPending ChannelPending; } final class wire_cst_event extends ffi.Struct { @@ -4361,7 +3431,7 @@ final class wire_cst_channel_details extends ffi.Struct { external wire_cst_public_key counterparty_node_id; - external ffi.Pointer funding_txo; + external ffi.Pointer funding_txo; @ffi.Uint64() external int channel_value_sats; @@ -4373,6 +3443,9 @@ final class wire_cst_channel_details extends ffi.Struct { @ffi.Uint32() external int feerate_sat_per_1000_weight; + @ffi.Uint64() + external int balance_msat; + @ffi.Uint64() external int outbound_capacity_msat; @@ -4394,38 +3467,6 @@ final class wire_cst_channel_details extends ffi.Struct { @ffi.Bool() external bool is_public; - - external ffi.Pointer cltv_expiry_delta; - - @ffi.Uint64() - external int counterparty_unspendable_punishment_reserve; - - external ffi.Pointer counterparty_outbound_htlc_minimum_msat; - - external ffi.Pointer counterparty_outbound_htlc_maximum_msat; - - external ffi.Pointer counterparty_forwarding_info_fee_base_msat; - - external ffi.Pointer - counterparty_forwarding_info_fee_proportional_millionths; - - external ffi.Pointer - counterparty_forwarding_info_cltv_expiry_delta; - - @ffi.Uint64() - external int next_outbound_htlc_limit_msat; - - @ffi.Uint64() - external int next_outbound_htlc_minimum_msat; - - external ffi.Pointer force_close_spend_delay; - - @ffi.Uint64() - external int inbound_htlc_minimum_msat; - - external ffi.Pointer inbound_htlc_maximum_msat; - - external wire_cst_channel_config config; } final class wire_cst_list_channel_details extends ffi.Struct { @@ -4435,118 +3476,6 @@ final class wire_cst_list_channel_details extends ffi.Struct { external int len; } -final class wire_cst_LightningBalance_ClaimableOnChannelClose - extends ffi.Struct { - external ffi.Pointer channel_id; - - external ffi.Pointer counterparty_node_id; - - @ffi.Uint64() - external int amount_satoshis; -} - -final class wire_cst_LightningBalance_ClaimableAwaitingConfirmations - extends ffi.Struct { - external ffi.Pointer channel_id; - - external ffi.Pointer counterparty_node_id; - - @ffi.Uint64() - external int amount_satoshis; - - @ffi.Uint32() - external int confirmation_height; -} - -final class wire_cst_LightningBalance_ContentiousClaimable extends ffi.Struct { - external ffi.Pointer channel_id; - - external ffi.Pointer counterparty_node_id; - - @ffi.Uint64() - external int amount_satoshis; - - @ffi.Uint32() - external int timeout_height; - - external ffi.Pointer payment_hash; - - external ffi.Pointer payment_preimage; -} - -final class wire_cst_LightningBalance_MaybeTimeoutClaimableHTLC - extends ffi.Struct { - external ffi.Pointer channel_id; - - external ffi.Pointer counterparty_node_id; - - @ffi.Uint64() - external int amount_satoshis; - - @ffi.Uint32() - external int claimable_height; - - external ffi.Pointer payment_hash; -} - -final class wire_cst_LightningBalance_MaybePreimageClaimableHTLC - extends ffi.Struct { - external ffi.Pointer channel_id; - - external ffi.Pointer counterparty_node_id; - - @ffi.Uint64() - external int amount_satoshis; - - @ffi.Uint32() - external int expiry_height; - - external ffi.Pointer payment_hash; -} - -final class wire_cst_LightningBalance_CounterpartyRevokedOutputClaimable - extends ffi.Struct { - external ffi.Pointer channel_id; - - external ffi.Pointer counterparty_node_id; - - @ffi.Uint64() - external int amount_satoshis; -} - -final class LightningBalanceKind extends ffi.Union { - external wire_cst_LightningBalance_ClaimableOnChannelClose - ClaimableOnChannelClose; - - external wire_cst_LightningBalance_ClaimableAwaitingConfirmations - ClaimableAwaitingConfirmations; - - external wire_cst_LightningBalance_ContentiousClaimable ContentiousClaimable; - - external wire_cst_LightningBalance_MaybeTimeoutClaimableHTLC - MaybeTimeoutClaimableHTLC; - - external wire_cst_LightningBalance_MaybePreimageClaimableHTLC - MaybePreimageClaimableHTLC; - - external wire_cst_LightningBalance_CounterpartyRevokedOutputClaimable - CounterpartyRevokedOutputClaimable; -} - -final class wire_cst_lightning_balance extends ffi.Struct { - @ffi.Int32() - external int tag; - - external LightningBalanceKind kind; -} - -final class wire_cst_list_lightning_balance extends ffi.Struct { - external ffi.Pointer ptr; - - @ffi.Int32() - external int len; -} - final class wire_cst_list_payment_details extends ffi.Struct { external ffi.Pointer ptr; @@ -4569,105 +3498,3 @@ final class wire_cst_list_peer_details extends ffi.Struct { @ffi.Int32() external int len; } - -final class wire_cst_PendingSweepBalance_PendingBroadcast extends ffi.Struct { - external ffi.Pointer channel_id; - - @ffi.Uint64() - external int amount_satoshis; -} - -final class wire_cst_PendingSweepBalance_BroadcastAwaitingConfirmation - extends ffi.Struct { - external ffi.Pointer channel_id; - - @ffi.Uint32() - external int latest_broadcast_height; - - external ffi.Pointer latest_spending_txid; - - @ffi.Uint64() - external int amount_satoshis; -} - -final class wire_cst_PendingSweepBalance_AwaitingThresholdConfirmations - extends ffi.Struct { - external ffi.Pointer channel_id; - - external ffi.Pointer latest_spending_txid; - - external ffi.Pointer confirmation_hash; - - @ffi.Uint32() - external int confirmation_height; - - @ffi.Uint64() - external int amount_satoshis; -} - -final class PendingSweepBalanceKind extends ffi.Union { - external wire_cst_PendingSweepBalance_PendingBroadcast PendingBroadcast; - - external wire_cst_PendingSweepBalance_BroadcastAwaitingConfirmation - BroadcastAwaitingConfirmation; - - external wire_cst_PendingSweepBalance_AwaitingThresholdConfirmations - AwaitingThresholdConfirmations; -} - -final class wire_cst_pending_sweep_balance extends ffi.Struct { - @ffi.Int32() - external int tag; - - external PendingSweepBalanceKind kind; -} - -final class wire_cst_list_pending_sweep_balance extends ffi.Struct { - external ffi.Pointer ptr; - - @ffi.Int32() - external int len; -} - -final class wire_cst_balance_details extends ffi.Struct { - @ffi.Uint64() - external int total_onchain_balance_sats; - - @ffi.Uint64() - external int spendable_onchain_balance_sats; - - @ffi.Uint64() - external int total_lightning_balance_sats; - - external ffi.Pointer lightning_balances; - - external ffi.Pointer - pending_balances_from_channel_closures; -} - -final class wire_cst_best_block extends ffi.Struct { - external ffi.Pointer block_hash; - - @ffi.Uint32() - external int height; -} - -final class wire_cst_node_status extends ffi.Struct { - @ffi.Bool() - external bool is_running; - - @ffi.Bool() - external bool is_listening; - - external wire_cst_best_block current_best_block; - - external ffi.Pointer latest_wallet_sync_timestamp; - - external ffi.Pointer latest_onchain_wallet_sync_timestamp; - - external ffi.Pointer latest_fee_rate_cache_update_timestamp; - - external ffi.Pointer latest_rgs_snapshot_timestamp; - - external ffi.Pointer latest_node_announcement_broadcast_timestamp; -} diff --git a/lib/src/generated/frb_generated.web.dart b/lib/src/generated/frb_generated.web.dart index b31ee10..7aa410c 100644 --- a/lib/src/generated/frb_generated.web.dart +++ b/lib/src/generated/frb_generated.web.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -32,12 +32,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Address dco_decode_address(dynamic raw); - @protected - BalanceDetails dco_decode_balance_details(dynamic raw); - - @protected - BestBlock dco_decode_best_block(dynamic raw); - @protected Bolt11Invoice dco_decode_bolt_11_invoice(dynamic raw); @@ -60,9 +54,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_box_autoadd_channel_id(dynamic raw); - @protected - ClosureReason dco_decode_box_autoadd_closure_reason(dynamic raw); - @protected Config dco_decode_box_autoadd_config(dynamic raw); @@ -76,18 +67,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig dco_decode_box_autoadd_gossip_source_config(dynamic raw); @protected - LiquiditySourceConfig dco_decode_box_autoadd_liquidity_source_config( - dynamic raw); + LdkMnemonic dco_decode_box_autoadd_ldk_mnemonic(dynamic raw); @protected - MaxDustHTLCExposure dco_decode_box_autoadd_max_dust_htlc_exposure( - dynamic raw); - - @protected - MnemonicBase dco_decode_box_autoadd_mnemonic_base(dynamic raw); - - @protected - NodeBase dco_decode_box_autoadd_node_base(dynamic raw); + LdkNode dco_decode_box_autoadd_ldk_node(dynamic raw); @protected OutPoint dco_decode_box_autoadd_out_point(dynamic raw); @@ -95,10 +78,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PaymentDetails dco_decode_box_autoadd_payment_details(dynamic raw); - @protected - PaymentFailureReason dco_decode_box_autoadd_payment_failure_reason( - dynamic raw); - @protected PaymentHash dco_decode_box_autoadd_payment_hash(dynamic raw); @@ -114,12 +93,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected SocketAddress dco_decode_box_autoadd_socket_address(dynamic raw); - @protected - Txid dco_decode_box_autoadd_txid(dynamic raw); - - @protected - int dco_decode_box_autoadd_u_16(dynamic raw); - @protected int dco_decode_box_autoadd_u_32(dynamic raw); @@ -130,7 +103,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId dco_decode_box_autoadd_user_channel_id(dynamic raw); @protected - BuilderError dco_decode_builder_error(dynamic raw); + BuilderException dco_decode_builder_exception(dynamic raw); @protected ChainDataSourceConfig dco_decode_chain_data_source_config(dynamic raw); @@ -144,9 +117,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId dco_decode_channel_id(dynamic raw); - @protected - ClosureReason dco_decode_closure_reason(dynamic raw); - @protected Config dco_decode_config(dynamic raw); @@ -163,26 +133,20 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int dco_decode_i_32(dynamic raw); @protected - LightningBalance dco_decode_lightning_balance(dynamic raw); + LdkMnemonic dco_decode_ldk_mnemonic(dynamic raw); @protected - LiquiditySourceConfig dco_decode_liquidity_source_config(dynamic raw); + LdkNode dco_decode_ldk_node(dynamic raw); @protected List dco_decode_list_channel_details(dynamic raw); - @protected - List dco_decode_list_lightning_balance(dynamic raw); - @protected List dco_decode_list_payment_details(dynamic raw); @protected List dco_decode_list_peer_details(dynamic raw); - @protected - List dco_decode_list_pending_sweep_balance(dynamic raw); - @protected List dco_decode_list_prim_u_8_loose(dynamic raw); @@ -201,20 +165,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected MaxDustHTLCExposure dco_decode_max_dust_htlc_exposure(dynamic raw); - @protected - MnemonicBase dco_decode_mnemonic_base(dynamic raw); - @protected Network dco_decode_network(dynamic raw); @protected - NodeBase dco_decode_node_base(dynamic raw); - - @protected - NodeBaseError dco_decode_node_base_error(dynamic raw); - - @protected - NodeStatus dco_decode_node_status(dynamic raw); + NodeException dco_decode_node_exception(dynamic raw); @protected String? dco_decode_opt_String(dynamic raw); @@ -226,12 +181,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelConfig? dco_decode_opt_box_autoadd_channel_config(dynamic raw); - @protected - ChannelId? dco_decode_opt_box_autoadd_channel_id(dynamic raw); - - @protected - ClosureReason? dco_decode_opt_box_autoadd_closure_reason(dynamic raw); - @protected EntropySourceConfig? dco_decode_opt_box_autoadd_entropy_source_config( dynamic raw); @@ -243,24 +192,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig? dco_decode_opt_box_autoadd_gossip_source_config( dynamic raw); - @protected - LiquiditySourceConfig? dco_decode_opt_box_autoadd_liquidity_source_config( - dynamic raw); - - @protected - MaxDustHTLCExposure? dco_decode_opt_box_autoadd_max_dust_htlc_exposure( - dynamic raw); - - @protected - OutPoint? dco_decode_opt_box_autoadd_out_point(dynamic raw); - @protected PaymentDetails? dco_decode_opt_box_autoadd_payment_details(dynamic raw); - @protected - PaymentFailureReason? dco_decode_opt_box_autoadd_payment_failure_reason( - dynamic raw); - @protected PaymentPreimage? dco_decode_opt_box_autoadd_payment_preimage(dynamic raw); @@ -270,9 +204,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PublicKey? dco_decode_opt_box_autoadd_public_key(dynamic raw); - @protected - int? dco_decode_opt_box_autoadd_u_16(dynamic raw); - @protected int? dco_decode_opt_box_autoadd_u_32(dynamic raw); @@ -291,9 +222,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PaymentDirection dco_decode_payment_direction(dynamic raw); - @protected - PaymentFailureReason dco_decode_payment_failure_reason(dynamic raw); - @protected PaymentHash dco_decode_payment_hash(dynamic raw); @@ -309,16 +237,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PeerDetails dco_decode_peer_details(dynamic raw); - @protected - PendingSweepBalance dco_decode_pending_sweep_balance(dynamic raw); - @protected PublicKey dco_decode_public_key(dynamic raw); - @protected - (SocketAddress, PublicKey, String?) - dco_decode_record_socket_address_public_key_opt_string(dynamic raw); - @protected SocketAddress dco_decode_socket_address(dynamic raw); @@ -371,12 +292,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected Address sse_decode_address(SseDeserializer deserializer); - @protected - BalanceDetails sse_decode_balance_details(SseDeserializer deserializer); - - @protected - BestBlock sse_decode_best_block(SseDeserializer deserializer); - @protected Bolt11Invoice sse_decode_bolt_11_invoice(SseDeserializer deserializer); @@ -401,10 +316,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId sse_decode_box_autoadd_channel_id(SseDeserializer deserializer); - @protected - ClosureReason sse_decode_box_autoadd_closure_reason( - SseDeserializer deserializer); - @protected Config sse_decode_box_autoadd_config(SseDeserializer deserializer); @@ -420,19 +331,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - LiquiditySourceConfig sse_decode_box_autoadd_liquidity_source_config( - SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure sse_decode_box_autoadd_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - MnemonicBase sse_decode_box_autoadd_mnemonic_base( - SseDeserializer deserializer); + LdkMnemonic sse_decode_box_autoadd_ldk_mnemonic(SseDeserializer deserializer); @protected - NodeBase sse_decode_box_autoadd_node_base(SseDeserializer deserializer); + LdkNode sse_decode_box_autoadd_ldk_node(SseDeserializer deserializer); @protected OutPoint sse_decode_box_autoadd_out_point(SseDeserializer deserializer); @@ -441,10 +343,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { PaymentDetails sse_decode_box_autoadd_payment_details( SseDeserializer deserializer); - @protected - PaymentFailureReason sse_decode_box_autoadd_payment_failure_reason( - SseDeserializer deserializer); - @protected PaymentHash sse_decode_box_autoadd_payment_hash(SseDeserializer deserializer); @@ -463,12 +361,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { SocketAddress sse_decode_box_autoadd_socket_address( SseDeserializer deserializer); - @protected - Txid sse_decode_box_autoadd_txid(SseDeserializer deserializer); - - @protected - int sse_decode_box_autoadd_u_16(SseDeserializer deserializer); - @protected int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); @@ -480,7 +372,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - BuilderError sse_decode_builder_error(SseDeserializer deserializer); + BuilderException sse_decode_builder_exception(SseDeserializer deserializer); @protected ChainDataSourceConfig sse_decode_chain_data_source_config( @@ -495,9 +387,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected ChannelId sse_decode_channel_id(SseDeserializer deserializer); - @protected - ClosureReason sse_decode_closure_reason(SseDeserializer deserializer); - @protected Config sse_decode_config(SseDeserializer deserializer); @@ -516,20 +405,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int sse_decode_i_32(SseDeserializer deserializer); @protected - LightningBalance sse_decode_lightning_balance(SseDeserializer deserializer); + LdkMnemonic sse_decode_ldk_mnemonic(SseDeserializer deserializer); @protected - LiquiditySourceConfig sse_decode_liquidity_source_config( - SseDeserializer deserializer); + LdkNode sse_decode_ldk_node(SseDeserializer deserializer); @protected List sse_decode_list_channel_details( SseDeserializer deserializer); - @protected - List sse_decode_list_lightning_balance( - SseDeserializer deserializer); - @protected List sse_decode_list_payment_details( SseDeserializer deserializer); @@ -537,10 +421,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected List sse_decode_list_peer_details(SseDeserializer deserializer); - @protected - List sse_decode_list_pending_sweep_balance( - SseDeserializer deserializer); - @protected List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); @@ -561,20 +441,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { MaxDustHTLCExposure sse_decode_max_dust_htlc_exposure( SseDeserializer deserializer); - @protected - MnemonicBase sse_decode_mnemonic_base(SseDeserializer deserializer); - @protected Network sse_decode_network(SseDeserializer deserializer); @protected - NodeBase sse_decode_node_base(SseDeserializer deserializer); - - @protected - NodeBaseError sse_decode_node_base_error(SseDeserializer deserializer); - - @protected - NodeStatus sse_decode_node_status(SseDeserializer deserializer); + NodeException sse_decode_node_exception(SseDeserializer deserializer); @protected String? sse_decode_opt_String(SseDeserializer deserializer); @@ -587,14 +458,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { ChannelConfig? sse_decode_opt_box_autoadd_channel_config( SseDeserializer deserializer); - @protected - ChannelId? sse_decode_opt_box_autoadd_channel_id( - SseDeserializer deserializer); - - @protected - ClosureReason? sse_decode_opt_box_autoadd_closure_reason( - SseDeserializer deserializer); - @protected EntropySourceConfig? sse_decode_opt_box_autoadd_entropy_source_config( SseDeserializer deserializer); @@ -606,25 +469,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig? sse_decode_opt_box_autoadd_gossip_source_config( SseDeserializer deserializer); - @protected - LiquiditySourceConfig? sse_decode_opt_box_autoadd_liquidity_source_config( - SseDeserializer deserializer); - - @protected - MaxDustHTLCExposure? sse_decode_opt_box_autoadd_max_dust_htlc_exposure( - SseDeserializer deserializer); - - @protected - OutPoint? sse_decode_opt_box_autoadd_out_point(SseDeserializer deserializer); - @protected PaymentDetails? sse_decode_opt_box_autoadd_payment_details( SseDeserializer deserializer); - @protected - PaymentFailureReason? sse_decode_opt_box_autoadd_payment_failure_reason( - SseDeserializer deserializer); - @protected PaymentPreimage? sse_decode_opt_box_autoadd_payment_preimage( SseDeserializer deserializer); @@ -637,9 +485,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { PublicKey? sse_decode_opt_box_autoadd_public_key( SseDeserializer deserializer); - @protected - int? sse_decode_opt_box_autoadd_u_16(SseDeserializer deserializer); - @protected int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); @@ -659,10 +504,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PaymentDirection sse_decode_payment_direction(SseDeserializer deserializer); - @protected - PaymentFailureReason sse_decode_payment_failure_reason( - SseDeserializer deserializer); - @protected PaymentHash sse_decode_payment_hash(SseDeserializer deserializer); @@ -678,18 +519,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected PeerDetails sse_decode_peer_details(SseDeserializer deserializer); - @protected - PendingSweepBalance sse_decode_pending_sweep_balance( - SseDeserializer deserializer); - @protected PublicKey sse_decode_public_key(SseDeserializer deserializer); - @protected - (SocketAddress, PublicKey, String?) - sse_decode_record_socket_address_public_key_opt_string( - SseDeserializer deserializer); - @protected SocketAddress sse_decode_socket_address(SseDeserializer deserializer); @@ -744,25 +576,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return [cst_encode_String(raw.s)]; } - @protected - List cst_encode_balance_details(BalanceDetails raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_u_64(raw.totalOnchainBalanceSats), - cst_encode_u_64(raw.spendableOnchainBalanceSats), - cst_encode_u_64(raw.totalLightningBalanceSats), - cst_encode_list_lightning_balance(raw.lightningBalances), - cst_encode_list_pending_sweep_balance( - raw.pendingBalancesFromChannelClosures) - ]; - } - - @protected - List cst_encode_best_block(BestBlock raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.blockHash), cst_encode_u_32(raw.height)]; - } - @protected List cst_encode_bolt_11_invoice(Bolt11Invoice raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -800,12 +613,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return cst_encode_channel_id(raw); } - @protected - List cst_encode_box_autoadd_closure_reason(ClosureReason raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_closure_reason(raw); - } - @protected List cst_encode_box_autoadd_config(Config raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -833,29 +640,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - List cst_encode_box_autoadd_liquidity_source_config( - LiquiditySourceConfig raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_liquidity_source_config(raw); - } - - @protected - List cst_encode_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure raw) { + List cst_encode_box_autoadd_ldk_mnemonic(LdkMnemonic raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_max_dust_htlc_exposure(raw); + return cst_encode_ldk_mnemonic(raw); } @protected - List cst_encode_box_autoadd_mnemonic_base(MnemonicBase raw) { + List cst_encode_box_autoadd_ldk_node(LdkNode raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_mnemonic_base(raw); - } - - @protected - List cst_encode_box_autoadd_node_base(NodeBase raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_node_base(raw); + return cst_encode_ldk_node(raw); } @protected @@ -870,12 +663,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return cst_encode_payment_details(raw); } - @protected - int cst_encode_box_autoadd_payment_failure_reason(PaymentFailureReason raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_payment_failure_reason(raw); - } - @protected List cst_encode_box_autoadd_payment_hash(PaymentHash raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -906,18 +693,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return cst_encode_socket_address(raw); } - @protected - List cst_encode_box_autoadd_txid(Txid raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_txid(raw); - } - - @protected - int cst_encode_box_autoadd_u_16(int raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return cst_encode_u_16(raw); - } - @protected int cst_encode_box_autoadd_u_32(int raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -953,8 +728,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_encode_u_32(raw.forwardingFeeProportionalMillionths), cst_encode_u_32(raw.forwardingFeeBaseMsat), cst_encode_u_16(raw.cltvExpiryDelta), - cst_encode_opt_box_autoadd_max_dust_htlc_exposure( - raw.maxDustHtlcExposure), + cst_encode_max_dust_htlc_exposure(raw.maxDustHtlcExposure), cst_encode_u_64(raw.forceCloseAvoidanceMaxFeeSatoshis), cst_encode_bool(raw.acceptUnderpayingHtlcs) ]; @@ -966,11 +740,12 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return [ cst_encode_channel_id(raw.channelId), cst_encode_public_key(raw.counterpartyNodeId), - cst_encode_opt_box_autoadd_out_point(raw.fundingTxo), + cst_encode_opt_String(raw.fundingTxo), cst_encode_u_64(raw.channelValueSats), cst_encode_opt_box_autoadd_u_64(raw.unspendablePunishmentReserve), cst_encode_user_channel_id(raw.userChannelId), cst_encode_u_32(raw.feerateSatPer1000Weight), + cst_encode_u_64(raw.balanceMsat), cst_encode_u_64(raw.outboundCapacityMsat), cst_encode_u_64(raw.inboundCapacityMsat), cst_encode_opt_box_autoadd_u_32(raw.confirmationsRequired), @@ -978,23 +753,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_encode_bool(raw.isOutbound), cst_encode_bool(raw.isChannelReady), cst_encode_bool(raw.isUsable), - cst_encode_bool(raw.isPublic), - cst_encode_opt_box_autoadd_u_16(raw.cltvExpiryDelta), - cst_encode_u_64(raw.counterpartyUnspendablePunishmentReserve), - cst_encode_opt_box_autoadd_u_64(raw.counterpartyOutboundHtlcMinimumMsat), - cst_encode_opt_box_autoadd_u_64(raw.counterpartyOutboundHtlcMaximumMsat), - cst_encode_opt_box_autoadd_u_32( - raw.counterpartyForwardingInfoFeeBaseMsat), - cst_encode_opt_box_autoadd_u_32( - raw.counterpartyForwardingInfoFeeProportionalMillionths), - cst_encode_opt_box_autoadd_u_16( - raw.counterpartyForwardingInfoCltvExpiryDelta), - cst_encode_u_64(raw.nextOutboundHtlcLimitMsat), - cst_encode_u_64(raw.nextOutboundHtlcMinimumMsat), - cst_encode_opt_box_autoadd_u_16(raw.forceCloseSpendDelay), - cst_encode_u_64(raw.inboundHtlcMinimumMsat), - cst_encode_opt_box_autoadd_u_64(raw.inboundHtlcMaximumMsat), - cst_encode_channel_config(raw.config) + cst_encode_bool(raw.isPublic) ]; } @@ -1004,43 +763,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return [cst_encode_u_8_array_32(raw.data)]; } - @protected - List cst_encode_closure_reason(ClosureReason raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is ClosureReason_CounterpartyForceClosed) { - return [0, cst_encode_String(raw.peerMsg)]; - } - if (raw is ClosureReason_HolderForceClosed) { - return [1]; - } - if (raw is ClosureReason_CooperativeClosure) { - return [2]; - } - if (raw is ClosureReason_CommitmentTxConfirmed) { - return [3]; - } - if (raw is ClosureReason_FundingTimedOut) { - return [4]; - } - if (raw is ClosureReason_ProcessingError) { - return [5, cst_encode_String(raw.err)]; - } - if (raw is ClosureReason_DisconnectedPeer) { - return [6]; - } - if (raw is ClosureReason_OutdatedChannelManager) { - return [7]; - } - if (raw is ClosureReason_CounterpartyCoopClosedUnfundedChannel) { - return [8]; - } - if (raw is ClosureReason_FundingBatchClosure) { - return [9]; - } - - throw Exception('unreachable'); - } - @protected List cst_encode_config(Config raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1071,7 +793,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { if (raw is EntropySourceConfig_Bip39Mnemonic) { return [ 2, - cst_encode_box_autoadd_mnemonic_base(raw.mnemonic), + cst_encode_box_autoadd_ldk_mnemonic(raw.mnemonic), cst_encode_opt_String(raw.passphrase) ]; } @@ -1083,18 +805,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { List cst_encode_event(Event raw) { // Codec=Cst (C-struct based), see doc to use other codecs if (raw is Event_PaymentSuccessful) { - return [ - 0, - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_opt_box_autoadd_u_64(raw.feePaidMsat) - ]; + return [0, cst_encode_box_autoadd_payment_hash(raw.paymentHash)]; } if (raw is Event_PaymentFailed) { - return [ - 1, - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_opt_box_autoadd_payment_failure_reason(raw.reason) - ]; + return [1, cst_encode_box_autoadd_payment_hash(raw.paymentHash)]; } if (raw is Event_PaymentReceived) { return [ @@ -1103,17 +817,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_encode_u_64(raw.amountMsat) ]; } - if (raw is Event_ChannelPending) { + if (raw is Event_ChannelReady) { return [ 3, cst_encode_box_autoadd_channel_id(raw.channelId), cst_encode_box_autoadd_user_channel_id(raw.userChannelId), - cst_encode_box_autoadd_channel_id(raw.formerTemporaryChannelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_box_autoadd_out_point(raw.fundingTxo) + cst_encode_opt_box_autoadd_public_key(raw.counterpartyNodeId) ]; } - if (raw is Event_ChannelReady) { + if (raw is Event_ChannelClosed) { return [ 4, cst_encode_box_autoadd_channel_id(raw.channelId), @@ -1121,13 +833,14 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { cst_encode_opt_box_autoadd_public_key(raw.counterpartyNodeId) ]; } - if (raw is Event_ChannelClosed) { + if (raw is Event_ChannelPending) { return [ 5, cst_encode_box_autoadd_channel_id(raw.channelId), cst_encode_box_autoadd_user_channel_id(raw.userChannelId), - cst_encode_opt_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_opt_box_autoadd_closure_reason(raw.reason) + cst_encode_box_autoadd_channel_id(raw.formerTemporaryChannelId), + cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), + cst_encode_box_autoadd_out_point(raw.fundingTxo) ]; } @@ -1148,74 +861,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { } @protected - List cst_encode_lightning_balance(LightningBalance raw) { + List cst_encode_ldk_mnemonic(LdkMnemonic raw) { // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is LightningBalance_ClaimableOnChannelClose) { - return [ - 0, - cst_encode_box_autoadd_channel_id(raw.channelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_u_64(raw.amountSatoshis) - ]; - } - if (raw is LightningBalance_ClaimableAwaitingConfirmations) { - return [ - 1, - cst_encode_box_autoadd_channel_id(raw.channelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_u_64(raw.amountSatoshis), - cst_encode_u_32(raw.confirmationHeight) - ]; - } - if (raw is LightningBalance_ContentiousClaimable) { - return [ - 2, - cst_encode_box_autoadd_channel_id(raw.channelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_u_64(raw.amountSatoshis), - cst_encode_u_32(raw.timeoutHeight), - cst_encode_box_autoadd_payment_hash(raw.paymentHash), - cst_encode_box_autoadd_payment_preimage(raw.paymentPreimage) - ]; - } - if (raw is LightningBalance_MaybeTimeoutClaimableHTLC) { - return [ - 3, - cst_encode_box_autoadd_channel_id(raw.channelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_u_64(raw.amountSatoshis), - cst_encode_u_32(raw.claimableHeight), - cst_encode_box_autoadd_payment_hash(raw.paymentHash) - ]; - } - if (raw is LightningBalance_MaybePreimageClaimableHTLC) { - return [ - 4, - cst_encode_box_autoadd_channel_id(raw.channelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_u_64(raw.amountSatoshis), - cst_encode_u_32(raw.expiryHeight), - cst_encode_box_autoadd_payment_hash(raw.paymentHash) - ]; - } - if (raw is LightningBalance_CounterpartyRevokedOutputClaimable) { - return [ - 5, - cst_encode_box_autoadd_channel_id(raw.channelId), - cst_encode_box_autoadd_public_key(raw.counterpartyNodeId), - cst_encode_u_64(raw.amountSatoshis) - ]; - } - - throw Exception('unreachable'); + return [cst_encode_String(raw.seedPhrase)]; } @protected - List cst_encode_liquidity_source_config(LiquiditySourceConfig raw) { + List cst_encode_ldk_node(LdkNode raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_record_socket_address_public_key_opt_string(raw.lsps2Service) - ]; + return [cst_encode_RustOpaque_NodeSqliteStore(raw.ptr)]; } @protected @@ -1224,12 +878,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw.map(cst_encode_channel_details).toList(); } - @protected - List cst_encode_list_lightning_balance(List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_lightning_balance).toList(); - } - @protected List cst_encode_list_payment_details(List raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1242,13 +890,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw.map(cst_encode_peer_details).toList(); } - @protected - List cst_encode_list_pending_sweep_balance( - List raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw.map(cst_encode_pending_sweep_balance).toList(); - } - @protected List cst_encode_list_prim_u_8_loose(List raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1286,34 +927,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { throw Exception('unreachable'); } - @protected - List cst_encode_mnemonic_base(MnemonicBase raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.seedPhrase)]; - } - - @protected - List cst_encode_node_base(NodeBase raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_RustOpaque_NodeSqliteStore(raw.ptr)]; - } - - @protected - List cst_encode_node_status(NodeStatus raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_bool(raw.isRunning), - cst_encode_bool(raw.isListening), - cst_encode_best_block(raw.currentBestBlock), - cst_encode_opt_box_autoadd_u_64(raw.latestWalletSyncTimestamp), - cst_encode_opt_box_autoadd_u_64(raw.latestOnchainWalletSyncTimestamp), - cst_encode_opt_box_autoadd_u_64(raw.latestFeeRateCacheUpdateTimestamp), - cst_encode_opt_box_autoadd_u_64(raw.latestRgsSnapshotTimestamp), - cst_encode_opt_box_autoadd_u_64( - raw.latestNodeAnnouncementBroadcastTimestamp) - ]; - } - @protected String? cst_encode_opt_String(String? raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1335,18 +948,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw == null ? null : cst_encode_box_autoadd_channel_config(raw); } - @protected - List? cst_encode_opt_box_autoadd_channel_id(ChannelId? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_channel_id(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_closure_reason(ClosureReason? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_closure_reason(raw); - } - @protected List? cst_encode_opt_box_autoadd_entropy_source_config( EntropySourceConfig? raw) { @@ -1371,30 +972,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { : cst_encode_box_autoadd_gossip_source_config(raw); } - @protected - List? cst_encode_opt_box_autoadd_liquidity_source_config( - LiquiditySourceConfig? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_liquidity_source_config(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_max_dust_htlc_exposure(raw); - } - - @protected - List? cst_encode_opt_box_autoadd_out_point(OutPoint? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_out_point(raw); - } - @protected List? cst_encode_opt_box_autoadd_payment_details( PaymentDetails? raw) { @@ -1402,15 +979,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw == null ? null : cst_encode_box_autoadd_payment_details(raw); } - @protected - int? cst_encode_opt_box_autoadd_payment_failure_reason( - PaymentFailureReason? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? null - : cst_encode_box_autoadd_payment_failure_reason(raw); - } - @protected List? cst_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? raw) { @@ -1430,12 +998,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { return raw == null ? null : cst_encode_box_autoadd_public_key(raw); } - @protected - int? cst_encode_opt_box_autoadd_u_16(int? raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null ? null : cst_encode_box_autoadd_u_16(raw); - } - @protected int? cst_encode_opt_box_autoadd_u_32(int? raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -1501,54 +1063,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { ]; } - @protected - List cst_encode_pending_sweep_balance(PendingSweepBalance raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - if (raw is PendingSweepBalance_PendingBroadcast) { - return [ - 0, - cst_encode_opt_box_autoadd_channel_id(raw.channelId), - cst_encode_u_64(raw.amountSatoshis) - ]; - } - if (raw is PendingSweepBalance_BroadcastAwaitingConfirmation) { - return [ - 1, - cst_encode_opt_box_autoadd_channel_id(raw.channelId), - cst_encode_u_32(raw.latestBroadcastHeight), - cst_encode_box_autoadd_txid(raw.latestSpendingTxid), - cst_encode_u_64(raw.amountSatoshis) - ]; - } - if (raw is PendingSweepBalance_AwaitingThresholdConfirmations) { - return [ - 2, - cst_encode_opt_box_autoadd_channel_id(raw.channelId), - cst_encode_box_autoadd_txid(raw.latestSpendingTxid), - cst_encode_String(raw.confirmationHash), - cst_encode_u_32(raw.confirmationHeight), - cst_encode_u_64(raw.amountSatoshis) - ]; - } - - throw Exception('unreachable'); - } - @protected List cst_encode_public_key(PublicKey raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_String(raw.hexCode)]; - } - - @protected - List cst_encode_record_socket_address_public_key_opt_string( - (SocketAddress, PublicKey, String?) raw) { - // Codec=Cst (C-struct based), see doc to use other codecs - return [ - cst_encode_socket_address(raw.$1), - cst_encode_public_key(raw.$2), - cst_encode_opt_String(raw.$3) - ]; + return [cst_encode_String(raw.hex)]; } @protected @@ -1624,7 +1142,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected List cst_encode_user_channel_id(UserChannelId raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return [cst_encode_list_prim_u_8_strict(raw.data)]; + return [cst_encode_u_64(raw.data)]; } @protected @@ -1634,7 +1152,7 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { bool cst_encode_bool(bool raw); @protected - int cst_encode_builder_error(BuilderError raw); + int cst_encode_builder_exception(BuilderException raw); @protected int cst_encode_i_32(int raw); @@ -1646,14 +1164,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { int cst_encode_network(Network raw); @protected - int cst_encode_node_base_error(NodeBaseError raw); + int cst_encode_node_exception(NodeException raw); @protected int cst_encode_payment_direction(PaymentDirection raw); - @protected - int cst_encode_payment_failure_reason(PaymentFailureReason raw); - @protected int cst_encode_payment_status(PaymentStatus raw); @@ -1682,13 +1197,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_address(Address self, SseSerializer serializer); - @protected - void sse_encode_balance_details( - BalanceDetails self, SseSerializer serializer); - - @protected - void sse_encode_best_block(BestBlock self, SseSerializer serializer); - @protected void sse_encode_bolt_11_invoice(Bolt11Invoice self, SseSerializer serializer); @@ -1714,10 +1222,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_channel_id( ChannelId self, SseSerializer serializer); - @protected - void sse_encode_box_autoadd_closure_reason( - ClosureReason self, SseSerializer serializer); - @protected void sse_encode_box_autoadd_config(Config self, SseSerializer serializer); @@ -1733,20 +1237,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { GossipSourceConfig self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_liquidity_source_config( - LiquiditySourceConfig self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_mnemonic_base( - MnemonicBase self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_mnemonic( + LdkMnemonic self, SseSerializer serializer); @protected - void sse_encode_box_autoadd_node_base( - NodeBase self, SseSerializer serializer); + void sse_encode_box_autoadd_ldk_node(LdkNode self, SseSerializer serializer); @protected void sse_encode_box_autoadd_out_point( @@ -1756,10 +1251,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_payment_details( PaymentDetails self, SseSerializer serializer); - @protected - void sse_encode_box_autoadd_payment_failure_reason( - PaymentFailureReason self, SseSerializer serializer); - @protected void sse_encode_box_autoadd_payment_hash( PaymentHash self, SseSerializer serializer); @@ -1780,12 +1271,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_box_autoadd_socket_address( SocketAddress self, SseSerializer serializer); - @protected - void sse_encode_box_autoadd_txid(Txid self, SseSerializer serializer); - - @protected - void sse_encode_box_autoadd_u_16(int self, SseSerializer serializer); - @protected void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); @@ -1797,7 +1282,8 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { UserChannelId self, SseSerializer serializer); @protected - void sse_encode_builder_error(BuilderError self, SseSerializer serializer); + void sse_encode_builder_exception( + BuilderException self, SseSerializer serializer); @protected void sse_encode_chain_data_source_config( @@ -1813,9 +1299,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_channel_id(ChannelId self, SseSerializer serializer); - @protected - void sse_encode_closure_reason(ClosureReason self, SseSerializer serializer); - @protected void sse_encode_config(Config self, SseSerializer serializer); @@ -1834,21 +1317,15 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_i_32(int self, SseSerializer serializer); @protected - void sse_encode_lightning_balance( - LightningBalance self, SseSerializer serializer); + void sse_encode_ldk_mnemonic(LdkMnemonic self, SseSerializer serializer); @protected - void sse_encode_liquidity_source_config( - LiquiditySourceConfig self, SseSerializer serializer); + void sse_encode_ldk_node(LdkNode self, SseSerializer serializer); @protected void sse_encode_list_channel_details( List self, SseSerializer serializer); - @protected - void sse_encode_list_lightning_balance( - List self, SseSerializer serializer); - @protected void sse_encode_list_payment_details( List self, SseSerializer serializer); @@ -1857,10 +1334,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_list_peer_details( List self, SseSerializer serializer); - @protected - void sse_encode_list_pending_sweep_balance( - List self, SseSerializer serializer); - @protected void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); @@ -1883,20 +1356,11 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_max_dust_htlc_exposure( MaxDustHTLCExposure self, SseSerializer serializer); - @protected - void sse_encode_mnemonic_base(MnemonicBase self, SseSerializer serializer); - @protected void sse_encode_network(Network self, SseSerializer serializer); @protected - void sse_encode_node_base(NodeBase self, SseSerializer serializer); - - @protected - void sse_encode_node_base_error(NodeBaseError self, SseSerializer serializer); - - @protected - void sse_encode_node_status(NodeStatus self, SseSerializer serializer); + void sse_encode_node_exception(NodeException self, SseSerializer serializer); @protected void sse_encode_opt_String(String? self, SseSerializer serializer); @@ -1909,14 +1373,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_channel_config( ChannelConfig? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_channel_id( - ChannelId? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_closure_reason( - ClosureReason? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_entropy_source_config( EntropySourceConfig? self, SseSerializer serializer); @@ -1928,26 +1384,10 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_gossip_source_config( GossipSourceConfig? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_liquidity_source_config( - LiquiditySourceConfig? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_max_dust_htlc_exposure( - MaxDustHTLCExposure? self, SseSerializer serializer); - - @protected - void sse_encode_opt_box_autoadd_out_point( - OutPoint? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_payment_details( PaymentDetails? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_payment_failure_reason( - PaymentFailureReason? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_payment_preimage( PaymentPreimage? self, SseSerializer serializer); @@ -1960,9 +1400,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_public_key( PublicKey? self, SseSerializer serializer); - @protected - void sse_encode_opt_box_autoadd_u_16(int? self, SseSerializer serializer); - @protected void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); @@ -1984,10 +1421,6 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { void sse_encode_payment_direction( PaymentDirection self, SseSerializer serializer); - @protected - void sse_encode_payment_failure_reason( - PaymentFailureReason self, SseSerializer serializer); - @protected void sse_encode_payment_hash(PaymentHash self, SseSerializer serializer); @@ -2004,17 +1437,9 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { @protected void sse_encode_peer_details(PeerDetails self, SseSerializer serializer); - @protected - void sse_encode_pending_sweep_balance( - PendingSweepBalance self, SseSerializer serializer); - @protected void sse_encode_public_key(PublicKey self, SseSerializer serializer); - @protected - void sse_encode_record_socket_address_public_key_opt_string( - (SocketAddress, PublicKey, String?) self, SseSerializer serializer); - @protected void sse_encode_socket_address(SocketAddress self, SseSerializer serializer); @@ -2063,203 +1488,188 @@ abstract class LdkCoreApiImplPlatform extends BaseApiImpl { class LdkCoreWire implements BaseWire { LdkCoreWire.fromExternalLibrary(ExternalLibrary lib); - void wire_MnemonicBase_generate(NativePortType port_) => - wasmModule.wire_MnemonicBase_generate(port_); + void wire_build_with_sqlite_store( + NativePortType port_, + List config, + List? chain_data_source_config, + List? entropy_source_config, + List? gossip_source_config) => + wasmModule.wire_build_with_sqlite_store( + port_, + config, + chain_data_source_config, + entropy_source_config, + gossip_source_config); - void wire_NodeBase_close_channel(NativePortType port_, List that, - List user_channel_id, List counterparty_node_id) => - wasmModule.wire_NodeBase_close_channel( - port_, that, user_channel_id, counterparty_node_id); + void wire_ldk_mnemonic_generate(NativePortType port_) => + wasmModule.wire_ldk_mnemonic_generate(port_); - void wire_NodeBase_config(NativePortType port_, List that) => - wasmModule.wire_NodeBase_config(port_, that); + void wire_ldk_node_close_channel(NativePortType port_, List that, + List channel_id, List counterparty_node_id) => + wasmModule.wire_ldk_node_close_channel( + port_, that, channel_id, counterparty_node_id); - void wire_NodeBase_connect(NativePortType port_, List that, + void wire_ldk_node_connect(NativePortType port_, List that, List node_id, List address, bool persist) => - wasmModule.wire_NodeBase_connect(port_, that, node_id, address, persist); + wasmModule.wire_ldk_node_connect(port_, that, node_id, address, persist); - void wire_NodeBase_connect_open_channel( + void wire_ldk_node_connect_open_channel( NativePortType port_, List that, - List address, + List socket_address, List node_id, Object channel_amount_sats, Object? push_to_counterparty_msat, bool announce_channel, List? channel_config) => - wasmModule.wire_NodeBase_connect_open_channel( + wasmModule.wire_ldk_node_connect_open_channel( port_, that, - address, + socket_address, node_id, channel_amount_sats, push_to_counterparty_msat, announce_channel, channel_config); - void wire_NodeBase_disconnect(NativePortType port_, List that, + void wire_ldk_node_disconnect(NativePortType port_, List that, List counterparty_node_id) => - wasmModule.wire_NodeBase_disconnect(port_, that, counterparty_node_id); + wasmModule.wire_ldk_node_disconnect(port_, that, counterparty_node_id); - void wire_NodeBase_event_handled(NativePortType port_, List that) => - wasmModule.wire_NodeBase_event_handled(port_, that); + void wire_ldk_node_event_handled(NativePortType port_, List that) => + wasmModule.wire_ldk_node_event_handled(port_, that); - void wire_NodeBase_list_balances(NativePortType port_, List that) => - wasmModule.wire_NodeBase_list_balances(port_, that); + void wire_ldk_node_is_running(NativePortType port_, List that) => + wasmModule.wire_ldk_node_is_running(port_, that); - void wire_NodeBase_list_channels(NativePortType port_, List that) => - wasmModule.wire_NodeBase_list_channels(port_, that); + void wire_ldk_node_list_channels(NativePortType port_, List that) => + wasmModule.wire_ldk_node_list_channels(port_, that); - void wire_NodeBase_list_payments(NativePortType port_, List that) => - wasmModule.wire_NodeBase_list_payments(port_, that); + void wire_ldk_node_list_payments(NativePortType port_, List that) => + wasmModule.wire_ldk_node_list_payments(port_, that); - void wire_NodeBase_list_payments_with_filter( + void wire_ldk_node_list_payments_with_filter( NativePortType port_, List that, int payment_direction) => - wasmModule.wire_NodeBase_list_payments_with_filter( + wasmModule.wire_ldk_node_list_payments_with_filter( port_, that, payment_direction); - void wire_NodeBase_list_peers(NativePortType port_, List that) => - wasmModule.wire_NodeBase_list_peers(port_, that); + void wire_ldk_node_list_peers(NativePortType port_, List that) => + wasmModule.wire_ldk_node_list_peers(port_, that); - void wire_NodeBase_listening_addresses( + void wire_ldk_node_listening_addresses( NativePortType port_, List that) => - wasmModule.wire_NodeBase_listening_addresses(port_, that); + wasmModule.wire_ldk_node_listening_addresses(port_, that); - void wire_NodeBase_new_onchain_address( + void wire_ldk_node_new_onchain_address( NativePortType port_, List that) => - wasmModule.wire_NodeBase_new_onchain_address(port_, that); + wasmModule.wire_ldk_node_new_onchain_address(port_, that); - void wire_NodeBase_next_event(NativePortType port_, List that) => - wasmModule.wire_NodeBase_next_event(port_, that); + void wire_ldk_node_next_event(NativePortType port_, List that) => + wasmModule.wire_ldk_node_next_event(port_, that); - void wire_NodeBase_next_event_async( - NativePortType port_, List that) => - wasmModule.wire_NodeBase_next_event_async(port_, that); + void wire_ldk_node_node_id(NativePortType port_, List that) => + wasmModule.wire_ldk_node_node_id(port_, that); - void wire_NodeBase_node_id(NativePortType port_, List that) => - wasmModule.wire_NodeBase_node_id(port_, that); - - void wire_NodeBase_payment(NativePortType port_, List that, + void wire_ldk_node_payment(NativePortType port_, List that, List payment_hash) => - wasmModule.wire_NodeBase_payment(port_, that, payment_hash); + wasmModule.wire_ldk_node_payment(port_, that, payment_hash); - void wire_NodeBase_receive_payment(NativePortType port_, List that, + void wire_ldk_node_receive_payment(NativePortType port_, List that, Object amount_msat, String description, int expiry_secs) => - wasmModule.wire_NodeBase_receive_payment( + wasmModule.wire_ldk_node_receive_payment( port_, that, amount_msat, description, expiry_secs); - void wire_NodeBase_receive_payment_via_jit_channel( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs, - Object? max_total_lsp_fee_limit_msat) => - wasmModule.wire_NodeBase_receive_payment_via_jit_channel(port_, that, - amount_msat, description, expiry_secs, max_total_lsp_fee_limit_msat); - - void wire_NodeBase_receive_variable_amount_payment(NativePortType port_, + void wire_ldk_node_receive_variable_amount_payment(NativePortType port_, List that, String description, int expiry_secs) => - wasmModule.wire_NodeBase_receive_variable_amount_payment( + wasmModule.wire_ldk_node_receive_variable_amount_payment( port_, that, description, expiry_secs); - void wire_NodeBase_receive_variable_amount_payment_via_jit_channel( - NativePortType port_, - List that, - String description, - int expiry_secs, - Object? max_proportional_lsp_fee_limit_ppm_msat) => - wasmModule.wire_NodeBase_receive_variable_amount_payment_via_jit_channel( - port_, - that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat); - - void wire_NodeBase_remove_payment(NativePortType port_, List that, + void wire_ldk_node_remove_payment(NativePortType port_, List that, List payment_hash) => - wasmModule.wire_NodeBase_remove_payment(port_, that, payment_hash); + wasmModule.wire_ldk_node_remove_payment(port_, that, payment_hash); - void wire_NodeBase_send_all_to_onchain_address( + void wire_ldk_node_send_all_to_onchain_address( NativePortType port_, List that, List address) => - wasmModule.wire_NodeBase_send_all_to_onchain_address( + wasmModule.wire_ldk_node_send_all_to_onchain_address( port_, that, address); - void wire_NodeBase_send_payment( + void wire_ldk_node_send_payment( NativePortType port_, List that, List invoice) => - wasmModule.wire_NodeBase_send_payment(port_, that, invoice); + wasmModule.wire_ldk_node_send_payment(port_, that, invoice); - void wire_NodeBase_send_payment_probes( + void wire_ldk_node_send_payment_probes( NativePortType port_, List that, List invoice) => - wasmModule.wire_NodeBase_send_payment_probes(port_, that, invoice); + wasmModule.wire_ldk_node_send_payment_probes(port_, that, invoice); - void wire_NodeBase_send_payment_probes_using_amount(NativePortType port_, + void wire_ldk_node_send_payment_probes_using_amount(NativePortType port_, List that, List invoice, Object amount_msat) => - wasmModule.wire_NodeBase_send_payment_probes_using_amount( + wasmModule.wire_ldk_node_send_payment_probes_using_amount( port_, that, invoice, amount_msat); - void wire_NodeBase_send_payment_using_amount(NativePortType port_, + void wire_ldk_node_send_payment_using_amount(NativePortType port_, List that, List invoice, Object amount_msat) => - wasmModule.wire_NodeBase_send_payment_using_amount( + wasmModule.wire_ldk_node_send_payment_using_amount( port_, that, invoice, amount_msat); - void wire_NodeBase_send_spontaneous_payment(NativePortType port_, + void wire_ldk_node_send_spontaneous_payment(NativePortType port_, List that, Object amount_msat, List node_id) => - wasmModule.wire_NodeBase_send_spontaneous_payment( + wasmModule.wire_ldk_node_send_spontaneous_payment( port_, that, amount_msat, node_id); - void wire_NodeBase_send_spontaneous_payment_probes(NativePortType port_, + void wire_ldk_node_send_spontaneous_payment_probes(NativePortType port_, List that, Object amount_msat, List node_id) => - wasmModule.wire_NodeBase_send_spontaneous_payment_probes( + wasmModule.wire_ldk_node_send_spontaneous_payment_probes( port_, that, amount_msat, node_id); - void wire_NodeBase_send_to_onchain_address(NativePortType port_, + void wire_ldk_node_send_to_onchain_address(NativePortType port_, List that, List address, Object amount_sats) => - wasmModule.wire_NodeBase_send_to_onchain_address( + wasmModule.wire_ldk_node_send_to_onchain_address( port_, that, address, amount_sats); - void wire_NodeBase_sign_message( + void wire_ldk_node_sign_message( NativePortType port_, List that, List msg) => - wasmModule.wire_NodeBase_sign_message(port_, that, msg); + wasmModule.wire_ldk_node_sign_message(port_, that, msg); + + void wire_ldk_node_spendable_onchain_balance_sats( + NativePortType port_, List that) => + wasmModule.wire_ldk_node_spendable_onchain_balance_sats(port_, that); - void wire_NodeBase_start(NativePortType port_, List that) => - wasmModule.wire_NodeBase_start(port_, that); + void wire_ldk_node_start(NativePortType port_, List that) => + wasmModule.wire_ldk_node_start(port_, that); - void wire_NodeBase_status(NativePortType port_, List that) => - wasmModule.wire_NodeBase_status(port_, that); + void wire_ldk_node_stop(NativePortType port_, List that) => + wasmModule.wire_ldk_node_stop(port_, that); - void wire_NodeBase_stop(NativePortType port_, List that) => - wasmModule.wire_NodeBase_stop(port_, that); + void wire_ldk_node_sync_wallets(NativePortType port_, List that) => + wasmModule.wire_ldk_node_sync_wallets(port_, that); - void wire_NodeBase_sync_wallets(NativePortType port_, List that) => - wasmModule.wire_NodeBase_sync_wallets(port_, that); + void wire_ldk_node_total_onchain_balance_sats( + NativePortType port_, List that) => + wasmModule.wire_ldk_node_total_onchain_balance_sats(port_, that); - void wire_NodeBase_update_channel_config( + void wire_ldk_node_update_channel_config( NativePortType port_, List that, - List user_channel_id, + List channel_id, List counterparty_node_id, List channel_config) => - wasmModule.wire_NodeBase_update_channel_config( - port_, that, user_channel_id, counterparty_node_id, channel_config); + wasmModule.wire_ldk_node_update_channel_config( + port_, that, channel_id, counterparty_node_id, channel_config); - void wire_NodeBase_verify_signature(NativePortType port_, List that, + void wire_ldk_node_verify_signature(NativePortType port_, List that, List msg, String sig, List pkey) => - wasmModule.wire_NodeBase_verify_signature(port_, that, msg, sig, pkey); + wasmModule.wire_ldk_node_verify_signature(port_, that, msg, sig, pkey); - void wire_NodeBase_wait_next_event( + void wire_ldk_node_wait_next_event( NativePortType port_, List that) => - wasmModule.wire_NodeBase_wait_next_event(port_, that); + wasmModule.wire_ldk_node_wait_next_event(port_, that); - void wire_finalize_builder( - NativePortType port_, - List config, - List? chain_data_source_config, - List? entropy_source_config, - List? gossip_source_config, - List? liquidity_source_config) => - wasmModule.wire_finalize_builder(port_, config, chain_data_source_config, - entropy_source_config, gossip_source_config, liquidity_source_config); + void wire_socket_address_as_string( + NativePortType port_, List that) => + wasmModule.wire_socket_address_as_string(port_, that); + + void wire_socket_address_from_str(NativePortType port_, String address) => + wasmModule.wire_socket_address_from_str(port_, address); void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( dynamic ptr) => @@ -2284,160 +1694,149 @@ class LdkCoreWasmModule implements WasmModule { @override external LdkCoreWasmModule bind(dynamic thisArg, String moduleName); - external void wire_MnemonicBase_generate(NativePortType port_); + external void wire_build_with_sqlite_store( + NativePortType port_, + List config, + List? chain_data_source_config, + List? entropy_source_config, + List? gossip_source_config); + + external void wire_ldk_mnemonic_generate(NativePortType port_); - external void wire_NodeBase_close_channel( + external void wire_ldk_node_close_channel( NativePortType port_, List that, - List user_channel_id, + List channel_id, List counterparty_node_id); - external void wire_NodeBase_config(NativePortType port_, List that); - - external void wire_NodeBase_connect(NativePortType port_, List that, + external void wire_ldk_node_connect(NativePortType port_, List that, List node_id, List address, bool persist); - external void wire_NodeBase_connect_open_channel( + external void wire_ldk_node_connect_open_channel( NativePortType port_, List that, - List address, + List socket_address, List node_id, Object channel_amount_sats, Object? push_to_counterparty_msat, bool announce_channel, List? channel_config); - external void wire_NodeBase_disconnect(NativePortType port_, + external void wire_ldk_node_disconnect(NativePortType port_, List that, List counterparty_node_id); - external void wire_NodeBase_event_handled( + external void wire_ldk_node_event_handled( NativePortType port_, List that); - external void wire_NodeBase_list_balances( + external void wire_ldk_node_is_running( NativePortType port_, List that); - external void wire_NodeBase_list_channels( + external void wire_ldk_node_list_channels( NativePortType port_, List that); - external void wire_NodeBase_list_payments( + external void wire_ldk_node_list_payments( NativePortType port_, List that); - external void wire_NodeBase_list_payments_with_filter( + external void wire_ldk_node_list_payments_with_filter( NativePortType port_, List that, int payment_direction); - external void wire_NodeBase_list_peers( - NativePortType port_, List that); - - external void wire_NodeBase_listening_addresses( + external void wire_ldk_node_list_peers( NativePortType port_, List that); - external void wire_NodeBase_new_onchain_address( + external void wire_ldk_node_listening_addresses( NativePortType port_, List that); - external void wire_NodeBase_next_event( + external void wire_ldk_node_new_onchain_address( NativePortType port_, List that); - external void wire_NodeBase_next_event_async( + external void wire_ldk_node_next_event( NativePortType port_, List that); - external void wire_NodeBase_node_id(NativePortType port_, List that); + external void wire_ldk_node_node_id(NativePortType port_, List that); - external void wire_NodeBase_payment( + external void wire_ldk_node_payment( NativePortType port_, List that, List payment_hash); - external void wire_NodeBase_receive_payment( + external void wire_ldk_node_receive_payment( NativePortType port_, List that, Object amount_msat, String description, int expiry_secs); - external void wire_NodeBase_receive_payment_via_jit_channel( - NativePortType port_, - List that, - Object amount_msat, - String description, - int expiry_secs, - Object? max_total_lsp_fee_limit_msat); - - external void wire_NodeBase_receive_variable_amount_payment( + external void wire_ldk_node_receive_variable_amount_payment( NativePortType port_, List that, String description, int expiry_secs); - external void wire_NodeBase_receive_variable_amount_payment_via_jit_channel( - NativePortType port_, - List that, - String description, - int expiry_secs, - Object? max_proportional_lsp_fee_limit_ppm_msat); - - external void wire_NodeBase_remove_payment( + external void wire_ldk_node_remove_payment( NativePortType port_, List that, List payment_hash); - external void wire_NodeBase_send_all_to_onchain_address( + external void wire_ldk_node_send_all_to_onchain_address( NativePortType port_, List that, List address); - external void wire_NodeBase_send_payment( + external void wire_ldk_node_send_payment( NativePortType port_, List that, List invoice); - external void wire_NodeBase_send_payment_probes( + external void wire_ldk_node_send_payment_probes( NativePortType port_, List that, List invoice); - external void wire_NodeBase_send_payment_probes_using_amount( + external void wire_ldk_node_send_payment_probes_using_amount( NativePortType port_, List that, List invoice, Object amount_msat); - external void wire_NodeBase_send_payment_using_amount(NativePortType port_, + external void wire_ldk_node_send_payment_using_amount(NativePortType port_, List that, List invoice, Object amount_msat); - external void wire_NodeBase_send_spontaneous_payment(NativePortType port_, + external void wire_ldk_node_send_spontaneous_payment(NativePortType port_, List that, Object amount_msat, List node_id); - external void wire_NodeBase_send_spontaneous_payment_probes( + external void wire_ldk_node_send_spontaneous_payment_probes( NativePortType port_, List that, Object amount_msat, List node_id); - external void wire_NodeBase_send_to_onchain_address(NativePortType port_, + external void wire_ldk_node_send_to_onchain_address(NativePortType port_, List that, List address, Object amount_sats); - external void wire_NodeBase_sign_message( + external void wire_ldk_node_sign_message( NativePortType port_, List that, List msg); - external void wire_NodeBase_start(NativePortType port_, List that); + external void wire_ldk_node_spendable_onchain_balance_sats( + NativePortType port_, List that); + + external void wire_ldk_node_start(NativePortType port_, List that); - external void wire_NodeBase_status(NativePortType port_, List that); + external void wire_ldk_node_stop(NativePortType port_, List that); - external void wire_NodeBase_stop(NativePortType port_, List that); + external void wire_ldk_node_sync_wallets( + NativePortType port_, List that); - external void wire_NodeBase_sync_wallets( + external void wire_ldk_node_total_onchain_balance_sats( NativePortType port_, List that); - external void wire_NodeBase_update_channel_config( + external void wire_ldk_node_update_channel_config( NativePortType port_, List that, - List user_channel_id, + List channel_id, List counterparty_node_id, List channel_config); - external void wire_NodeBase_verify_signature(NativePortType port_, + external void wire_ldk_node_verify_signature(NativePortType port_, List that, List msg, String sig, List pkey); - external void wire_NodeBase_wait_next_event( + external void wire_ldk_node_wait_next_event( NativePortType port_, List that); - external void wire_finalize_builder( - NativePortType port_, - List config, - List? chain_data_source_config, - List? entropy_source_config, - List? gossip_source_config, - List? liquidity_source_config); + external void wire_socket_address_as_string( + NativePortType port_, List that); + + external void wire_socket_address_from_str( + NativePortType port_, String address); external void rust_arc_increment_strong_count_RustOpaque_NodeSqliteStore( dynamic ptr); diff --git a/lib/src/root.dart b/lib/src/root.dart index 405d586..c14452c 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -8,12 +8,16 @@ import 'generated/api/node.dart'; ///The from string implementation will try to determine the language of the mnemonic from all the supported languages. (Languages have to be explicitly enabled using the Cargo features.) /// Supported number of words are 12, 15, 18, 21, and 24. /// -class Mnemonic extends MnemonicBase { +class Mnemonic extends LdkMnemonic { Mnemonic({required super.seedPhrase}); static Future generate() async { - await Frb.verifyInit(); - final res = await MnemonicBase.generate(); - return Mnemonic(seedPhrase: res.seedPhrase); + try { + await Frb.verifyInit(); + final res = await LdkMnemonic.generate(); + return Mnemonic(seedPhrase: res.seedPhrase); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } } } @@ -21,7 +25,7 @@ class Mnemonic extends MnemonicBase { /// ///Needs to be initialized and instantiated through builder.build(). /// -class Node extends NodeBase { +class Node extends LdkNode { Node._({required super.ptr}); /// Starts the necessary background tasks, such as handling events coming from user input, @@ -33,8 +37,8 @@ class Node extends NodeBase { Future start({hint}) async { try { return super.start(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -46,8 +50,8 @@ class Node extends NodeBase { Future stop({hint}) async { try { await super.stop(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -58,8 +62,8 @@ class Node extends NodeBase { Future eventHandled({hint}) async { try { await super.eventHandled(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -70,8 +74,8 @@ class Node extends NodeBase { Future nextEvent({hint}) async { try { return await super.nextEvent(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -84,8 +88,8 @@ class Node extends NodeBase { Future waitNextHandled({hint}) async { try { return await super.waitNextEvent(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -94,8 +98,8 @@ class Node extends NodeBase { Future nodeId({hint}) async { try { return await super.nodeId(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -104,49 +108,38 @@ class Node extends NodeBase { Future?> listeningAddresses({hint}) async { try { return await super.listeningAddresses(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } - /// Retrieve the currently spendable on-chain balance in satoshis. + /// Retrieve a new on-chain/funding address. @override - Future listBalances({hint}) { + Future newOnchainAddress({hint}) async { try { - return super.listBalances(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + return await super.newOnchainAddress(); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } - ///Returns the status of the Node. - @override - Future status({hint}) { - return super.status(); - } - - ///Returns the config with which the Node was initialized. - @override - Future config({hint}) { - return super.config(); - } - - ///Returns the next event in the event queue. - /// Will asynchronously poll the event queue until the next event is ready. - /// **Note:** this will always return the same event until handling is confirmed via `node.eventHandled()`. - + /// Retrieve the currently spendable on-chain balance in satoshis. @override - Future nextEventAsync({hint}) { - return super.nextEventAsync(); + Future spendableOnchainBalanceSats({hint}) async { + try { + return await super.spendableOnchainBalanceSats(); + } on error.NodeException catch (e) { + throw mapNodeException(e); + } } - /// Retrieve a new on-chain/funding address. + /// Retrieve the current total on-chain balance in satoshis. @override - Future newOnchainAddress({hint}) async { + Future totalOnchainBalanceSats({hint}) async { try { - return await super.newOnchainAddress(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + return await super.totalOnchainBalanceSats(); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -157,8 +150,8 @@ class Node extends NodeBase { try { return await super .sendToOnchainAddress(address: address, amountSats: amountSats); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -168,8 +161,8 @@ class Node extends NodeBase { {required types.Address address, hint}) async { try { return await super.sendAllToOnchainAddress(address: address); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -178,8 +171,8 @@ class Node extends NodeBase { Future> listChannels({hint}) async { try { return await super.listChannels(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -195,8 +188,8 @@ class Node extends NodeBase { try { return await super .connect(address: address, nodeId: nodeId, persist: persist); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -211,8 +204,8 @@ class Node extends NodeBase { await super.disconnect( counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -226,8 +219,8 @@ class Node extends NodeBase { /// /// Returns a temporary channel id. @override - Future connectOpenChannel( - {required types.SocketAddress address, + Future connectOpenChannel( + {required types.SocketAddress socketAddress, required types.PublicKey nodeId, required int channelAmountSats, required bool announceChannel, @@ -235,15 +228,15 @@ class Node extends NodeBase { int? pushToCounterpartyMsat, hint}) async { try { - return await super.connectOpenChannel( - address: address, + await super.connectOpenChannel( + socketAddress: socketAddress, nodeId: nodeId, pushToCounterpartyMsat: pushToCounterpartyMsat, channelAmountSats: channelAmountSats, channelConfig: channelConfig, announceChannel: announceChannel); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -253,8 +246,8 @@ class Node extends NodeBase { Future syncWallets({hint}) async { try { await super.syncWallets(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -262,15 +255,15 @@ class Node extends NodeBase { @override Future closeChannel( {required types.PublicKey counterpartyNodeId, - required types.UserChannelId userChannelId, + required types.ChannelId channelId, hint}) async { try { await super.closeChannel( - userChannelId: userChannelId, + channelId: channelId, counterpartyNodeId: counterpartyNodeId, ); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -279,17 +272,17 @@ class Node extends NodeBase { @override Future updateChannelConfig( {required types.PublicKey counterpartyNodeId, - required types.UserChannelId userChannelId, + required types.ChannelId channelId, required types.ChannelConfig channelConfig, hint}) async { try { await super.updateChannelConfig( - userChannelId: userChannelId, + channelId: channelId, counterpartyNodeId: counterpartyNodeId, channelConfig: channelConfig, ); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -299,8 +292,8 @@ class Node extends NodeBase { {required types.Bolt11Invoice invoice, hint}) async { try { return await super.sendPayment(invoice: invoice); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -318,8 +311,8 @@ class Node extends NodeBase { try { return await super .sendPaymentUsingAmount(invoice: invoice, amountMsat: amountMsat); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -330,8 +323,8 @@ class Node extends NodeBase { try { return await super .sendSpontaneousPayment(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -342,8 +335,8 @@ class Node extends NodeBase { try { return await super .sendSpontaneousPaymentProbes(amountMsat: amountMsat, nodeId: nodeId); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -366,8 +359,8 @@ class Node extends NodeBase { {required types.Bolt11Invoice invoice, hint}) async { try { return await super.sendPaymentProbes(invoice: invoice); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -379,8 +372,8 @@ class Node extends NodeBase { try { return await super.sendPaymentProbesUsingAmount( invoice: invoice, amountMsat: amountMsat); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -397,8 +390,8 @@ class Node extends NodeBase { amountMsat: amountMsat, description: description, expirySecs: expirySecs); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -410,48 +403,8 @@ class Node extends NodeBase { try { return await super.receiveVariableAmountPayment( description: description, expirySecs: expirySecs); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); - } - } - - ///Returns a payable invoice that can be used to request a variable amount payment (also known as "zero-amount" invoice) and receive it via a newly created just-in-time (JIT) channel. - /// When the returned invoice is paid, the configured LSPS2 -compliant LSP will open a channel to us, supplying just-in-time inbound liquidity. - /// If set, maxProportionalLspFeeLimitPpmMsat will limit how much proportional fee, in parts-per-million millisatoshis, we allow the LSP to take for opening the channel to us. We'll use its cheapest offer otherwise. - @override - Future receiveVariableAmountPaymentViaJitChannel( - {required String description, - required int expirySecs, - int? maxProportionalLspFeeLimitPpmMsat, - hint}) { - try { - return super.receiveVariableAmountPaymentViaJitChannel( - description: description, - expirySecs: expirySecs, - maxProportionalLspFeeLimitPpmMsat: maxProportionalLspFeeLimitPpmMsat); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); - } - } - - ///Returns a payable invoice that can be used to request a payment of the amount given and receive it via a newly created just-in-time (JIT) channel. - /// When the returned invoice is paid, the configured LSPS2 -compliant LSP will open a channel to us, supplying just-in-time inbound liquidity. - /// If set, maxTotalLspFeeLimitPpmMsat will limit how much fee we allow the LSP to take for opening the channel to us. We'll use its cheapest offer otherwise. - @override - Future receivePaymentViaJitChannel( - {required int amountMsat, - required String description, - required int expirySecs, - int? maxTotalLspFeeLimitMsat, - hint}) { - try { - return super.receivePaymentViaJitChannel( - amountMsat: amountMsat, - description: description, - expirySecs: expirySecs, - maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -463,8 +416,8 @@ class Node extends NodeBase { {required types.PaymentHash paymentHash, hint}) async { try { return await super.payment(paymentHash: paymentHash); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -474,8 +427,8 @@ class Node extends NodeBase { {required types.PaymentHash paymentHash, hint}) async { try { return await super.removePayment(paymentHash: paymentHash); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -486,8 +439,8 @@ class Node extends NodeBase { try { return await super .listPaymentsWithFilter(paymentDirection: paymentDirection); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -496,8 +449,8 @@ class Node extends NodeBase { Future> listPayments({hint}) async { try { return super.listPayments(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -506,8 +459,8 @@ class Node extends NodeBase { Future> listPeers({hint}) async { try { return await super.listPeers(); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -521,8 +474,8 @@ class Node extends NodeBase { Future signMessage({required List msg, hint}) async { try { return await super.signMessage(msg: msg); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } @@ -536,8 +489,8 @@ class Node extends NodeBase { hint}) async { try { return await super.verifySignature(msg: msg, sig: sig, pkey: pkey); - } on error.NodeBaseError catch (e) { - throw mapNodeBaseError(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } } @@ -555,7 +508,6 @@ class Builder { types.EntropySourceConfig? _entropySource; types.ChainDataSourceConfig? _chainDataSourceConfig; types.GossipSourceConfig? _gossipSourceConfig; - types.LiquiditySourceConfig? _liquiditySourceConfig; /// Creates a new builder instance from an [Config]. /// @@ -658,22 +610,6 @@ class Builder { return this; } - /// Configures the [Node] instance to source its inbound liquidity from the given - /// [LSPS2](https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md) - /// service. - /// - /// Will mark the LSP as trusted for 0-confirmation channels, see `config.trustedPeers0conf`. - /// - /// The given `token` will be used by the LSP to authenticate the user. - Builder setLiquiditySourceLsps2( - {required types.SocketAddress address, - required types.PublicKey publicKey, - String? token}) { - _liquiditySourceConfig = - types.LiquiditySourceConfig(lsps2Service: (address, publicKey, token)); - return this; - } - /// Builds a [Node] instance with a SqliteStore backend and according to the options /// previously configured. /// @@ -686,15 +622,17 @@ class Builder { final nodePath = "${directory.path}/ldk_cache/"; _config!.storageDirPath = nodePath; } - final res = await finalizeBuilder( - config: _config!, - entropySourceConfig: _entropySource, - chainDataSourceConfig: _chainDataSourceConfig, - gossipSourceConfig: _gossipSourceConfig, - liquiditySourceConfig: _liquiditySourceConfig); + final res = await buildWithSqliteStore( + config: _config!, + entropySourceConfig: _entropySource, + chainDataSourceConfig: _chainDataSourceConfig, + gossipSourceConfig: _gossipSourceConfig, + ); return Node._(ptr: res.ptr); - } on error.BuilderError catch (e) { - throw mapBuilderError(e); + } on error.BuilderException catch (e) { + throw mapBuilderException(e); + } on error.NodeException catch (e) { + throw mapNodeException(e); } } } diff --git a/lib/src/utils/exceptions.dart b/lib/src/utils/exceptions.dart index 1d56eae..7e681b9 100644 --- a/lib/src/utils/exceptions.dart +++ b/lib/src/utils/exceptions.dart @@ -1,134 +1,127 @@ import '../generated/api/error.dart' as bridge; -abstract class ExceptionBase implements Exception { +abstract class LdkException implements Exception { String? message; - ExceptionBase({this.message}); + LdkException({this.message}); @override String toString() => (message != null) ? '$runtimeType( $message )' : runtimeType.toString(); } /// Returned when trying to start [Node] while it is already running. -class NodeException extends ExceptionBase { +class NodeException extends LdkException { NodeException({super.message}); } -class BuilderException extends ExceptionBase { +class BuilderException extends LdkException { BuilderException({super.message}); } -BuilderException mapBuilderError(bridge.BuilderError e) { +BuilderException mapBuilderException(bridge.BuilderException e) { switch (e) { - case bridge.BuilderError.invalidSeedBytes: + case bridge.BuilderException.invalidSeedBytes: return BuilderException(message: "Given seed bytes are invalid."); - case bridge.BuilderError.invalidSeedFile: + case bridge.BuilderException.invalidSeedFile: return BuilderException( message: "Given seed file is invalid or could not be read."); - case bridge.BuilderError.invalidSystemTime: + case bridge.BuilderException.invalidSystemTime: return BuilderException( message: "System time is invalid. Clocks might have gone back in time."); - case bridge.BuilderError.readFailed: + case bridge.BuilderException.readFailed: return BuilderException(message: "Failed to read from store."); - case bridge.BuilderError.writeFailed: + case bridge.BuilderException.writeFailed: return BuilderException(message: "Failed to write to store."); - case bridge.BuilderError.storagePathAccessFailed: + case bridge.BuilderException.storagePathAccessFailed: return BuilderException( message: "Failed to access the given storage path."); - case bridge.BuilderError.walletSetupFailed: + case bridge.BuilderException.walletSetupFailed: return BuilderException(message: "Failed to setup onchain wallet."); - case bridge.BuilderError.loggerSetupFailed: + case bridge.BuilderException.loggerSetupFailed: return BuilderException(message: "Failed to setup the logger."); - - case bridge.BuilderError.invalidChannelMonitor: + case bridge.BuilderException.invalidChannelMonitor: return BuilderException( message: "Failed to watch a deserialized ChannelMonitor."); - case bridge.BuilderError.invalidListeningAddresses: + case bridge.BuilderException.invalidListeningAddress: return BuilderException( message: "Given listening addresses are invalid."); - case bridge.BuilderError.kvStoreSetupFailed: + case bridge.BuilderException.kvStoreSetupFailed: return BuilderException(message: "Failed to setup KVStore."); - case bridge.BuilderError.socketAddressParseError: - return BuilderException(message: "Invalid SocketAddress."); + case bridge.BuilderException.socketAddressParseError: + return BuilderException(message: "Failed to parse socket address"); + case bridge.BuilderException.invalidTrustedPeer: + return BuilderException(message: "Invalid trusted peer"); } } -NodeException mapNodeBaseError(bridge.NodeBaseError e) { +NodeException mapNodeException(bridge.NodeException e) { switch (e) { - case bridge.NodeBaseError.alreadyRunning: + case bridge.NodeException.alreadyRunning: return NodeException(message: "Node is already running."); - case bridge.NodeBaseError.notRunning: + case bridge.NodeException.notRunning: return NodeException(message: "Node is not running."); - case bridge.NodeBaseError.onchainTxCreationFailed: + case bridge.NodeException.onchainTxCreationFailed: return NodeException( message: "On-chain transaction could not be created."); - case bridge.NodeBaseError.connectionFailed: + case bridge.NodeException.connectionFailed: return NodeException(message: "Network connection closed."); - case bridge.NodeBaseError.paymentSendingFailed: + case bridge.NodeException.paymentSendingFailed: return NodeException(message: "Failed to send the given payment."); - case bridge.NodeBaseError.probeSendingFailed: + case bridge.NodeException.probeSendingFailed: return NodeException(message: "Failed to send the given payment probe."); - case bridge.NodeBaseError.channelCreationFailed: + case bridge.NodeException.channelCreationFailed: return NodeException(message: "Failed to create channel."); - case bridge.NodeBaseError.channelClosingFailed: + case bridge.NodeException.channelClosingFailed: return NodeException(message: "Failed to close channel."); - case bridge.NodeBaseError.channelConfigUpdateFailed: + case bridge.NodeException.channelConfigUpdateFailed: return NodeException(message: "Failed to update channel config."); - case bridge.NodeBaseError.persistenceFailed: + case bridge.NodeException.persistenceFailed: return NodeException(message: "Failed to persist data."); - case bridge.NodeBaseError.walletOperationFailed: + case bridge.NodeException.walletOperationFailed: return NodeException(message: "Failed to conduct wallet operation."); - case bridge.NodeBaseError.onchainTxSigningFailed: + case bridge.NodeException.onchainTxSigningFailed: return NodeException(message: "Failed to sign given transaction."); - case bridge.NodeBaseError.messageSigningFailed: + case bridge.NodeException.messageSigningFailed: return NodeException(message: "Failed to sign given message."); - case bridge.NodeBaseError.txSyncFailed: + case bridge.NodeException.txSyncFailed: return NodeException(message: "Failed to sync transactions."); - case bridge.NodeBaseError.gossipUpdateFailed: + case bridge.NodeException.gossipUpdateFailed: return NodeException(message: "Failed to update gossip data."); - case bridge.NodeBaseError.invalidAddress: + case bridge.NodeException.invalidAddress: return NodeException(message: "The given address is invalid."); - case bridge.NodeBaseError.invalidSocketAddress: + case bridge.NodeException.invalidSocketAddress: return NodeException(message: "The given network address is invalid."); - case bridge.NodeBaseError.invalidPublicKey: + case bridge.NodeException.invalidPublicKey: return NodeException(message: "The given public key is invalid."); - case bridge.NodeBaseError.invalidSecretKey: + case bridge.NodeException.invalidSecretKey: return NodeException(message: "The given secret key is invalid."); - case bridge.NodeBaseError.invalidPaymentHash: + case bridge.NodeException.invalidPaymentHash: return NodeException(message: "The given payment hash is invalid."); - case bridge.NodeBaseError.invalidPaymentPreimage: + case bridge.NodeException.invalidPaymentPreimage: return NodeException(message: "The given payment preimage is invalid."); - case bridge.NodeBaseError.invalidPaymentSecret: + case bridge.NodeException.invalidPaymentSecret: return NodeException(message: "The given payment secret is invalid."); - case bridge.NodeBaseError.invalidAmount: + case bridge.NodeException.invalidAmount: return NodeException(message: "The given amount is invalid."); - case bridge.NodeBaseError.invalidInvoice: + case bridge.NodeException.invalidInvoice: return NodeException(message: "The given invoice is invalid."); - case bridge.NodeBaseError.invalidChannelId: + case bridge.NodeException.invalidChannelId: return NodeException(message: "The given channel ID is invalid."); - case bridge.NodeBaseError.invoiceCreationFailed: + case bridge.NodeException.invoiceCreationFailed: return NodeException(message: "Failed to create invoice."); - case bridge.NodeBaseError.invalidNetwork: + case bridge.NodeException.invalidNetwork: return NodeException(message: "The given network is invalid."); - case bridge.NodeBaseError.duplicatePayment: + case bridge.NodeException.duplicatePayment: return NodeException( message: "A payment with the given hash has already been initiated."); - case bridge.NodeBaseError.insufficientFunds: + case bridge.NodeException.insufficientFunds: return NodeException( message: "There are insufficient funds to complete the given operation."); - case bridge.NodeBaseError.feerateEstimationUpdateFailed: + case bridge.NodeException.feerateEstimationUpdateFailed: return NodeException(message: "Failed to update fee rate estimation. "); - case bridge.NodeBaseError.liquidityRequestFailed: - return NodeException(message: "Liquidity request operation failed. "); - case bridge.NodeBaseError.liquiditySourceUnavailable: - return NodeException( - message: - "Liquidity operation failed due to the required liquidity source being unavailable. "); - case bridge.NodeBaseError.liquidityFeeTooHigh: - return NodeException( - message: - "Liquidity operation failed due to the LSP's required opening fee being too high. "); + case bridge.NodeException.invalidTxid: + return NodeException(message: "Invalid transaction id"); } } diff --git a/makefile b/makefile index ad60a8f..5a42da9 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ help: makefile ## init: Install missing dependencies. init: - cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.28' + cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.31 ## : all: init generate-bindings diff --git a/pubspec.yaml b/pubspec.yaml index 6ef3fb0..0195250 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: ffi: ^2.1.0 flutter: sdk: flutter - flutter_rust_bridge: ">2.0.0-dev.25 <= 2.0.0-dev.28" + flutter_rust_bridge: ">2.0.0-dev.30 <= 2.0.0-dev.31" freezed_annotation: ^2.2.0 meta: ^1.10.0 uuid: ^4.3.3 diff --git a/rust/Cargo.lock b/rust/Cargo.lock index e257a7e..3d2870b 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.8" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom", "once_cell", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "once_cell", @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -99,72 +99,21 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" - -[[package]] -name = "anstyle-parse" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" -dependencies = [ - "backtrace", -] +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", ] [[package]] @@ -173,28 +122,17 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -223,7 +161,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fc1fc1a92e0943bfbcd6eb7d32c1b2a79f2f1357eb1e2eee9d7f36d6d7ca44a" dependencies = [ - "ahash 0.7.8", + "ahash 0.7.7", "async-trait", "bdk-macros", "bip39", @@ -320,9 +258,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "build-target" @@ -332,15 +270,15 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" [[package]] name = "byteorder" @@ -350,75 +288,19 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - -[[package]] -name = "cargo_toml" -version = "0.18.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802b755090e39835a4b0440fb0bbee0df7495a8b337f63db21e616f7821c7e8c" -dependencies = [ - "serde", - "toml 0.8.12", -] +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] -name = "cbindgen" -version = "0.24.5" +name = "cc" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b922faaf31122819ec80c4047cc684c6979a087366c069611e33649bf98e18d" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "heck 0.4.1", - "indexmap 1.9.3", - "log", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 1.0.109", - "tempfile", - "toml 0.5.11", + "libc", ] -[[package]] -name = "cc" -version = "1.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" - [[package]] name = "cfg-if" version = "1.0.0" @@ -427,87 +309,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", - "js-sys", "num-traits", - "serde", - "wasm-bindgen", - "windows-targets 0.52.4", -] - -[[package]] -name = "clap" -version = "4.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "clap_lex" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "colored" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" -dependencies = [ - "is-terminal", - "lazy_static", - "winapi", -] - -[[package]] -name = "console" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.52.0", + "windows-targets 0.52.0", ] [[package]] @@ -520,12 +329,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "convert_case" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" - [[package]] name = "core-foundation" version = "0.9.4" @@ -542,21 +345,6 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "crossbeam-channel" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - [[package]] name = "dart-sys-fork" version = "4.1.1" @@ -576,19 +364,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.3", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "delegate-attr" version = "0.3.0" @@ -597,7 +372,7 @@ checksum = "51aac4c99b2e6775164b412ea33ae8441b2fde2dbf05a20bc0052a63d08c475b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", ] [[package]] @@ -609,28 +384,11 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "either" -version = "1.10.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" @@ -641,38 +399,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-iterator" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "enum_dispatch" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" -dependencies = [ - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.55", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -726,32 +452,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" - -[[package]] -name = "fern" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" -dependencies = [ - "chrono", - "colored", - "log", -] - -[[package]] -name = "filetime" -version = "0.2.23" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "windows-sys 0.52.0", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fixedbitset" @@ -761,9 +464,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.28" +version = "2.0.0-dev.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0ad7ece8037d2e85f53413c5cc1e6b33b56ff63fc0a530c08eec7c4b8b3f26" +checksum = "9d9ceb6f8db0bf711a55e20151c6699132bb5975f846ecac2c3bc7d23cc0845d" dependencies = [ "allo-isolate", "android_logger", @@ -787,55 +490,16 @@ dependencies = [ ] [[package]] -name = "flutter_rust_bridge_codegen" -version = "2.0.0-dev.28" +name = "flutter_rust_bridge_macros" +version = "2.0.0-dev.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e7121d658626cf3921aa75de2cae9f77814b4317a1353e7be7c6be8d656cf01" +checksum = "e02edfe56f04af804d3145b17dfe7820d46a6753b214160f227dbdfa1073f7cb" dependencies = [ - "anyhow", - "atty", - "cargo_metadata", - "cargo_toml", - "cbindgen", - "chrono", - "clap", - "convert_case", - "derivative", - "enum-iterator", - "enum_dispatch", - "fern", - "glob", - "include_dir", - "indicatif", - "indicatif-log-bridge", - "itertools", - "lazy_static", - "log", - "notify", - "notify-debouncer-mini", - "paste", - "pathdiff", - "proc-macro2", + "hex", "quote", - "regex", - "serde", - "serde_json", - "serde_yaml", - "serial_test", - "strum", - "strum_macros", - "syn 2.0.55", - "tempfile", - "toml 0.5.11", - "topological-sort", + "syn 2.0.48", ] -[[package]] -name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5844c71d6ea7f6023838838e6d01aeeef41920abc8e628ca24bac19d09c8fea6" - [[package]] name = "fnv" version = "1.0.7" @@ -843,21 +507,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "percent-encoding", + "foreign-types-shared", ] [[package]] -name = "fsevent-sys" -version = "4.1.0" +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "libc", + "percent-encoding", ] [[package]] @@ -916,7 +586,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", ] [[package]] @@ -966,17 +636,11 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "h2" -version = "0.3.25" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -984,26 +648,20 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.6", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.7", "allocator-api2", ] @@ -1013,7 +671,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1022,26 +680,17 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] -name = "hermit-abi" -version = "0.3.9" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" @@ -1066,9 +715,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1136,11 +785,24 @@ dependencies = [ "tokio-rustls", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1169,95 +831,14 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "include_dir" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" -dependencies = [ - "include_dir_macros", -] - -[[package]] -name = "include_dir_macros" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" -dependencies = [ - "proc-macro2", - "quote", -] - [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", - "hashbrown 0.14.3", -] - -[[package]] -name = "indicatif" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - -[[package]] -name = "indicatif-log-bridge" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2963046f28a204e3e3fd7e754fd90a6235da05b5378f24707ff0ec9513725ce3" -dependencies = [ - "indicatif", - "log", -] - -[[package]] -name = "inotify" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", + "hashbrown", ] [[package]] @@ -1266,59 +847,28 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "itertools" version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", + "either", ] [[package]] -name = "kqueue" -version = "1.0.8" +name = "itoa" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" -dependencies = [ - "kqueue-sys", - "libc", -] +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] -name = "kqueue-sys" -version = "1.0.4" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "bitflags 1.3.2", - "libc", + "wasm-bindgen", ] [[package]] @@ -1329,8 +879,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "ldk-node" -version = "0.2.1" -source = "git+https://github.com/lightningdevkit/ldk-node.git?rev=71b1d3c5594b1901cb88b47defec4c6507fba6db#71b1d3c5594b1901cb88b47defec4c6507fba6db" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923588872d472775345535cdb87a123730c077b4acbb49f081bb4a91442b4a20" dependencies = [ "bdk", "bip39", @@ -1342,7 +893,6 @@ dependencies = [ "lightning", "lightning-background-processor", "lightning-invoice", - "lightning-liquidity", "lightning-net-tokio", "lightning-persister", "lightning-rapid-gossip-sync", @@ -1362,7 +912,6 @@ version = "0.2.2-dev" dependencies = [ "anyhow", "flutter_rust_bridge", - "flutter_rust_bridge_codegen", "ldk-node", "log", "simplelog", @@ -1370,9 +919,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libsqlite3-sys" @@ -1417,21 +966,6 @@ dependencies = [ "lightning", "num-traits", "secp256k1", - "serde", -] - -[[package]] -name = "lightning-liquidity" -version = "0.1.0-alpha.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9482742371d445c4ac0884eb263e60bccc06558db21e3ad5c03c16d73f1932f6" -dependencies = [ - "bitcoin", - "chrono", - "lightning", - "lightning-invoice", - "serde", - "serde_json", ] [[package]] @@ -1479,39 +1013,23 @@ dependencies = [ "lightning", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" -version = "0.4.21" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -1532,21 +1050,20 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log", "wasi", "windows-sys 0.48.0", ] @@ -1558,46 +1075,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] -name = "notify" -version = "6.1.1" +name = "native-tls" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ - "bitflags 2.5.0", - "crossbeam-channel", - "filetime", - "fsevent-sys", - "inotify", - "kqueue", + "lazy_static", "libc", "log", - "mio", - "walkdir", - "windows-sys 0.48.0", -] - -[[package]] -name = "notify-debouncer-mini" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d40b221972a1fc5ef4d858a2f671fb34c75983eb385463dff3780eeff6a9d43" -dependencies = [ - "crossbeam-channel", - "log", - "notify", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -1608,25 +1107,19 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] [[package]] name = "num_threads" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "object" version = "0.32.2" @@ -1643,50 +1136,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "oslog" -version = "0.1.0" +name = "openssl" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8343ce955f18e7e68c0207dd0ea776ec453035685395ababd2ea651c569728b3" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "cc", - "dashmap 4.0.2", - "log", + "bitflags 2.4.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", ] [[package]] -name = "parking_lot" -version = "0.12.1" +name = "openssl-macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "lock_api", - "parking_lot_core", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] -name = "parking_lot_core" -version = "0.9.9" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.48.5", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "paste" -version = "1.0.14" +name = "openssl-sys" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] -name = "pathdiff" -version = "0.2.1" +name = "oslog" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "8343ce955f18e7e68c0207dd0ea776ec453035685395ababd2ea651c569728b3" +dependencies = [ + "cc", + "dashmap", + "log", +] [[package]] name = "percent-encoding" @@ -1701,7 +1203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap", ] [[package]] @@ -1718,15 +1220,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "portable-atomic" -version = "1.6.0" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "powerfmt" @@ -1752,9 +1248,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1776,7 +1272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", - "heck 0.4.1", + "heck", "itertools", "lazy_static", "log", @@ -1863,9 +1359,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -1875,9 +1371,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -1886,15 +1382,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64 0.21.7", "bytes", @@ -1906,10 +1402,12 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -1918,9 +1416,9 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls", "tokio-socks", "tower-service", @@ -1934,17 +1432,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -1969,11 +1466,11 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -2011,33 +1508,21 @@ dependencies = [ "untrusted", ] -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] -name = "same-file" -version = "1.0.6" +name = "schannel" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "winapi-util", + "windows-sys 0.52.0", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "sct" version = "0.7.1" @@ -2070,54 +1555,59 @@ dependencies = [ ] [[package]] -name = "semver" -version = "1.0.22" +name = "security-framework" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "serde", + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "serde_spanned" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2130,48 +1620,11 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" -dependencies = [ - "indexmap 1.9.3", - "ryu", - "serde", - "yaml-rust", -] - -[[package]] -name = "serial_test" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" -dependencies = [ - "dashmap 5.5.3", - "futures", - "lazy_static", - "log", - "parking_lot", - "serial_test_derive", -] - -[[package]] -name = "serial_test_derive" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - [[package]] name = "simplelog" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" +checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" dependencies = [ "log", "termcolor", @@ -2189,18 +1642,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -2209,31 +1662,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "strsim" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - [[package]] name = "syn" version = "1.0.109" @@ -2247,21 +1675,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "system-configuration" version = "0.5.1" @@ -2285,43 +1707,44 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", + "redox_syscall", "rustix", "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.4.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", ] [[package]] @@ -2335,14 +1758,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", "libc", - "num-conv", "num_threads", "powerfmt", "serde", @@ -2358,11 +1780,10 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ - "num-conv", "time-core", ] @@ -2383,9 +1804,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -2406,7 +1827,17 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", ] [[package]] @@ -2445,55 +1876,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "topological-sort" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" - [[package]] name = "tower-service" version = "0.3.2" @@ -2546,12 +1928,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - [[package]] name = "untrusted" version = "0.9.0" @@ -2569,12 +1945,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "vcpkg" version = "0.2.15" @@ -2589,9 +1959,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vss-client" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62cbd331368125aeb93b67dd4a80826a4ee29a810d4c76d2c9d265c1522a3f2" +checksum = "d3d56cb3a4c815901ee46fcaac027ab1674232eb4f136a17e3b0576a4c77ded7" dependencies = [ "prost", "prost-build", @@ -2600,16 +1970,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "want" version = "0.3.1" @@ -2646,7 +2006,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -2680,7 +2040,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2693,9 +2053,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -2703,9 +2063,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "which" @@ -2756,7 +2116,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -2774,7 +2134,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -2794,17 +2154,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -2815,9 +2175,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -2827,9 +2187,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -2839,9 +2199,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -2851,9 +2211,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -2863,9 +2223,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -2875,9 +2235,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -2887,18 +2247,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" - -[[package]] -name = "winnow" -version = "0.6.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" -dependencies = [ - "memchr", -] +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winreg" @@ -2910,15 +2261,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "zerocopy" version = "0.7.32" @@ -2936,5 +2278,5 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.48", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 7bbddd5..8c5bd1a 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -8,16 +8,14 @@ crate-type = ["staticlib", "cdylib"] [build-dependencies] -flutter_rust_bridge_codegen = { version = "= 2.0.0-dev.28" } anyhow = "1.0.68" [dependencies] -flutter_rust_bridge = "=2.0.0-dev.28" +flutter_rust_bridge = "=2.0.0-dev.31" log = "0.4.19" simplelog = "0.12.1" anyhow = { version = "1.0.71"} -#ldk-node = { version = "= 0.2.1" } -ldk-node = {git = 'https://github.com/lightningdevkit/ldk-node.git', rev = "71b1d3c5594b1901cb88b47defec4c6507fba6db"} +ldk-node = { version = "= 0.2.2" } [profile.release] diff --git a/rust/cargokit.yaml b/rust/cargokit.yaml index fc12e2c..de2761f 100644 --- a/rust/cargokit.yaml +++ b/rust/cargokit.yaml @@ -1,10 +1,7 @@ cargo: release: - toolchain: nightly - extra_flags: - - -Z - - build-std=panic_abort,std + toolchain: stable precompiled_binaries: url_prefix: https://github.com/LtbLightning/ldk-node-flutter/releases/download/precompiled_ - public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b + public_key: 9ac2de724ed22cc1e1400b7630331f82b99cfc11e76f8d4b04c0cd1f0c9dcfd1 diff --git a/rust/src/api/error.rs b/rust/src/api/error.rs index af445cc..95359e4 100644 --- a/rust/src/api/error.rs +++ b/rust/src/api/error.rs @@ -1,7 +1,8 @@ use ldk_node::{BuildError, NodeError}; #[derive(Debug, PartialEq)] -pub enum NodeBaseError { +pub enum NodeException { + InvalidTxid, /// Returned when trying to start [Node] while it is already running. AlreadyRunning, /// Returned when trying to stop [Node] while it is not running. @@ -60,14 +61,12 @@ pub enum NodeBaseError { DuplicatePayment, /// There are insufficient funds to complete the given operation. InsufficientFunds, + FeerateEstimationUpdateFailed, - LiquidityRequestFailed, - LiquiditySourceUnavailable, - LiquidityFeeTooHigh, } #[allow(dead_code)] #[derive(Debug)] -pub enum BuilderError { +pub enum BuilderException { SocketAddressParseError, /// The given seed bytes are invalid, e.g., have invalid length. InvalidSeedBytes, @@ -78,7 +77,7 @@ pub enum BuilderError { /// The a read channel monitor is invalid. InvalidChannelMonitor, /// The given listening addresses are invalid, e.g. too many were passed. - InvalidListeningAddresses, + InvalidListeningAddress, /// We failed to read data from the [`KVStore`]. ReadFailed, /// We failed to write data to the [`KVStore`]. @@ -91,63 +90,73 @@ pub enum BuilderError { WalletSetupFailed, /// We failed to setup the logger. LoggerSetupFailed, + InvalidTrustedPeer, } -impl From for NodeBaseError { +impl From for NodeException { fn from(value: NodeError) -> Self { match value { - NodeError::AlreadyRunning => NodeBaseError::AlreadyRunning, - NodeError::NotRunning => NodeBaseError::NotRunning, - NodeError::OnchainTxCreationFailed => NodeBaseError::OnchainTxCreationFailed, - NodeError::ConnectionFailed => NodeBaseError::ConnectionFailed, - NodeError::InvoiceCreationFailed => NodeBaseError::InvoiceCreationFailed, - NodeError::PaymentSendingFailed => NodeBaseError::PaymentSendingFailed, - NodeError::ProbeSendingFailed => NodeBaseError::ProbeSendingFailed, - NodeError::ChannelCreationFailed => NodeBaseError::ChannelCreationFailed, - NodeError::ChannelClosingFailed => NodeBaseError::ChannelClosingFailed, - NodeError::ChannelConfigUpdateFailed => NodeBaseError::ChannelConfigUpdateFailed, - NodeError::PersistenceFailed => NodeBaseError::PersistenceFailed, - NodeError::WalletOperationFailed => NodeBaseError::WalletOperationFailed, - NodeError::OnchainTxSigningFailed => NodeBaseError::OnchainTxSigningFailed, - NodeError::MessageSigningFailed => NodeBaseError::MessageSigningFailed, - NodeError::TxSyncFailed => NodeBaseError::TxSyncFailed, - NodeError::GossipUpdateFailed => NodeBaseError::GossipUpdateFailed, - NodeError::InvalidAddress => NodeBaseError::InvalidAddress, - NodeError::InvalidSocketAddress => NodeBaseError::InvalidSocketAddress, - NodeError::InvalidPublicKey => NodeBaseError::InvalidPublicKey, - NodeError::InvalidSecretKey => NodeBaseError::InvalidSecretKey, - NodeError::InvalidPaymentHash => NodeBaseError::InvalidPaymentHash, - NodeError::InvalidPaymentPreimage => NodeBaseError::InvalidPaymentPreimage, - NodeError::InvalidPaymentSecret => NodeBaseError::InvalidPaymentSecret, - NodeError::InvalidAmount => NodeBaseError::InvalidAmount, - NodeError::InvalidInvoice => NodeBaseError::InvalidInvoice, - NodeError::InvalidChannelId => NodeBaseError::InvalidChannelId, - NodeError::InvalidNetwork => NodeBaseError::InvalidNetwork, - NodeError::DuplicatePayment => NodeBaseError::DuplicatePayment, - NodeError::InsufficientFunds => NodeBaseError::InsufficientFunds, + NodeError::AlreadyRunning => NodeException::AlreadyRunning, + NodeError::NotRunning => NodeException::NotRunning, + NodeError::OnchainTxCreationFailed => NodeException::OnchainTxCreationFailed, + NodeError::ConnectionFailed => NodeException::ConnectionFailed, + NodeError::InvoiceCreationFailed => NodeException::InvoiceCreationFailed, + NodeError::PaymentSendingFailed => NodeException::PaymentSendingFailed, + NodeError::ProbeSendingFailed => NodeException::ProbeSendingFailed, + NodeError::ChannelCreationFailed => NodeException::ChannelCreationFailed, + NodeError::ChannelClosingFailed => NodeException::ChannelClosingFailed, + NodeError::ChannelConfigUpdateFailed => NodeException::ChannelConfigUpdateFailed, + NodeError::PersistenceFailed => NodeException::PersistenceFailed, + NodeError::WalletOperationFailed => NodeException::WalletOperationFailed, + NodeError::OnchainTxSigningFailed => NodeException::OnchainTxSigningFailed, + NodeError::MessageSigningFailed => NodeException::MessageSigningFailed, + NodeError::TxSyncFailed => NodeException::TxSyncFailed, + NodeError::GossipUpdateFailed => NodeException::GossipUpdateFailed, + NodeError::InvalidAddress => NodeException::InvalidAddress, + NodeError::InvalidSocketAddress => NodeException::InvalidSocketAddress, + NodeError::InvalidPublicKey => NodeException::InvalidPublicKey, + NodeError::InvalidSecretKey => NodeException::InvalidSecretKey, + NodeError::InvalidPaymentHash => NodeException::InvalidPaymentHash, + NodeError::InvalidPaymentPreimage => NodeException::InvalidPaymentPreimage, + NodeError::InvalidPaymentSecret => NodeException::InvalidPaymentSecret, + NodeError::InvalidAmount => NodeException::InvalidAmount, + NodeError::InvalidInvoice => NodeException::InvalidInvoice, + NodeError::InvalidChannelId => NodeException::InvalidChannelId, + NodeError::InvalidNetwork => NodeException::InvalidNetwork, + NodeError::DuplicatePayment => NodeException::DuplicatePayment, + NodeError::InsufficientFunds => NodeException::InsufficientFunds, NodeError::FeerateEstimationUpdateFailed => { - NodeBaseError::FeerateEstimationUpdateFailed + NodeException::FeerateEstimationUpdateFailed } - NodeError::LiquidityRequestFailed => NodeBaseError::LiquidityRequestFailed, - NodeError::LiquiditySourceUnavailable => NodeBaseError::LiquiditySourceUnavailable, - NodeError::LiquidityFeeTooHigh => NodeBaseError::LiquidityFeeTooHigh, } } } -impl From for BuilderError { +impl From for BuilderException { fn from(value: BuildError) -> Self { match value { - BuildError::InvalidSeedBytes => BuilderError::InvalidSeedBytes, - BuildError::InvalidSeedFile => BuilderError::InvalidSeedFile, - BuildError::InvalidSystemTime => BuilderError::InvalidSystemTime, - BuildError::ReadFailed => BuilderError::ReadFailed, - BuildError::WriteFailed => BuilderError::WriteFailed, - BuildError::StoragePathAccessFailed => BuilderError::StoragePathAccessFailed, - BuildError::WalletSetupFailed => BuilderError::WalletSetupFailed, - BuildError::LoggerSetupFailed => BuilderError::LoggerSetupFailed, - BuildError::InvalidChannelMonitor => BuilderError::InvalidChannelMonitor, - BuildError::KVStoreSetupFailed => BuilderError::KVStoreSetupFailed, - BuildError::InvalidListeningAddresses => BuilderError::InvalidListeningAddresses, + BuildError::InvalidSeedBytes => BuilderException::InvalidSeedBytes, + BuildError::InvalidSeedFile => BuilderException::InvalidSeedFile, + BuildError::InvalidSystemTime => BuilderException::InvalidSystemTime, + BuildError::ReadFailed => BuilderException::ReadFailed, + BuildError::WriteFailed => BuilderException::WriteFailed, + BuildError::StoragePathAccessFailed => BuilderException::StoragePathAccessFailed, + BuildError::WalletSetupFailed => BuilderException::WalletSetupFailed, + BuildError::LoggerSetupFailed => BuilderException::LoggerSetupFailed, + BuildError::InvalidChannelMonitor => BuilderException::InvalidChannelMonitor, + BuildError::KVStoreSetupFailed => BuilderException::KVStoreSetupFailed, + BuildError::InvalidListeningAddresses => BuilderException::InvalidListeningAddress, + } + } +} + +impl From for BuilderException { + fn from(value: ldk_node::bip39::Error) -> Self { + match value { + ldk_node::bip39::Error::BadWordCount(_) => BuilderException::InvalidSeedBytes, + ldk_node::bip39::Error::UnknownWord(_) => BuilderException::InvalidSeedBytes, + ldk_node::bip39::Error::BadEntropyBitCount(_) => BuilderException::InvalidSeedBytes, + ldk_node::bip39::Error::InvalidChecksum => BuilderException::InvalidSeedBytes, + ldk_node::bip39::Error::AmbiguousLanguages(_) => BuilderException::InvalidSeedBytes, } } } diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 05b9af3..6f054f8 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -1,3 +1,3 @@ pub mod error; -pub mod node; pub mod types; +pub mod node; diff --git a/rust/src/api/node.rs b/rust/src/api/node.rs index e8dbd79..fa291de 100644 --- a/rust/src/api/node.rs +++ b/rust/src/api/node.rs @@ -1,52 +1,51 @@ -use crate::api::error::{BuilderError, NodeBaseError}; +use crate::api::error::{BuilderException, NodeException}; use crate::api::types::*; use crate::frb_generated::RustOpaque; pub use ldk_node::io::sqlite_store::SqliteStore; use ldk_node::lightning::util::ser::Writeable; -use ldk_node::BuildError; pub use ldk_node::Node; use std::str::FromStr; pub use std::sync::{Arc, Mutex}; #[derive(Debug, Clone)] -pub struct MnemonicBase { +pub struct LdkMnemonic { pub seed_phrase: String, } -impl From for ldk_node::bip39::Mnemonic { - fn from(value: MnemonicBase) -> Self { - ldk_node::bip39::Mnemonic::from_str(&value.seed_phrase).expect("Invalid seed phrase") +impl TryFrom for ldk_node::bip39::Mnemonic { + type Error = BuilderException; + + fn try_from(value: LdkMnemonic) -> Result { + ldk_node::bip39::Mnemonic::from_str(&value.seed_phrase).map_err(|e| e.into()) } } -impl From for MnemonicBase { +impl From for LdkMnemonic { fn from(value: ldk_node::bip39::Mnemonic) -> Self { - MnemonicBase { + LdkMnemonic { seed_phrase: value.to_string(), } } } -impl MnemonicBase { - pub fn generate() -> MnemonicBase { +impl LdkMnemonic { + pub fn generate() -> LdkMnemonic { ldk_node::generate_entropy_mnemonic().into() } } -pub fn finalize_builder( +pub fn build_with_sqlite_store( config: Config, chain_data_source_config: Option, entropy_source_config: Option, gossip_source_config: Option, - liquidity_source_config: Option, -) -> anyhow::Result { +) -> anyhow::Result { let builder = create_builder( config, chain_data_source_config, entropy_source_config, gossip_source_config, - liquidity_source_config, ); match builder?.build() { - Ok(e) => Ok(NodeBase { + Ok(e) => Ok(LdkNode { ptr: RustOpaque::new(e), }), Err(e) => Err(e.into()), @@ -58,9 +57,8 @@ fn create_builder( chain_data_source_config: Option, entropy_source_config: Option, gossip_source_config: Option, - liquidity_source_config: Option, -) -> Result { - let mut builder = ldk_node::Builder::from_config(config.into()); +) -> Result { + let mut builder = ldk_node::Builder::from_config(config.try_into()?); if let Some(source) = entropy_source_config { match source { EntropySourceConfig::SeedFile(e) => builder.set_entropy_seed_path(e), @@ -68,7 +66,7 @@ fn create_builder( EntropySourceConfig::Bip39Mnemonic { mnemonic, passphrase, - } => builder.set_entropy_bip39_mnemonic(mnemonic.into(), passphrase), + } => builder.set_entropy_bip39_mnemonic(mnemonic.try_into()?, passphrase), }; } if let Some(source) = chain_data_source_config { @@ -82,34 +80,22 @@ fn create_builder( GossipSourceConfig::RapidGossipSync(e) => builder.set_gossip_source_rgs(e), }; } - if let Some(liquidity) = liquidity_source_config { - builder.set_liquidity_source_lsps2( - liquidity.lsps2_service.0.into(), - liquidity.lsps2_service.1.into(), - liquidity.lsps2_service.2, - ); - } Ok(builder) } -pub struct NodeBase { +pub struct LdkNode { pub ptr: RustOpaque>, } -impl NodeBase { - pub fn start(&self) -> anyhow::Result<(), NodeBaseError> { +impl LdkNode { + pub fn start(&self) -> anyhow::Result<(), NodeException> { self.ptr.start().map_err(|e| e.into()) } - pub fn stop(&self) -> anyhow::Result<(), NodeBaseError> { + pub fn stop(&self) -> anyhow::Result<(), NodeException> { self.ptr.stop().map_err(|e| e.into()) } - - pub fn status(&self) -> NodeStatus { - self.ptr.status().into() - } - - pub fn config(&self) -> Config { - self.ptr.config().into() + pub fn is_running(&self) -> bool { + self.ptr.is_running() } pub fn event_handled(&self) { @@ -123,10 +109,6 @@ impl NodeBase { } } - pub async fn next_event_async(&self) -> Event { - self.ptr.next_event_async().await.into() - } - pub fn wait_next_event(&self) -> Event { self.ptr.wait_next_event().into() } @@ -144,24 +126,30 @@ impl NodeBase { }) } - pub fn new_onchain_address(&self) -> anyhow::Result { + pub fn new_onchain_address(&self) -> anyhow::Result { self.ptr .new_onchain_address() .map_err(|e| e.into()) .map(|e| e.into()) } - pub fn list_balances(&self) -> anyhow::Result { - Ok(self.ptr.list_balances().into()) + pub fn spendable_onchain_balance_sats(&self) -> anyhow::Result { + self.ptr + .spendable_onchain_balance_sats() + .map_err(|e| e.into()) + } + + pub fn total_onchain_balance_sats(&self) -> anyhow::Result { + self.ptr.total_onchain_balance_sats().map_err(|e| e.into()) } pub fn send_to_onchain_address( &self, address: Address, amount_sats: u64, - ) -> anyhow::Result { + ) -> anyhow::Result { self.ptr - .send_to_onchain_address(&address.into(), amount_sats) + .send_to_onchain_address(&(address.try_into()?), amount_sats) .map_err(|e| e.into()) .map(|e| Txid { hash: e.to_string(), @@ -171,9 +159,9 @@ impl NodeBase { pub fn send_all_to_onchain_address( &self, address: Address, - ) -> anyhow::Result { + ) -> anyhow::Result { self.ptr - .send_all_to_onchain_address(&address.into()) + .send_all_to_onchain_address(&(address.try_into()?)) .map_err(|e| e.into()) .map(|e| e.into()) } @@ -187,64 +175,71 @@ impl NodeBase { node_id: PublicKey, address: SocketAddress, persist: bool, - ) -> anyhow::Result<(), NodeBaseError> { + ) -> anyhow::Result<(), NodeException> { self.ptr - .connect(node_id.into(), address.into(), persist) + .connect( + node_id.try_into()?, + address + .try_into() + .map_err(|_| NodeException::InvalidAddress)?, + persist, + ) .map_err(|e| e.into()) } - pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), NodeBaseError> { + pub fn disconnect(&self, counterparty_node_id: PublicKey) -> anyhow::Result<(), NodeException> { self.ptr - .disconnect(counterparty_node_id.into()) + .disconnect(counterparty_node_id.try_into()?) .map_err(|e| e.into()) } pub fn connect_open_channel( &self, - address: SocketAddress, + socket_address: SocketAddress, node_id: PublicKey, channel_amount_sats: u64, push_to_counterparty_msat: Option, announce_channel: bool, channel_config: Option, - ) -> Result { + ) -> anyhow::Result<(), NodeException> { self.ptr .connect_open_channel( - node_id.into(), - address.into(), + node_id.try_into()?, + socket_address + .try_into() + .map_err(|_| NodeException::InvalidAddress)?, channel_amount_sats, push_to_counterparty_msat, channel_config.map(|x| Arc::new(x.into())), announce_channel, ) .map_err(|e| e.into()) - .map(|e| e.into()) } - pub fn sync_wallets(&self) -> anyhow::Result<(), NodeBaseError> { + pub fn sync_wallets(&self) -> anyhow::Result<(), NodeException> { self.ptr.sync_wallets().map_err(|e| e.into()) } pub fn close_channel( &self, - user_channel_id: UserChannelId, + channel_id: ChannelId, counterparty_node_id: PublicKey, - ) -> anyhow::Result<(), NodeBaseError> { + ) -> anyhow::Result<(), NodeException> { self.ptr - .close_channel(&user_channel_id.into(), counterparty_node_id.into()) + .close_channel(&(channel_id.into()), counterparty_node_id.try_into()?) .map_err(|e| e.into()) } pub fn update_channel_config( &self, - user_channel_id: UserChannelId, + channel_id: ChannelId, counterparty_node_id: PublicKey, channel_config: ChannelConfig, - ) -> anyhow::Result<(), NodeBaseError> { + ) -> anyhow::Result<(), NodeException> { self.ptr .update_channel_config( - &user_channel_id.into(), - counterparty_node_id.into(), + &channel_id.into(), + counterparty_node_id.try_into()?, Arc::new(channel_config.into()), ) .map_err(|e| e.into()) @@ -253,9 +248,9 @@ impl NodeBase { pub fn send_payment( &self, invoice: Bolt11Invoice, - ) -> anyhow::Result { + ) -> anyhow::Result { self.ptr - .send_payment(&invoice.into()) + .send_payment(&(invoice.try_into()?)) .map_err(|e| e.into()) .map(|e| e.into()) } @@ -264,9 +259,9 @@ impl NodeBase { &self, invoice: Bolt11Invoice, amount_msat: u64, - ) -> anyhow::Result { + ) -> anyhow::Result { self.ptr - .send_payment_using_amount(&invoice.into(), amount_msat) + .send_payment_using_amount(&(invoice.try_into()?), amount_msat) .map_err(|e| e.into()) .map(|e| e.into()) } @@ -275,26 +270,27 @@ impl NodeBase { &self, amount_msat: u64, node_id: PublicKey, - ) -> anyhow::Result { + ) -> anyhow::Result { self.ptr - .send_spontaneous_payment(amount_msat, node_id.into()) + .send_spontaneous_payment(amount_msat, node_id.try_into()?) .map_err(|e| e.into()) .map(|e| e.into()) } - pub fn send_payment_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), NodeBaseError> { + pub fn send_payment_probes(&self, invoice: Bolt11Invoice) -> anyhow::Result<(), NodeException> { self.ptr - .send_payment_probes(&invoice.into()) + .send_payment_probes(&(invoice.try_into()?)) .map_err(|e| e.into()) } + ///Sends payment probes over all paths of a route that would be used to pay the given amount to the given node_id. pub fn send_spontaneous_payment_probes( &self, amount_msat: u64, node_id: PublicKey, - ) -> anyhow::Result<(), NodeBaseError> { + ) -> anyhow::Result<(), NodeException> { self.ptr - .send_spontaneous_payment_probes(amount_msat, node_id.into()) + .send_spontaneous_payment_probes(amount_msat, node_id.try_into()?) .map_err(|e| e.into()) } @@ -302,9 +298,9 @@ impl NodeBase { &self, invoice: Bolt11Invoice, amount_msat: u64, - ) -> Result<(), NodeBaseError> { + ) -> Result<(), NodeException> { self.ptr - .send_payment_probes_using_amount(&(invoice.into()), amount_msat) + .send_payment_probes_using_amount(&(invoice.try_into()?), amount_msat) .map_err(|e| e.into()) } @@ -313,7 +309,7 @@ impl NodeBase { amount_msat: u64, description: String, expiry_secs: u32, - ) -> anyhow::Result { + ) -> anyhow::Result { self.ptr .receive_payment(amount_msat, description.as_str(), expiry_secs) .map_err(|e| e.into()) @@ -324,7 +320,7 @@ impl NodeBase { &self, description: String, expiry_secs: u32, - ) -> anyhow::Result { + ) -> anyhow::Result { self.ptr .receive_variable_amount_payment(description.as_str(), expiry_secs) .map_err(|e| e.into()) @@ -333,40 +329,6 @@ impl NodeBase { }) } - pub fn receive_variable_amount_payment_via_jit_channel( - &self, - description: String, - expiry_secs: u32, - max_proportional_lsp_fee_limit_ppm_msat: Option, - ) -> anyhow::Result { - match self.ptr.receive_variable_amount_payment_via_jit_channel( - description.as_str(), - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat, - ) { - Ok(e) => Ok(e.into()), - Err(e) => Err(e.into()), - } - } - - pub fn receive_payment_via_jit_channel( - &self, - amount_msat: u64, - description: String, - expiry_secs: u32, - max_total_lsp_fee_limit_msat: Option, - ) -> anyhow::Result { - match self.ptr.receive_payment_via_jit_channel( - amount_msat, - description.as_str(), - expiry_secs, - max_total_lsp_fee_limit_msat, - ) { - Ok(e) => Ok(e.into()), - Err(e) => Err(e.into()), - } - } - pub fn payment(&self, payment_hash: PaymentHash) -> Option { match self.ptr.payment(&(payment_hash.into())) { None => None, @@ -374,7 +336,7 @@ impl NodeBase { } } - pub fn remove_payment(&self, payment_hash: PaymentHash) -> anyhow::Result<(), NodeBaseError> { + pub fn remove_payment(&self, payment_hash: PaymentHash) -> Result<(), NodeException> { self.ptr .remove_payment(&(payment_hash.into())) .map_err(|e| e.into()) @@ -407,7 +369,7 @@ impl NodeBase { .collect() } - pub fn sign_message(&self, msg: Vec) -> anyhow::Result { + pub fn sign_message(&self, msg: Vec) -> anyhow::Result { self.ptr.sign_message(msg.as_slice()).map_err(|e| e.into()) } @@ -416,9 +378,9 @@ impl NodeBase { msg: Vec, sig: String, pkey: PublicKey, - ) -> anyhow::Result { + ) -> anyhow::Result { Ok(self .ptr - .verify_signature(msg.as_slice(), sig.as_str(), &pkey.into())) + .verify_signature(msg.as_slice(), sig.as_str(), &pkey.try_into()?)) } } diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index 44325a9..35504d3 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -1,10 +1,10 @@ -use crate::api::node::MnemonicBase; -use flutter_rust_bridge::*; -use ldk_node::lightning::util::ser::{Readable, Writeable}; +use crate::api::error::{BuilderException, NodeException}; +use crate::api::node::LdkMnemonic; +use flutter_rust_bridge::frb; use std::str::FromStr; use std::string::ToString; -///The addresses on which the node will listen for incoming connections. +///An address which can be used to connect to a remote peer. #[derive(Debug, Clone, PartialEq, Eq)] pub enum SocketAddress { TcpIpV4 { @@ -27,6 +27,17 @@ pub enum SocketAddress { port: u16, }, } +impl SocketAddress { + pub fn from_str(address: String) -> Result { + match ldk_node::lightning::ln::msgs::SocketAddress::from_str(address.as_str()) { + Ok(e) => Ok(e.into()), + Err(_) => Err(BuilderException::SocketAddressParseError), + } + } + pub fn as_string(&self) -> String { + format!("{:?}", { self }) + } +} impl From for SocketAddress { fn from(value: ldk_node::lightning::ln::msgs::SocketAddress) -> Self { match value { @@ -57,38 +68,42 @@ impl From for SocketAddress { } } } -impl From for ldk_node::lightning::ln::msgs::SocketAddress { - fn from(value: SocketAddress) -> Self { + +impl TryFrom for ldk_node::lightning::ln::msgs::SocketAddress { + type Error = BuilderException; + + fn try_from(value: SocketAddress) -> Result { match value { SocketAddress::TcpIpV4 { addr, port } => { - ldk_node::lightning::ln::msgs::SocketAddress::TcpIpV4 { addr, port } + Ok(ldk_node::lightning::ln::msgs::SocketAddress::TcpIpV4 { addr, port }) } SocketAddress::TcpIpV6 { addr, port } => { - ldk_node::lightning::ln::msgs::SocketAddress::TcpIpV6 { addr, port } + Ok(ldk_node::lightning::ln::msgs::SocketAddress::TcpIpV6 { addr, port }) + } + SocketAddress::OnionV2(e) => { + Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV2(e)) } - SocketAddress::OnionV2(e) => ldk_node::lightning::ln::msgs::SocketAddress::OnionV2(e), SocketAddress::OnionV3 { ed25519_pubkey, checksum, version, port, - } => ldk_node::lightning::ln::msgs::SocketAddress::OnionV3 { + } => Ok(ldk_node::lightning::ln::msgs::SocketAddress::OnionV3 { ed25519_pubkey, checksum, version, port, - }, + }), SocketAddress::Hostname { addr, port } => { - ldk_node::lightning::ln::msgs::SocketAddress::Hostname { + Ok(ldk_node::lightning::ln::msgs::SocketAddress::Hostname { hostname: ldk_node::lightning::util::ser::Hostname::try_from(addr) - .expect("Invalid hostname"), + .map_err(|_| BuilderException::SocketAddressParseError)?, port, - } + }) } } } } -#[derive(Clone, Debug)] ///Options which apply on a per-channel basis and may change at runtime or based on negotiation with our counterparty. pub struct ChannelConfig { ///Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound over the channel. This may be allowed to change at runtime in a later update, however doing so must result in update messages sent to notify all nodes of our updated relay fee. @@ -108,7 +123,7 @@ pub struct ChannelConfig { /// Default value: 72 (12 hours at an average of 6 blocks/hour). Minimum value: MIN_CLTV_EXPIRY_DELTA, any values less than this will be treated as MIN_CLTV_EXPIRY_DELTA instead. pub cltv_expiry_delta: u16, /// Options for how to set the max dust HTLC exposure allowed on a channel. - pub max_dust_htlc_exposure: Option, + pub max_dust_htlc_exposure: MaxDustHTLCExposure, ///The additional fee we’re willing to pay to avoid waiting for the counterparty’s toSelfDelay to reclaim funds. /// /// When we close a channel cooperatively with our counterparty, we negotiate a fee for the closing transaction which both sides find acceptable, ultimately paid by the channel funder/initiator. @@ -120,26 +135,10 @@ pub struct ChannelConfig { /// Default value: 1000 satoshis. pub force_close_avoidance_max_fee_satoshis: u64, ///If set, allows this channel's counterparty to skim an additional fee off this node's inbound HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. - // Usage: - // The payee will set this option and set its invoice route hints to use intercept scids generated by this channel's counterparty. - // The counterparty will get an HTLCIntercepted event upon payment forward, and call forward_intercepted_htlc with less than the amount provided in HTLCIntercepted::expected_outbound_amount_msat. The difference between the expected and actual forward amounts is their fee. + /// Usage: + /// The payee will set this option and set its invoice route hints to use intercept scids generated by this channel's counterparty. pub accept_underpaying_htlcs: bool, } - -impl From for ChannelConfig { - fn from(value: ldk_node::ChannelConfig) -> Self { - ChannelConfig { - forwarding_fee_proportional_millionths: value.forwarding_fee_proportional_millionths(), - forwarding_fee_base_msat: value.forwarding_fee_base_msat(), - cltv_expiry_delta: value.cltv_expiry_delta(), - max_dust_htlc_exposure: None, - force_close_avoidance_max_fee_satoshis: value.force_close_avoidance_max_fee_satoshis(), - accept_underpaying_htlcs: value.accept_underpaying_htlcs(), - } - } -} -#[derive(Debug, Clone)] - pub enum MaxDustHTLCExposure { ///This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this limit is very important to prevent stealing of large amounts of dust HTLCs by miners through fee griefing attacks. // @@ -156,27 +155,29 @@ pub enum MaxDustHTLCExposure { // This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included on HTLC outputs means your channel may be subject to more dust exposure in the event of increases in fee rate. FeeRateMultiplier(u64), } -impl From for ldk_node::ChannelConfig { - fn from(e: ChannelConfig) -> Self { - let config = ldk_node::ChannelConfig::new(); - if e.accept_underpaying_htlcs { - config.accept_underpaying_htlcs(); - } - config.set_accept_underpaying_htlcs(e.accept_underpaying_htlcs); - config.set_cltv_expiry_delta(e.cltv_expiry_delta); - config.set_forwarding_fee_base_msat(e.forwarding_fee_base_msat); - config.set_force_close_avoidance_max_fee_satoshis(e.force_close_avoidance_max_fee_satoshis); - config.set_forwarding_fee_proportional_millionths(e.forwarding_fee_proportional_millionths); - if let Some(max_dust_htlc_exposure) = e.max_dust_htlc_exposure { - match max_dust_htlc_exposure { - MaxDustHTLCExposure::FixedLimitMsat(e) => { - config.set_max_dust_htlc_exposure_from_fixed_limit(e) - } - MaxDustHTLCExposure::FeeRateMultiplier(e) => { - config.set_max_dust_htlc_exposure_from_fee_rate_multiplier(e) - } +impl From for ldk_node::lightning::util::config::MaxDustHTLCExposure { + fn from(value: MaxDustHTLCExposure) -> Self { + match value { + MaxDustHTLCExposure::FixedLimitMsat(e) => { + ldk_node::lightning::util::config::MaxDustHTLCExposure::FixedLimitMsat(e) } - }; + MaxDustHTLCExposure::FeeRateMultiplier(e) => { + ldk_node::lightning::util::config::MaxDustHTLCExposure::FeeRateMultiplier(e) + } + } + } +} +impl From for ldk_node::ChannelConfig { + fn from(x: ChannelConfig) -> Self { + let config = + ldk_node::ChannelConfig::from(ldk_node::lightning::util::config::ChannelConfig { + forwarding_fee_proportional_millionths: x.forwarding_fee_proportional_millionths, + forwarding_fee_base_msat: x.forwarding_fee_base_msat, + cltv_expiry_delta: x.cltv_expiry_delta, + max_dust_htlc_exposure: x.max_dust_htlc_exposure.into(), + force_close_avoidance_max_fee_satoshis: x.force_close_avoidance_max_fee_satoshis, + accept_underpaying_htlcs: x.accept_underpaying_htlcs, + }); config } } @@ -207,184 +208,30 @@ impl From for ldk_node::lightning::ln::ChannelId { /// #[derive(Debug, Clone, PartialEq, Eq)] pub struct UserChannelId { - pub data: Vec, + pub data: u64, } /// An event emitted by [Node], which should be handled by the user. /// impl From for UserChannelId { fn from(value: ldk_node::UserChannelId) -> Self { UserChannelId { - data: value.encode(), - } - } -} -impl From for ldk_node::UserChannelId { - fn from(value: UserChannelId) -> Self { - let mut encoded = value.data.as_slice(); - ldk_node::UserChannelId::read(&mut encoded).expect("decode error") - } -} -impl From for ClosureReason { - fn from(value: ldk_node::lightning::events::ClosureReason) -> Self { - match value { - ldk_node::lightning::events::ClosureReason::CounterpartyForceClosed { peer_msg } => { - ClosureReason::CounterpartyForceClosed { - peer_msg: peer_msg.0, - } - } - ldk_node::lightning::events::ClosureReason::HolderForceClosed => { - ClosureReason::HolderForceClosed - } - ldk_node::lightning::events::ClosureReason::CooperativeClosure => { - ClosureReason::CooperativeClosure - } - ldk_node::lightning::events::ClosureReason::CommitmentTxConfirmed => { - ClosureReason::CommitmentTxConfirmed - } - ldk_node::lightning::events::ClosureReason::FundingTimedOut => { - ClosureReason::FundingTimedOut - } - ldk_node::lightning::events::ClosureReason::ProcessingError { err } => { - ClosureReason::ProcessingError { err } - } - ldk_node::lightning::events::ClosureReason::DisconnectedPeer => { - ClosureReason::DisconnectedPeer - } - ldk_node::lightning::events::ClosureReason::OutdatedChannelManager => { - ClosureReason::OutdatedChannelManager - } - ldk_node::lightning::events::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { - ClosureReason::CounterpartyCoopClosedUnfundedChannel - } - ldk_node::lightning::events::ClosureReason::FundingBatchClosure => { - ClosureReason::FundingBatchClosure - } + data: value.0 as u64, } } } -/// The reason the payment failed. Used in `Event.PaymentFailed`. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PaymentFailureReason { - /// The intended recipient rejected our payment. - RecipientRejected, - /// The user chose to abandon this payment by calling `channelManager.abandon_payment`. - /// - UserAbandoned, - /// We exhausted all of our retry attempts while trying to send the payment, or we - /// exhausted the `Retry.Timeout` if the user set one. If at any point a retry - /// attempt failed while being forwarded along the path, an `Event::PaymentPathFailed` will - /// have come before this. - /// - RetriesExhausted, - /// The payment expired while retrying, based on the provided - PaymentExpired, - /// We failed to find a route while retrying the payment. - RouteNotFound, - /// This error should generally never happen. This likely means that there is a problem with - /// your router. - UnexpectedError, -} -impl From for PaymentFailureReason { - fn from(value: ldk_node::lightning::events::PaymentFailureReason) -> Self { - match value { - ldk_node::lightning::events::PaymentFailureReason::RecipientRejected => { - PaymentFailureReason::RecipientRejected - } - ldk_node::lightning::events::PaymentFailureReason::UserAbandoned => { - PaymentFailureReason::UserAbandoned - } - ldk_node::lightning::events::PaymentFailureReason::RetriesExhausted => { - PaymentFailureReason::RetriesExhausted - } - ldk_node::lightning::events::PaymentFailureReason::PaymentExpired => { - PaymentFailureReason::PaymentExpired - } - ldk_node::lightning::events::PaymentFailureReason::RouteNotFound => { - PaymentFailureReason::RouteNotFound - } - ldk_node::lightning::events::PaymentFailureReason::UnexpectedError => { - PaymentFailureReason::UnexpectedError - } - } - } -} -/// The reason the channel was closed. See individual variants for more details. #[derive(Debug, Clone, PartialEq, Eq)] -pub enum ClosureReason { - /// Closure generated from receiving a peer error message. - /// - /// Our counterparty may have broadcasted their latest commitment state, and we have - /// as well. - CounterpartyForceClosed { - /// The error which the peer sent us. - /// - /// Be careful about printing the peer_msg, a well-crafted message could exploit - /// a security vulnerability in the terminal emulator or the logging subsystem. - /// To be safe, use `Display` on `UntrustedString` - /// - /// [`UntrustedString`]: crate::util::string::UntrustedString - peer_msg: String, - }, - /// Closure generated from `ChannelManager.force_close_channel`, called by the user. - /// - HolderForceClosed, - /// The channel was closed after negotiating a cooperative close and we've now broadcasted - /// the cooperative close transaction. Note the shutdown may have been initiated by us. - CooperativeClosure, - /// A commitment transaction was confirmed on chain, closing the channel. Most likely this - /// commitment transaction came from our counterparty, but it may also have come from - /// a copy of our own `ChannelMonitor`. - CommitmentTxConfirmed, - /// The funding transaction failed to confirm in a timely manner on an inbound channel. - FundingTimedOut, - /// Closure generated from processing an event, likely a HTLC forward/relay/reception. - ProcessingError { - /// A developer-readable error message which we generated. - err: String, - }, - /// The peer disconnected prior to funding completing. In this case the spec mandates that we - /// forget the channel entirely - we can attempt again if the peer reconnects. - /// - /// This includes cases where we restarted prior to funding completion, including prior to the - /// initial `ChannelMonitor` persistence completing. - /// - /// In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the - /// peer because of mutual incompatibility between us and our channel counterparty. - /// - DisconnectedPeer, - /// Closure generated from `channelManager.read` if the `ChannelMonitor` is newer than - /// the `ChannelManager` deserialized. - /// - OutdatedChannelManager, - /// The counterparty requested a cooperative close of a channel that had not been funded yet. - /// The channel has been immediately closed. - CounterpartyCoopClosedUnfundedChannel, - /// Another channel in the same funding batch closed before the funding transaction - /// was ready to be broadcast. - FundingBatchClosure, -} - -/// An event emitted by [Node], which should be handled by the user. -/// /// An event emitted by [Node], which should be handled by the user. /// -#[derive(Debug, Clone, PartialEq, Eq)] pub enum Event { /// A sent payment was successful. PaymentSuccessful { /// The hash of the payment. payment_hash: PaymentHash, - /// The total fee which was spent at intermediate hops in this payment. - fee_paid_msat: Option, }, /// A sent payment has failed. PaymentFailed { /// The hash of the payment. payment_hash: PaymentHash, - /// The reason why the payment failed. - /// - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - reason: Option, }, /// A payment has been received. PaymentReceived { @@ -393,65 +240,50 @@ pub enum Event { /// The value, in thousandths of a satoshi, that has been received. amount_msat: u64, }, - /// A channel has been created and is pending confirmation on-chain. - ChannelPending { - /// The `channel_id` of the channel. - channel_id: ChannelId, - /// The `user_channel_id` of the channel. - user_channel_id: UserChannelId, - /// The `temporary_channel_id` this channel used to be known by during channel establishment. - former_temporary_channel_id: ChannelId, - /// The `node_id` of the channel counterparty. - counterparty_node_id: PublicKey, - /// The outpoint of the channel's funding transaction. - funding_txo: OutPoint, - }, /// A channel is ready to be used. ChannelReady { - /// The `channel_id` of the channel. + /// The channel_id of the channel. channel_id: ChannelId, - /// The `user_channel_id` of the channel. + /// The user_channel_id of the channel. user_channel_id: UserChannelId, - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. + counterparty_node_id: Option, }, /// A channel has been closed. ChannelClosed { - /// The `channel_id` of the channel. + /// The channel_id of the channel. channel_id: ChannelId, - /// The `user_channel_id` of the channel. + /// The user_channel_id of the channel. user_channel_id: UserChannelId, - /// The `node_id` of the channel counterparty. - /// - /// This will be `None` for events serialized by LDK Node v0.1.0 and prior. counterparty_node_id: Option, - /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. - reason: Option, + }, + /// A channel has been created and is pending confirmation on-chain. + ChannelPending { + /// The channel_id of the channel. + channel_id: ChannelId, + /// The user_channel_id of the channel. + user_channel_id: UserChannelId, + /// The temporary_channel_id this channel used to be known by during channel establishment. + former_temporary_channel_id: ChannelId, + /// The node_id of the channel counterparty. + counterparty_node_id: PublicKey, + /// The outpoint of the channel's funding transaction. + funding_txo: OutPoint, }, } impl From for Event { fn from(value: ldk_node::Event) -> Self { match value { - ldk_node::Event::PaymentSuccessful { - payment_hash, - fee_paid_msat, - } => Event::PaymentSuccessful { + ldk_node::Event::PaymentSuccessful { payment_hash } => Event::PaymentSuccessful { payment_hash: PaymentHash { data: payment_hash.0, }, - fee_paid_msat, }, - ldk_node::Event::PaymentFailed { - payment_hash, - reason, - } => Event::PaymentFailed { + ldk_node::Event::PaymentFailed { payment_hash } => Event::PaymentFailed { payment_hash: PaymentHash { data: payment_hash.0, }, - reason: reason.map(|e| e.into()), }, ldk_node::Event::PaymentReceived { payment_hash, @@ -475,12 +307,10 @@ impl From for Event { channel_id, user_channel_id, counterparty_node_id, - reason, } => Event::ChannelClosed { channel_id: channel_id.into(), user_channel_id: user_channel_id.into(), counterparty_node_id: counterparty_node_id.map(|x| x.into()), - reason: reason.map(|e| e.into()), }, ldk_node::Event::ChannelPending { channel_id, @@ -493,7 +323,7 @@ impl From for Event { user_channel_id: user_channel_id.into(), former_temporary_channel_id: former_temporary_channel_id.into(), counterparty_node_id: PublicKey { - hex_code: counterparty_node_id.to_string(), + hex: counterparty_node_id.to_string(), }, funding_txo: funding_txo.into(), }, @@ -508,9 +338,12 @@ pub struct Txid { pub hash: String, } -impl From for ldk_node::bitcoin::Txid { - fn from(value: Txid) -> Self { - ldk_node::bitcoin::Txid::from_str(value.hash.as_str()).expect("Invalid txid") +impl TryFrom for ldk_node::bitcoin::Txid { + type Error = NodeException; + + fn try_from(value: Txid) -> Result { + ldk_node::bitcoin::Txid::from_str(value.hash.as_str()) + .map_err(|_| NodeException::InvalidTxid) } } @@ -616,11 +449,6 @@ pub struct PaymentPreimage { pub data: [u8; 32], } -impl From for PaymentPreimage { - fn from(value: ldk_node::lightning::ln::PaymentPreimage) -> Self { - Self { data: value.0 } - } -} /// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together /// #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)] @@ -669,10 +497,12 @@ pub struct Bolt11Invoice { pub signed_raw_invoice: String, } -impl From for ldk_node::lightning_invoice::Bolt11Invoice { - fn from(value: Bolt11Invoice) -> Self { +impl TryFrom for ldk_node::lightning_invoice::Bolt11Invoice { + type Error = NodeException; + + fn try_from(value: Bolt11Invoice) -> Result { ldk_node::lightning_invoice::Bolt11Invoice::from_str(value.signed_raw_invoice.as_str()) - .expect("Invalid Invoice") + .map_err(|_| NodeException::InvalidInvoice) } } impl From for Bolt11Invoice { @@ -686,19 +516,21 @@ impl From for Bolt11Invoice { /// #[derive(Debug, Clone, PartialEq, Eq)] pub struct PublicKey { - pub hex_code: String, + pub hex: String, } -impl From for ldk_node::bitcoin::secp256k1::PublicKey { - fn from(value: PublicKey) -> Self { - ldk_node::bitcoin::secp256k1::PublicKey::from_str(value.hex_code.as_str()) - .expect("Invalid Public Key") +impl TryFrom for ldk_node::bitcoin::secp256k1::PublicKey { + type Error = NodeException; + + fn try_from(value: PublicKey) -> Result { + ldk_node::bitcoin::secp256k1::PublicKey::from_str(value.hex.as_str()) + .map_err(|_| NodeException::InvalidPublicKey) } } impl From for PublicKey { fn from(value: ldk_node::bitcoin::secp256k1::PublicKey) -> Self { PublicKey { - hex_code: value.to_string(), + hex: value.to_string(), } } } @@ -708,11 +540,13 @@ pub struct Address { pub s: String, } -impl From
for ldk_node::bitcoin::Address { - fn from(value: Address) -> Self { +impl TryFrom
for ldk_node::bitcoin::Address { + type Error = NodeException; + + fn try_from(value: Address) -> Result { ldk_node::bitcoin::Address::from_str(value.s.as_str()) - .expect("Invalid Address") - .assume_checked() + .map(|e| e.assume_checked()) + .map_err(|_| NodeException::InvalidAddress) } } impl From for Address { @@ -723,130 +557,116 @@ impl From for Address { } } -#[derive(Debug, Clone)] +/// Details of a channel, as returned by node.listChannels() +/// +#[derive(Clone, Debug, PartialEq, Eq)] pub struct ChannelDetails { - /// The channel ID (prior to funding transaction generation, this is a random 32-byte - /// identifier, afterwards this is the transaction ID of the funding transaction XOR the - /// funding transaction output). - /// + /// The channel's ID (prior to funding transaction generation, this is a random 32 bytes, + /// thereafter this is the txid of the funding transaction xor the funding transaction output). /// Note that this means this value is *not* persistent - it can change once during the /// lifetime of the channel. + /// pub channel_id: ChannelId, - /// The node ID of our the channel's counterparty. + ///The node ID of our the channel’s counterparty. pub counterparty_node_id: PublicKey, - /// The channel's funding transaction output, if we've negotiated the funding transaction with + /// The Channel's funding transaction output, if we've negotiated the funding transaction with /// our counterparty already. - pub funding_txo: Option, - /// The value, in satoshis, of this channel as it appears in the funding output. + /// + pub funding_txo: Option, + ///The value, in satoshis, of this channel as it appears in the funding output. pub channel_value_sats: u64, - /// The value, in satoshis, that must always be held as a reserve in the channel for us. This - /// value ensures that if we broadcast a revoked state, our counterparty can punish us by - /// claiming at least this value on chain. + /// The value, in satoshis, that must always be held in the channel for us. This value ensures + /// that if we broadcast a revoked state, our counterparty can punish us by claiming at least + /// this value on chain. /// - /// This value is not included in `outboundCapacityMsat` as it can never be spent. + /// This value is not included in `outbound_capacity_msat` as it can never be spent. /// - /// This value will be `None` for outbound channels until the counterparty accepts the channel. + /// This value will be null for outbound channels until the counterparty accepts the channel. /// pub unspendable_punishment_reserve: Option, - /// The local `user_channel_id` of this channel. + /// The userChannelId passed in to create_channel, or a random value if the channel was + /// inbound. This may be zero for inbound channels serialized with LDK versions prior to + /// 0.0.113. + /// pub user_channel_id: UserChannelId, /// The currently negotiated fee rate denominated in satoshi per 1000 weight units, /// which is applied to commitment and HTLC transactions. + /// + /// This value will be null for objects serialized with LDK versions prior to 0.0.115. + /// pub feerate_sat_per_1000_weight: u32, - /// The available outbound capacity for sending HTLCs to the remote peer. + /// Our total balance. This is the amount we would get if we close the channel. + /// This value is not exact. Due to various in-flight changes and feerate changes, exactly this + /// amount is not likely to be recoverable on close. /// - /// The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose + /// This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose /// balance is not available for inclusion in new outbound HTLCs). This further does not include /// any pending outgoing HTLCs which are awaiting some other resolution to be sent. + /// This does not consider any on-chain fees. + /// + pub balance_msat: u64, + /// The available outbound capacity for sending HTLCs to the remote peer. This does not include + /// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + /// available for inclusion in new outbound HTLCs). This further does not include any pending + /// outgoing HTLCs which are awaiting some other resolution to be sent. + /// + /// This value is not exact. Due to various in-flight changes, feerate changes, and our + /// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we + /// should be able to spend nearly this amount. + /// pub outbound_capacity_msat: u64, - /// The available outbound capacity for sending HTLCs to the remote peer. + /// The available inbound capacity for the remote peer to send HTLCs to us. This does not + /// include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + /// available for inclusion in new inbound HTLCs). + /// Note that there are some corner cases not fully handled here, so the actual available + /// inbound capacity may be slightly higher than this. + /// + /// This value is not exact. Due to various in-flight changes, feerate changes, and our + /// counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable. + /// However, our counterparty should be able to spend nearly this amount. /// - /// The amount does not include any pending HTLCs which are not yet resolved - /// (and, thus, whose balance is not available for inclusion in new inbound HTLCs). This further - /// does not include any pending outgoing HTLCs which are awaiting some other resolution to be - /// sent. pub inbound_capacity_msat: u64, - /// The number of required confirmations on the funding transactions before the funding is - /// considered "locked". The amount is selected by the channel fundee. + /// The number of required confirmations on the funding transaction before the funding will be + /// considered "locked". This number is selected by the channel fundee, and can be selected for inbound channels with + /// This value will be null for outbound channels until the counterparty accepts the channel. /// - /// The value will be `None` for outbound channels until the counterparty accepts the channel. pub confirmations_required: Option, /// The current number of confirmations on the funding transaction. + /// + /// This value will be `None` for objects serialized with LDK versions prior to 0.0.113. + /// pub confirmations: Option, - /// Returns `true` if the channel was initiated (and therefore funded) by us. - pub is_outbound: bool, - /// Returns `true` if both parties have exchanged `channel_ready` messages, and the channel is - /// not currently being shut down. Both parties exchange `channel_ready` messages upon - /// independently verifying that the required confirmations count provided by - /// `confirmations_required` has been reached. - pub is_channel_ready: bool, - /// Returns `true` if the channel (a) `channel_ready` messages have been exchanged, (b) the - /// peer is connected, and (c) the channel is not currently negotiating shutdown. + + /// True if the channel was initiated (and thus funded) by us. /// - /// This is a strict superset of `is_channel_ready`. - pub is_usable: bool, - /// Returns `true` if this channel is (or will be) publicly-announced - pub is_public: bool, - /// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over - /// the channel. - pub cltv_expiry_delta: Option, - /// The value, in satoshis, that must always be held in the channel for our counterparty. This - /// value ensures that if our counterparty broadcasts a revoked state, we can punish them by - /// claiming at least this value on chain. + pub is_outbound: bool, + /// True if the channel is confirmed, channelReady messages have been exchanged, and the + /// channel is not currently being shut down. `channelReady` message exchange implies the + /// required confirmation count has been reached (and we were connected to the peer at some + /// point after the funding transaction received enough confirmations). The required /// - /// This value is not included in [`inbound_capacity_msat`] as it can never be spent. + pub is_channel_ready: bool, + /// True if the channel is (a) confirmed and channelReady messages have been exchanged, (b) + /// the peer is connected, and (c) the channel is not currently negotiating a shutdown. /// - /// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat - pub counterparty_unspendable_punishment_reserve: u64, - /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. + /// This is a strict superset of `isChannelReady`. /// - /// This field is only `None` before we have received either the `OpenChannel` or - /// `AcceptChannel` message from the remote peer. - pub counterparty_outbound_htlc_minimum_msat: Option, - /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel. - pub counterparty_outbound_htlc_maximum_msat: Option, - /// Base routing fee in millisatoshis. - pub counterparty_forwarding_info_fee_base_msat: Option, - /// Proportional fee, in millionths of a satoshi the channel will charge per transferred satoshi. - pub counterparty_forwarding_info_fee_proportional_millionths: Option, - /// The minimum difference in CLTV expiry between an ingoing HTLC and its outgoing counterpart, - /// such that the outgoing HTLC is forwardable to this counterparty. - pub counterparty_forwarding_info_cltv_expiry_delta: Option, - /// The available outbound capacity for sending a single HTLC to the remote peer. This is - /// similar to `channelDetails.outboundCapacityMsat` but it may be further restricted by - /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us - /// to use a limit as close as possible to the HTLC limit we can currently send. - pub next_outbound_htlc_limit_msat: u64, - /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of - /// `channelDetails.nextOutboundHtlcLimitMsat` but represents a lower-bound, rather than - /// an upper-bound. This is intended for use when routing, allowing us to ensure we pick a - /// route which is valid. - pub next_outbound_htlc_minimum_msat: u64, - /// The number of blocks (after our commitment transaction confirms) that we will need to wait - /// until we can claim our funds after we force-close the channel. During this time our - /// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty - /// force-closes the channel and broadcasts a commitment transaction we do not have to wait any - /// time to claim our non-HTLC-encumbered funds. + pub is_usable: bool, + /// True if this channel is (or will be) publicly-announced. /// - /// This value will be `None` for outbound channels until the counterparty accepts the channel. - pub force_close_spend_delay: Option, - /// The smallest value HTLC (in msat) we will accept, for this channel. - pub inbound_htlc_minimum_msat: u64, - /// The largest value HTLC (in msat) we currently will accept, for this channel. - pub inbound_htlc_maximum_msat: Option, - /// Set of configurable parameters that affect channel operation. - pub config: ChannelConfig, + pub is_public: bool, } impl From<&ldk_node::ChannelDetails> for ChannelDetails { fn from(value: &ldk_node::ChannelDetails) -> Self { ChannelDetails { channel_id: value.clone().channel_id.into(), counterparty_node_id: value.clone().counterparty_node_id.into(), - funding_txo: value.clone().funding_txo.map(|x| x.into()), + funding_txo: value.clone().funding_txo.map(|x| x.txid.to_string()), channel_value_sats: value.clone().channel_value_sats, unspendable_punishment_reserve: value.clone().unspendable_punishment_reserve, user_channel_id: value.clone().user_channel_id.into(), feerate_sat_per_1000_weight: value.clone().feerate_sat_per_1000_weight, + balance_msat: value.clone().balance_msat, outbound_capacity_msat: value.clone().outbound_capacity_msat, inbound_capacity_msat: value.clone().inbound_capacity_msat, confirmations_required: value.clone().confirmations_required, @@ -855,29 +675,6 @@ impl From<&ldk_node::ChannelDetails> for ChannelDetails { is_channel_ready: value.clone().is_channel_ready, is_usable: value.clone().is_usable, is_public: value.clone().is_public, - cltv_expiry_delta: value.clone().cltv_expiry_delta, - counterparty_unspendable_punishment_reserve: value - .clone() - .counterparty_unspendable_punishment_reserve, - counterparty_outbound_htlc_minimum_msat: value - .clone() - .counterparty_outbound_htlc_minimum_msat, - counterparty_outbound_htlc_maximum_msat: value - .clone() - .counterparty_outbound_htlc_maximum_msat, - counterparty_forwarding_info_fee_base_msat: value - .clone() - .counterparty_forwarding_info_fee_base_msat, - counterparty_forwarding_info_fee_proportional_millionths: value - .counterparty_forwarding_info_fee_proportional_millionths, - counterparty_forwarding_info_cltv_expiry_delta: value - .counterparty_forwarding_info_cltv_expiry_delta, - next_outbound_htlc_limit_msat: value.next_outbound_htlc_limit_msat, - next_outbound_htlc_minimum_msat: value.next_outbound_htlc_minimum_msat, - force_close_spend_delay: value.force_close_spend_delay, - inbound_htlc_minimum_msat: value.inbound_htlc_minimum_msat, - inbound_htlc_maximum_msat: value.inbound_htlc_maximum_msat, - config: (*value.config).clone().into(), } } } @@ -900,24 +697,13 @@ pub enum Network { Regtest, } -impl From for ldk_node::bitcoin::Network { +impl From for ldk_node::Network { fn from(value: Network) -> Self { match value { - Network::Bitcoin => ldk_node::bitcoin::Network::Bitcoin, - Network::Testnet => ldk_node::bitcoin::Network::Testnet, - Network::Signet => ldk_node::bitcoin::Network::Signet, - Network::Regtest => ldk_node::bitcoin::Network::Regtest, - } - } -} -impl From for Network { - fn from(value: ldk_node::bitcoin::Network) -> Self { - match value { - ldk_node::bitcoin::Network::Bitcoin => Network::Bitcoin, - ldk_node::bitcoin::Network::Testnet => Network::Testnet, - ldk_node::bitcoin::Network::Signet => Network::Signet, - ldk_node::bitcoin::Network::Regtest => Network::Regtest, - _ => Network::Bitcoin, + Network::Bitcoin => ldk_node::Network::Bitcoin, + Network::Testnet => ldk_node::Network::Testnet, + Network::Signet => ldk_node::Network::Signet, + Network::Regtest => ldk_node::Network::Regtest, } } } @@ -984,74 +770,9 @@ impl From for ldk_node::LogLevel { } } -impl From for LogLevel { - fn from(value: ldk_node::LogLevel) -> Self { - match value { - ldk_node::LogLevel::Gossip => LogLevel::Gossip, - ldk_node::LogLevel::Trace => LogLevel::Trace, - ldk_node::LogLevel::Debug => LogLevel::Debug, - ldk_node::LogLevel::Info => LogLevel::Info, - ldk_node::LogLevel::Warn => LogLevel::Warn, - ldk_node::LogLevel::Error => LogLevel::Error, - } - } -} -impl From for ldk_node::Config { - fn from(value: Config) -> Self { - ldk_node::Config { - storage_dir_path: value.storage_dir_path, - log_dir_path: value.log_dir_path, - network: value.network.into(), - listening_addresses: value.listening_addresses.map(|vec_socket_addr| { - vec_socket_addr - .into_iter() - .map(|socket_addr| socket_addr.into()) - .collect() - }), - default_cltv_expiry_delta: value.default_cltv_expiry_delta, - onchain_wallet_sync_interval_secs: value.onchain_wallet_sync_interval_secs, - wallet_sync_interval_secs: value.wallet_sync_interval_secs, - fee_rate_cache_update_interval_secs: value.fee_rate_cache_update_interval_secs, - trusted_peers_0conf: value - .trusted_peers_0conf - .into_iter() - .map(|x| x.into()) - .collect(), - log_level: value.log_level.into(), - probing_liquidity_limit_multiplier: value.probing_liquidity_limit_multiplier, - } - } -} - -impl From for Config { - fn from(value: ldk_node::Config) -> Self { - Config { - storage_dir_path: value.storage_dir_path, - log_dir_path: value.log_dir_path, - network: value.network.into(), - listening_addresses: value.listening_addresses.map(|vec_socket_addr| { - vec_socket_addr - .into_iter() - .map(|socket_addr| socket_addr.into()) - .collect() - }), - default_cltv_expiry_delta: value.default_cltv_expiry_delta, - onchain_wallet_sync_interval_secs: value.onchain_wallet_sync_interval_secs, - wallet_sync_interval_secs: value.wallet_sync_interval_secs, - fee_rate_cache_update_interval_secs: value.fee_rate_cache_update_interval_secs, - trusted_peers_0conf: value - .trusted_peers_0conf - .into_iter() - .map(|x| x.into()) - .collect(), - log_level: value.log_level.into(), - probing_liquidity_limit_multiplier: value.probing_liquidity_limit_multiplier, - } - } -} /// Represents the configuration of an [Node] instance. /// -#[frb(serialize)] +#[frb] #[derive(Debug, Clone)] pub struct Config { #[frb(non_final)] @@ -1099,7 +820,49 @@ pub struct Config { #[frb(non_final)] pub log_level: LogLevel, } +impl TryFrom for ldk_node::Config { + type Error = BuilderException; + fn try_from(value: Config) -> Result { + let addresses = if let Some(addresses) = value.listening_addresses { + let addr_vec: Result< + Vec, + BuilderException, + > = addresses + .into_iter() + .map(|socket_addr| socket_addr.try_into()) + .collect(); + Some(addr_vec?) + } else { + None + }; + let trusted_peers_0conf: Result< + Vec, + BuilderException, + > = value + .trusted_peers_0conf + .into_iter() + .map(|x| { + x.try_into() + .map_err(|_| BuilderException::InvalidTrustedPeer) + }) + .collect(); + + Ok(ldk_node::Config { + storage_dir_path: value.storage_dir_path, + log_dir_path: value.log_dir_path, + network: value.network.into(), + listening_addresses: addresses, + default_cltv_expiry_delta: value.default_cltv_expiry_delta, + onchain_wallet_sync_interval_secs: value.onchain_wallet_sync_interval_secs, + wallet_sync_interval_secs: value.wallet_sync_interval_secs, + fee_rate_cache_update_interval_secs: value.fee_rate_cache_update_interval_secs, + trusted_peers_0conf: trusted_peers_0conf?, + log_level: value.log_level.into(), + probing_liquidity_limit_multiplier: value.probing_liquidity_limit_multiplier, + }) + } +} impl Default for Config { fn default() -> Self { Self { @@ -1128,7 +891,7 @@ pub enum EntropySourceConfig { SeedFile(String), SeedBytes([u8; 64]), Bip39Mnemonic { - mnemonic: MnemonicBase, + mnemonic: LdkMnemonic, passphrase: Option, }, } @@ -1139,385 +902,6 @@ pub enum GossipSourceConfig { RapidGossipSync(String), } -#[derive(Debug, Clone)] -pub struct LiquiditySourceConfig { - // LSPS2 service's (address, node_id, token) - pub lsps2_service: (SocketAddress, PublicKey, Option), -} -impl From for BalanceDetails { - fn from(value: ldk_node::BalanceDetails) -> Self { - Self { - total_onchain_balance_sats: value.total_onchain_balance_sats, - spendable_onchain_balance_sats: value.spendable_onchain_balance_sats, - total_lightning_balance_sats: value.total_lightning_balance_sats, - lightning_balances: value - .lightning_balances - .iter() - .map(|e| e.clone().into()) - .collect(), - pending_balances_from_channel_closures: value - .pending_balances_from_channel_closures - .iter() - .map(|e| e.clone().into()) - .collect(), - } - } -} -/// Details of the known available balances returned by [`Node::list_balances`]. -/// -/// [`Node::list_balances`]: crate::Node::list_balances -#[derive(Debug, Clone)] -pub struct BalanceDetails { - /// The total balance of our on-chain wallet. - pub total_onchain_balance_sats: u64, - /// The currently spendable balance of our on-chain wallet. - pub spendable_onchain_balance_sats: u64, - /// The total balance that we would be able to claim across all our Lightning channels. - /// - /// Note this excludes balances that we are unsure if we are able to claim (e.g., as we are - pub total_lightning_balance_sats: u64, - /// A detailed list of all known Lightning balances that would be claimable on channel closure. - /// - /// Note that less than the listed amounts are spendable over lightning as further reserve - /// restrictions apply. - pub lightning_balances: Vec, - /// A detailed list of balances currently being swept from the Lightning to the on-chain - /// wallet. - /// - /// These are balances resulting from channel closures that may have been encumbered by a - /// delay, but are now being claimed and useable once sufficiently confirmed on-chain. - /// - /// Note that, depending on the sync status of the wallets, swept balances listed here might or - /// might not already be accounted for in `totalOnchainBalanceSats`. - pub pending_balances_from_channel_closures: Vec, -} - -/// Details about the status of a known Lightning balance. -#[derive(Debug, Clone)] -pub enum LightningBalance { - /// The channel is not yet closed (or the commitment or closing transaction has not yet - /// appeared in a block). The given balance is claimable (less on-chain fees) if the channel is - /// force-closed now. - ClaimableOnChannelClose { - /// The identifier of the channel this balance belongs to. - channel_id: ChannelId, - /// The identifier of our channel counterparty. - counterparty_node_id: PublicKey, - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - amount_satoshis: u64, - }, - /// The channel has been closed, and the given balance is ours but awaiting confirmations until - /// we consider it spendable. - ClaimableAwaitingConfirmations { - /// The identifier of the channel this balance belongs to. - channel_id: ChannelId, - /// The identifier of our channel counterparty. - counterparty_node_id: PublicKey, - /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which - /// were spent in broadcasting the transaction. - amount_satoshis: u64, - /// The height at which an [`Event::SpendableOutputs`] event will be generated for this - /// amount. - /// - /// [`Event::SpendableOutputs`]: lightning::events::Event::SpendableOutputs - confirmation_height: u32, - }, - /// The channel has been closed, and the given balance should be ours but awaiting spending - /// transaction confirmation. If the spending transaction does not confirm in time, it is - /// possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain. - /// - /// Once the spending transaction confirms, before it has reached enough confirmations to be - /// considered safe from chain reorganizations, the balance will instead be provided via - /// `lightningBalance.claimableAwaitingConfirmations`. - ContentiousClaimable { - /// The identifier of the channel this balance belongs to. - channel_id: ChannelId, - /// The identifier of our channel counterparty. - counterparty_node_id: PublicKey, - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be - /// required to do so. - amount_satoshis: u64, - /// The height at which the counterparty may be able to claim the balance if we have not - /// done so. - timeout_height: u32, - /// The payment hash that locks this HTLC. - payment_hash: PaymentHash, - /// The preimage that can be used to claim this HTLC. - payment_preimage: PaymentPreimage, - }, - /// HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain - /// fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat - /// likely to be claimed by our counterparty before we do. - MaybeTimeoutClaimableHTLC { - /// The identifier of the channel this balance belongs to. - channel_id: ChannelId, - /// The identifier of our channel counterparty. - counterparty_node_id: PublicKey, - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - amount_satoshis: u64, - /// The height at which we will be able to claim the balance if our counterparty has not - /// done so. - claimable_height: u32, - /// The payment hash whose preimage our counterparty needs to claim this HTLC. - payment_hash: PaymentHash, - }, - /// HTLCs which we received from our counterparty which are claimable with a preimage which we - /// do not currently have. This will only be claimable if we receive the preimage from the node - /// to which we forwarded this HTLC before the timeout. - MaybePreimageClaimableHTLC { - /// The identifier of the channel this balance belongs to. - channel_id: ChannelId, - /// The identifier of our channel counterparty. - counterparty_node_id: PublicKey, - /// The amount potentially available to claim, in satoshis, excluding the on-chain fees - /// which will be required to do so. - amount_satoshis: u64, - /// The height at which our counterparty will be able to claim the balance if we have not - /// yet received the preimage and claimed it ourselves. - expiry_height: u32, - /// The payment hash whose preimage we need to claim this HTLC. - payment_hash: PaymentHash, - }, - /// The channel has been closed, and our counterparty broadcasted a revoked commitment - /// transaction. - /// - /// Thus, we're able to claim all outputs in the commitment transaction, one of which has the - /// following amount. - CounterpartyRevokedOutputClaimable { - /// The identifier of the channel this balance belongs to. - channel_id: ChannelId, - /// The identifier of our channel counterparty. - counterparty_node_id: PublicKey, - /// The amount, in satoshis, of the output which we can claim. - amount_satoshis: u64, - }, -} -impl From for LightningBalance { - fn from(value: ldk_node::LightningBalance) -> Self { - match value { - ldk_node::LightningBalance::ClaimableOnChannelClose { - channel_id, - counterparty_node_id, - amount_satoshis, - } => LightningBalance::ClaimableOnChannelClose { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - amount_satoshis, - }, - ldk_node::LightningBalance::ClaimableAwaitingConfirmations { - channel_id, - counterparty_node_id, - amount_satoshis, - confirmation_height, - } => LightningBalance::ClaimableAwaitingConfirmations { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - amount_satoshis, - confirmation_height, - }, - ldk_node::LightningBalance::ContentiousClaimable { - channel_id, - counterparty_node_id, - amount_satoshis, - timeout_height, - payment_hash, - payment_preimage, - } => LightningBalance::ContentiousClaimable { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - amount_satoshis, - timeout_height, - payment_hash: payment_hash.into(), - payment_preimage: payment_preimage.into(), - }, - ldk_node::LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id, - counterparty_node_id, - amount_satoshis, - claimable_height, - payment_hash, - } => LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - amount_satoshis, - claimable_height, - payment_hash: payment_hash.into(), - }, - ldk_node::LightningBalance::MaybePreimageClaimableHTLC { - channel_id, - counterparty_node_id, - amount_satoshis, - expiry_height, - payment_hash, - } => LightningBalance::MaybePreimageClaimableHTLC { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - amount_satoshis, - expiry_height, - payment_hash: payment_hash.into(), - }, - ldk_node::LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id, - counterparty_node_id, - amount_satoshis, - } => LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id: channel_id.into(), - counterparty_node_id: counterparty_node_id.into(), - amount_satoshis, - }, - } - } -} - -/// Details about the status of a known balance currently being swept to our on-chain wallet. -#[derive(Debug, Clone)] -pub enum PendingSweepBalance { - /// The spendable output is about to be swept, but a spending transaction has yet to be generated and - /// broadcast. - PendingBroadcast { - /// The identifier of the channel this balance belongs to. - channel_id: Option, - /// The amount, in satoshis, of the output being swept. - amount_satoshis: u64, - }, - /// A spending transaction has been generated and broadcast and is awaiting confirmation - /// on-chain. - BroadcastAwaitingConfirmation { - /// The identifier of the channel this balance belongs to. - channel_id: Option, - /// The best height when we last broadcast a transaction spending the output being swept. - latest_broadcast_height: u32, - /// The identifier of the transaction spending the swept output we last broadcast. - latest_spending_txid: Txid, - /// The amount, in satoshis, of the output being swept. - amount_satoshis: u64, - }, - /// A spending transaction has been confirmed on-chain and is awaiting threshold confirmations. - /// - /// It will be considered irrevocably confirmed after reaching [`ANTI_REORG_DELAY`]. - /// - /// [`ANTI_REORG_DELAY`]: lightning::chain::channelmonitor::ANTI_REORG_DELAY - AwaitingThresholdConfirmations { - /// The identifier of the channel this balance belongs to. - channel_id: Option, - /// The identifier of the confirmed transaction spending the swept output. - latest_spending_txid: Txid, - /// The hash of the block in which the spending transaction was confirmed. - confirmation_hash: String, - /// The height at which the spending transaction was confirmed. - confirmation_height: u32, - /// The amount, in satoshis, of the output being swept. - amount_satoshis: u64, - }, -} - -impl From for PendingSweepBalance { - fn from(value: ldk_node::PendingSweepBalance) -> Self { - match value { - ldk_node::PendingSweepBalance::PendingBroadcast { - channel_id, - amount_satoshis, - } => PendingSweepBalance::PendingBroadcast { - channel_id: channel_id.map(|e| e.into()), - amount_satoshis, - }, - ldk_node::PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id, - latest_broadcast_height, - latest_spending_txid, - amount_satoshis, - } => PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id: channel_id.map(|e| e.into()), - latest_broadcast_height, - latest_spending_txid: latest_spending_txid.into(), - amount_satoshis, - }, - ldk_node::PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id, - latest_spending_txid, - confirmation_hash, - confirmation_height, - amount_satoshis, - } => PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id: channel_id.map(|e| e.into()), - latest_spending_txid: latest_spending_txid.into(), - confirmation_hash: confirmation_hash.to_string(), - confirmation_height, - amount_satoshis, - }, - } - } -} -/// The best known block as identified by its hash and height. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct BestBlock { - /// The block's hash - pub block_hash: String, - /// The height at which the block was confirmed. - pub height: u32, -} - -impl From for BestBlock { - fn from(value: ldk_node::BestBlock) -> Self { - BestBlock { - block_hash: value.block_hash.to_string(), - height: value.height, - } - } -} -/// Represents the status of the [Node]. -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct NodeStatus { - /// Indicates whether the [Node] is running. - pub is_running: bool, - /// Indicates whether the [Node] is listening for incoming connections on the addresses - /// configured via `config.listeningAddresses`. - pub is_listening: bool, - /// The best block to which our Lightning wallet is currently synced. - pub current_best_block: BestBlock, - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced - /// our Lightning wallet to the chain tip. - /// - /// Will be `None` if the wallet hasn't been synced since the [Node] was initialized. - pub latest_wallet_sync_timestamp: Option, - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced - /// our on-chain wallet to the chain tip. - /// - /// Will be `None` if the wallet hasn't been synced since the [Node] was initialized. - pub latest_onchain_wallet_sync_timestamp: Option, - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully update - /// our fee rate cache. - /// - /// Will be `None` if the cache hasn't been updated since the [Node] was initialized. - pub latest_fee_rate_cache_update_timestamp: Option, - /// The timestamp, in seconds since start of the UNIX epoch, when the last rapid gossip sync - /// (RGS) snapshot we successfully applied was generated. - /// - /// Will be `None` if RGS isn't configured or the snapshot hasn't been updated since the [Node] was initialized. - pub latest_rgs_snapshot_timestamp: Option, - /// The timestamp, in seconds since start of the UNIX epoch, when we last broadcasted a node - /// announcement. - /// - /// Will be `None` if we have no public channels or we haven't broadcasted since the [Node] was initialized. - pub latest_node_announcement_broadcast_timestamp: Option, -} -impl From for NodeStatus { - fn from(value: ldk_node::NodeStatus) -> Self { - Self { - is_running: value.is_running, - is_listening: value.is_listening, - current_best_block: value.current_best_block.into(), - latest_wallet_sync_timestamp: value.latest_wallet_sync_timestamp, - latest_onchain_wallet_sync_timestamp: value.latest_onchain_wallet_sync_timestamp, - latest_fee_rate_cache_update_timestamp: value.latest_fee_rate_cache_update_timestamp, - latest_rgs_snapshot_timestamp: value.latest_rgs_snapshot_timestamp, - latest_node_announcement_broadcast_timestamp: value - .latest_node_announcement_broadcast_timestamp, - } - } -} // Config defaults const DEFAULT_STORAGE_DIR_PATH: &str = "/tmp/ldk_node/"; const DEFAULT_NETWORK: Network = Network::Testnet; diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index a170d9e..22a3cb7 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // Section: imports @@ -36,29 +36,6 @@ impl CstDecode for wire_cst_address { } } } -impl CstDecode for wire_cst_balance_details { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::BalanceDetails { - crate::api::types::BalanceDetails { - total_onchain_balance_sats: self.total_onchain_balance_sats.cst_decode(), - spendable_onchain_balance_sats: self.spendable_onchain_balance_sats.cst_decode(), - total_lightning_balance_sats: self.total_lightning_balance_sats.cst_decode(), - lightning_balances: self.lightning_balances.cst_decode(), - pending_balances_from_channel_closures: self - .pending_balances_from_channel_closures - .cst_decode(), - } - } -} -impl CstDecode for wire_cst_best_block { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::BestBlock { - crate::api::types::BestBlock { - block_hash: self.block_hash.cst_decode(), - height: self.height.cst_decode(), - } - } -} impl CstDecode for wire_cst_bolt_11_invoice { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::Bolt11Invoice { @@ -104,13 +81,6 @@ impl CstDecode for *mut wire_cst_channel_id { CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_closure_reason { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ClosureReason { - let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() - } -} impl CstDecode for *mut wire_cst_config { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::Config { @@ -139,32 +109,18 @@ impl CstDecode for *mut wire_cst_gossip_s CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_liquidity_source_config { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LiquiditySourceConfig { - let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() - } -} -impl CstDecode for *mut wire_cst_max_dust_htlc_exposure { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::MaxDustHTLCExposure { - let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() - } -} -impl CstDecode for *mut wire_cst_mnemonic_base { +impl CstDecode for *mut wire_cst_ldk_mnemonic { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::MnemonicBase { + fn cst_decode(self) -> crate::api::node::LdkMnemonic { let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() + CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_node_base { +impl CstDecode for *mut wire_cst_ldk_node { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::NodeBase { + fn cst_decode(self) -> crate::api::node::LdkNode { let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() + CstDecode::::cst_decode(*wrap).into() } } impl CstDecode for *mut wire_cst_out_point { @@ -181,13 +137,6 @@ impl CstDecode for *mut wire_cst_payment_deta CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentFailureReason { - let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() - } -} impl CstDecode for *mut wire_cst_payment_hash { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentHash { @@ -223,19 +172,6 @@ impl CstDecode for *mut wire_cst_socket_addres CstDecode::::cst_decode(*wrap).into() } } -impl CstDecode for *mut wire_cst_txid { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Txid { - let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; - CstDecode::::cst_decode(*wrap).into() - } -} -impl CstDecode for *mut u16 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u16 { - unsafe { *flutter_rust_bridge::for_generated::box_from_leak_ptr(self) } - } -} impl CstDecode for *mut u32 { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> u32 { @@ -295,6 +231,7 @@ impl CstDecode for wire_cst_channel_details { unspendable_punishment_reserve: self.unspendable_punishment_reserve.cst_decode(), user_channel_id: self.user_channel_id.cst_decode(), feerate_sat_per_1000_weight: self.feerate_sat_per_1000_weight.cst_decode(), + balance_msat: self.balance_msat.cst_decode(), outbound_capacity_msat: self.outbound_capacity_msat.cst_decode(), inbound_capacity_msat: self.inbound_capacity_msat.cst_decode(), confirmations_required: self.confirmations_required.cst_decode(), @@ -303,31 +240,6 @@ impl CstDecode for wire_cst_channel_details { is_channel_ready: self.is_channel_ready.cst_decode(), is_usable: self.is_usable.cst_decode(), is_public: self.is_public.cst_decode(), - cltv_expiry_delta: self.cltv_expiry_delta.cst_decode(), - counterparty_unspendable_punishment_reserve: self - .counterparty_unspendable_punishment_reserve - .cst_decode(), - counterparty_outbound_htlc_minimum_msat: self - .counterparty_outbound_htlc_minimum_msat - .cst_decode(), - counterparty_outbound_htlc_maximum_msat: self - .counterparty_outbound_htlc_maximum_msat - .cst_decode(), - counterparty_forwarding_info_fee_base_msat: self - .counterparty_forwarding_info_fee_base_msat - .cst_decode(), - counterparty_forwarding_info_fee_proportional_millionths: self - .counterparty_forwarding_info_fee_proportional_millionths - .cst_decode(), - counterparty_forwarding_info_cltv_expiry_delta: self - .counterparty_forwarding_info_cltv_expiry_delta - .cst_decode(), - next_outbound_htlc_limit_msat: self.next_outbound_htlc_limit_msat.cst_decode(), - next_outbound_htlc_minimum_msat: self.next_outbound_htlc_minimum_msat.cst_decode(), - force_close_spend_delay: self.force_close_spend_delay.cst_decode(), - inbound_htlc_minimum_msat: self.inbound_htlc_minimum_msat.cst_decode(), - inbound_htlc_maximum_msat: self.inbound_htlc_maximum_msat.cst_decode(), - config: self.config.cst_decode(), } } } @@ -339,34 +251,6 @@ impl CstDecode for wire_cst_channel_id { } } } -impl CstDecode for wire_cst_closure_reason { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ClosureReason { - match self.tag { - 0 => { - let ans = unsafe { self.kind.CounterpartyForceClosed }; - crate::api::types::ClosureReason::CounterpartyForceClosed { - peer_msg: ans.peer_msg.cst_decode(), - } - } - 1 => crate::api::types::ClosureReason::HolderForceClosed, - 2 => crate::api::types::ClosureReason::CooperativeClosure, - 3 => crate::api::types::ClosureReason::CommitmentTxConfirmed, - 4 => crate::api::types::ClosureReason::FundingTimedOut, - 5 => { - let ans = unsafe { self.kind.ProcessingError }; - crate::api::types::ClosureReason::ProcessingError { - err: ans.err.cst_decode(), - } - } - 6 => crate::api::types::ClosureReason::DisconnectedPeer, - 7 => crate::api::types::ClosureReason::OutdatedChannelManager, - 8 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, - 9 => crate::api::types::ClosureReason::FundingBatchClosure, - _ => unreachable!(), - } - } -} impl CstDecode for wire_cst_config { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::Config { @@ -420,14 +304,12 @@ impl CstDecode for wire_cst_event { let ans = unsafe { self.kind.PaymentSuccessful }; crate::api::types::Event::PaymentSuccessful { payment_hash: ans.payment_hash.cst_decode(), - fee_paid_msat: ans.fee_paid_msat.cst_decode(), } } 1 => { let ans = unsafe { self.kind.PaymentFailed }; crate::api::types::Event::PaymentFailed { payment_hash: ans.payment_hash.cst_decode(), - reason: ans.reason.cst_decode(), } } 2 => { @@ -438,30 +320,29 @@ impl CstDecode for wire_cst_event { } } 3 => { - let ans = unsafe { self.kind.ChannelPending }; - crate::api::types::Event::ChannelPending { + let ans = unsafe { self.kind.ChannelReady }; + crate::api::types::Event::ChannelReady { channel_id: ans.channel_id.cst_decode(), user_channel_id: ans.user_channel_id.cst_decode(), - former_temporary_channel_id: ans.former_temporary_channel_id.cst_decode(), counterparty_node_id: ans.counterparty_node_id.cst_decode(), - funding_txo: ans.funding_txo.cst_decode(), } } 4 => { - let ans = unsafe { self.kind.ChannelReady }; - crate::api::types::Event::ChannelReady { + let ans = unsafe { self.kind.ChannelClosed }; + crate::api::types::Event::ChannelClosed { channel_id: ans.channel_id.cst_decode(), user_channel_id: ans.user_channel_id.cst_decode(), counterparty_node_id: ans.counterparty_node_id.cst_decode(), } } 5 => { - let ans = unsafe { self.kind.ChannelClosed }; - crate::api::types::Event::ChannelClosed { + let ans = unsafe { self.kind.ChannelPending }; + crate::api::types::Event::ChannelPending { channel_id: ans.channel_id.cst_decode(), user_channel_id: ans.user_channel_id.cst_decode(), + former_temporary_channel_id: ans.former_temporary_channel_id.cst_decode(), counterparty_node_id: ans.counterparty_node_id.cst_decode(), - reason: ans.reason.cst_decode(), + funding_txo: ans.funding_txo.cst_decode(), } } _ => unreachable!(), @@ -481,75 +362,19 @@ impl CstDecode for wire_cst_gossip_source } } } -impl CstDecode for wire_cst_lightning_balance { +impl CstDecode for wire_cst_ldk_mnemonic { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LightningBalance { - match self.tag { - 0 => { - let ans = unsafe { self.kind.ClaimableOnChannelClose }; - crate::api::types::LightningBalance::ClaimableOnChannelClose { - channel_id: ans.channel_id.cst_decode(), - counterparty_node_id: ans.counterparty_node_id.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - } - } - 1 => { - let ans = unsafe { self.kind.ClaimableAwaitingConfirmations }; - crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { - channel_id: ans.channel_id.cst_decode(), - counterparty_node_id: ans.counterparty_node_id.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - confirmation_height: ans.confirmation_height.cst_decode(), - } - } - 2 => { - let ans = unsafe { self.kind.ContentiousClaimable }; - crate::api::types::LightningBalance::ContentiousClaimable { - channel_id: ans.channel_id.cst_decode(), - counterparty_node_id: ans.counterparty_node_id.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - timeout_height: ans.timeout_height.cst_decode(), - payment_hash: ans.payment_hash.cst_decode(), - payment_preimage: ans.payment_preimage.cst_decode(), - } - } - 3 => { - let ans = unsafe { self.kind.MaybeTimeoutClaimableHTLC }; - crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id: ans.channel_id.cst_decode(), - counterparty_node_id: ans.counterparty_node_id.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - claimable_height: ans.claimable_height.cst_decode(), - payment_hash: ans.payment_hash.cst_decode(), - } - } - 4 => { - let ans = unsafe { self.kind.MaybePreimageClaimableHTLC }; - crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { - channel_id: ans.channel_id.cst_decode(), - counterparty_node_id: ans.counterparty_node_id.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - expiry_height: ans.expiry_height.cst_decode(), - payment_hash: ans.payment_hash.cst_decode(), - } - } - 5 => { - let ans = unsafe { self.kind.CounterpartyRevokedOutputClaimable }; - crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id: ans.channel_id.cst_decode(), - counterparty_node_id: ans.counterparty_node_id.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - } - } - _ => unreachable!(), + fn cst_decode(self) -> crate::api::node::LdkMnemonic { + crate::api::node::LdkMnemonic { + seed_phrase: self.seed_phrase.cst_decode(), } } } -impl CstDecode for wire_cst_liquidity_source_config { +impl CstDecode for wire_cst_ldk_node { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LiquiditySourceConfig { - crate::api::types::LiquiditySourceConfig { - lsps2_service: self.lsps2_service.cst_decode(), + fn cst_decode(self) -> crate::api::node::LdkNode { + crate::api::node::LdkNode { + ptr: self.ptr.cst_decode(), } } } @@ -563,16 +388,6 @@ impl CstDecode> for *mut wire_cst_list_ch vec.into_iter().map(CstDecode::cst_decode).collect() } } -impl CstDecode> for *mut wire_cst_list_lightning_balance { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - let vec = unsafe { - let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); - flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) - }; - vec.into_iter().map(CstDecode::cst_decode).collect() - } -} impl CstDecode> for *mut wire_cst_list_payment_details { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -593,18 +408,6 @@ impl CstDecode> for *mut wire_cst_list_peer_ vec.into_iter().map(CstDecode::cst_decode).collect() } } -impl CstDecode> - for *mut wire_cst_list_pending_sweep_balance -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - let vec = unsafe { - let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); - flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) - }; - vec.into_iter().map(CstDecode::cst_decode).collect() - } -} impl CstDecode> for *mut wire_cst_list_prim_u_8_loose { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -659,43 +462,6 @@ impl CstDecode for wire_cst_max_dust_htl } } } -impl CstDecode for wire_cst_mnemonic_base { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::MnemonicBase { - crate::api::node::MnemonicBase { - seed_phrase: self.seed_phrase.cst_decode(), - } - } -} -impl CstDecode for wire_cst_node_base { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::NodeBase { - crate::api::node::NodeBase { - ptr: self.ptr.cst_decode(), - } - } -} -impl CstDecode for wire_cst_node_status { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::NodeStatus { - crate::api::types::NodeStatus { - is_running: self.is_running.cst_decode(), - is_listening: self.is_listening.cst_decode(), - current_best_block: self.current_best_block.cst_decode(), - latest_wallet_sync_timestamp: self.latest_wallet_sync_timestamp.cst_decode(), - latest_onchain_wallet_sync_timestamp: self - .latest_onchain_wallet_sync_timestamp - .cst_decode(), - latest_fee_rate_cache_update_timestamp: self - .latest_fee_rate_cache_update_timestamp - .cst_decode(), - latest_rgs_snapshot_timestamp: self.latest_rgs_snapshot_timestamp.cst_decode(), - latest_node_announcement_broadcast_timestamp: self - .latest_node_announcement_broadcast_timestamp - .cst_decode(), - } - } -} impl CstDecode for wire_cst_out_point { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::OutPoint { @@ -752,70 +518,14 @@ impl CstDecode for wire_cst_peer_details { } } } -impl CstDecode for wire_cst_pending_sweep_balance { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PendingSweepBalance { - match self.tag { - 0 => { - let ans = unsafe { self.kind.PendingBroadcast }; - crate::api::types::PendingSweepBalance::PendingBroadcast { - channel_id: ans.channel_id.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - } - } - 1 => { - let ans = unsafe { self.kind.BroadcastAwaitingConfirmation }; - crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id: ans.channel_id.cst_decode(), - latest_broadcast_height: ans.latest_broadcast_height.cst_decode(), - latest_spending_txid: ans.latest_spending_txid.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - } - } - 2 => { - let ans = unsafe { self.kind.AwaitingThresholdConfirmations }; - crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id: ans.channel_id.cst_decode(), - latest_spending_txid: ans.latest_spending_txid.cst_decode(), - confirmation_hash: ans.confirmation_hash.cst_decode(), - confirmation_height: ans.confirmation_height.cst_decode(), - amount_satoshis: ans.amount_satoshis.cst_decode(), - } - } - _ => unreachable!(), - } - } -} impl CstDecode for wire_cst_public_key { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PublicKey { crate::api::types::PublicKey { - hex_code: self.hex_code.cst_decode(), + hex: self.hex.cst_decode(), } } } -impl - CstDecode<( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - )> for wire_cst_record_socket_address_public_key_opt_string -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode( - self, - ) -> ( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - ) { - ( - self.field0.cst_decode(), - self.field1.cst_decode(), - self.field2.cst_decode(), - ) - } -} impl CstDecode for wire_cst_socket_address { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::SocketAddress { @@ -921,35 +631,6 @@ impl Default for wire_cst_address { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_balance_details { - fn new_with_null_ptr() -> Self { - Self { - total_onchain_balance_sats: Default::default(), - spendable_onchain_balance_sats: Default::default(), - total_lightning_balance_sats: Default::default(), - lightning_balances: core::ptr::null_mut(), - pending_balances_from_channel_closures: core::ptr::null_mut(), - } - } -} -impl Default for wire_cst_balance_details { - fn default() -> Self { - Self::new_with_null_ptr() - } -} -impl NewWithNullPtr for wire_cst_best_block { - fn new_with_null_ptr() -> Self { - Self { - block_hash: core::ptr::null_mut(), - height: Default::default(), - } - } -} -impl Default for wire_cst_best_block { - fn default() -> Self { - Self::new_with_null_ptr() - } -} impl NewWithNullPtr for wire_cst_bolt_11_invoice { fn new_with_null_ptr() -> Self { Self { @@ -981,7 +662,7 @@ impl NewWithNullPtr for wire_cst_channel_config { forwarding_fee_proportional_millionths: Default::default(), forwarding_fee_base_msat: Default::default(), cltv_expiry_delta: Default::default(), - max_dust_htlc_exposure: core::ptr::null_mut(), + max_dust_htlc_exposure: Default::default(), force_close_avoidance_max_fee_satoshis: Default::default(), accept_underpaying_htlcs: Default::default(), } @@ -1002,6 +683,7 @@ impl NewWithNullPtr for wire_cst_channel_details { unspendable_punishment_reserve: core::ptr::null_mut(), user_channel_id: Default::default(), feerate_sat_per_1000_weight: Default::default(), + balance_msat: Default::default(), outbound_capacity_msat: Default::default(), inbound_capacity_msat: Default::default(), confirmations_required: core::ptr::null_mut(), @@ -1010,19 +692,6 @@ impl NewWithNullPtr for wire_cst_channel_details { is_channel_ready: Default::default(), is_usable: Default::default(), is_public: Default::default(), - cltv_expiry_delta: core::ptr::null_mut(), - counterparty_unspendable_punishment_reserve: Default::default(), - counterparty_outbound_htlc_minimum_msat: core::ptr::null_mut(), - counterparty_outbound_htlc_maximum_msat: core::ptr::null_mut(), - counterparty_forwarding_info_fee_base_msat: core::ptr::null_mut(), - counterparty_forwarding_info_fee_proportional_millionths: core::ptr::null_mut(), - counterparty_forwarding_info_cltv_expiry_delta: core::ptr::null_mut(), - next_outbound_htlc_limit_msat: Default::default(), - next_outbound_htlc_minimum_msat: Default::default(), - force_close_spend_delay: core::ptr::null_mut(), - inbound_htlc_minimum_msat: Default::default(), - inbound_htlc_maximum_msat: core::ptr::null_mut(), - config: Default::default(), } } } @@ -1043,19 +712,6 @@ impl Default for wire_cst_channel_id { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_closure_reason { - fn new_with_null_ptr() -> Self { - Self { - tag: -1, - kind: ClosureReasonKind { nil__: () }, - } - } -} -impl Default for wire_cst_closure_reason { - fn default() -> Self { - Self::new_with_null_ptr() - } -} impl NewWithNullPtr for wire_cst_config { fn new_with_null_ptr() -> Self { Self { @@ -1117,27 +773,26 @@ impl Default for wire_cst_gossip_source_config { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_lightning_balance { +impl NewWithNullPtr for wire_cst_ldk_mnemonic { fn new_with_null_ptr() -> Self { Self { - tag: -1, - kind: LightningBalanceKind { nil__: () }, + seed_phrase: core::ptr::null_mut(), } } } -impl Default for wire_cst_lightning_balance { +impl Default for wire_cst_ldk_mnemonic { fn default() -> Self { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_liquidity_source_config { +impl NewWithNullPtr for wire_cst_ldk_node { fn new_with_null_ptr() -> Self { Self { - lsps2_service: Default::default(), + ptr: Default::default(), } } } -impl Default for wire_cst_liquidity_source_config { +impl Default for wire_cst_ldk_node { fn default() -> Self { Self::new_with_null_ptr() } @@ -1155,49 +810,6 @@ impl Default for wire_cst_max_dust_htlc_exposure { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_mnemonic_base { - fn new_with_null_ptr() -> Self { - Self { - seed_phrase: core::ptr::null_mut(), - } - } -} -impl Default for wire_cst_mnemonic_base { - fn default() -> Self { - Self::new_with_null_ptr() - } -} -impl NewWithNullPtr for wire_cst_node_base { - fn new_with_null_ptr() -> Self { - Self { - ptr: Default::default(), - } - } -} -impl Default for wire_cst_node_base { - fn default() -> Self { - Self::new_with_null_ptr() - } -} -impl NewWithNullPtr for wire_cst_node_status { - fn new_with_null_ptr() -> Self { - Self { - is_running: Default::default(), - is_listening: Default::default(), - current_best_block: Default::default(), - latest_wallet_sync_timestamp: core::ptr::null_mut(), - latest_onchain_wallet_sync_timestamp: core::ptr::null_mut(), - latest_fee_rate_cache_update_timestamp: core::ptr::null_mut(), - latest_rgs_snapshot_timestamp: core::ptr::null_mut(), - latest_node_announcement_broadcast_timestamp: core::ptr::null_mut(), - } - } -} -impl Default for wire_cst_node_status { - fn default() -> Self { - Self::new_with_null_ptr() - } -} impl NewWithNullPtr for wire_cst_out_point { fn new_with_null_ptr() -> Self { Self { @@ -1278,23 +890,10 @@ impl Default for wire_cst_peer_details { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_pending_sweep_balance { - fn new_with_null_ptr() -> Self { - Self { - tag: -1, - kind: PendingSweepBalanceKind { nil__: () }, - } - } -} -impl Default for wire_cst_pending_sweep_balance { - fn default() -> Self { - Self::new_with_null_ptr() - } -} impl NewWithNullPtr for wire_cst_public_key { fn new_with_null_ptr() -> Self { Self { - hex_code: core::ptr::null_mut(), + hex: core::ptr::null_mut(), } } } @@ -1303,20 +902,6 @@ impl Default for wire_cst_public_key { Self::new_with_null_ptr() } } -impl NewWithNullPtr for wire_cst_record_socket_address_public_key_opt_string { - fn new_with_null_ptr() -> Self { - Self { - field0: Default::default(), - field1: Default::default(), - field2: core::ptr::null_mut(), - } - } -} -impl Default for wire_cst_record_socket_address_public_key_opt_string { - fn default() -> Self { - Self::new_with_null_ptr() - } -} impl NewWithNullPtr for wire_cst_socket_address { fn new_with_null_ptr() -> Self { Self { @@ -1345,7 +930,7 @@ impl Default for wire_cst_txid { impl NewWithNullPtr for wire_cst_user_channel_id { fn new_with_null_ptr() -> Self { Self { - data: core::ptr::null_mut(), + data: Default::default(), } } } @@ -1356,51 +941,63 @@ impl Default for wire_cst_user_channel_id { } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_MnemonicBase_generate(port_: i64) { - wire_MnemonicBase_generate_impl(port_) +pub extern "C" fn frbgen_ldk_node_wire_build_with_sqlite_store( + port_: i64, + config: *mut wire_cst_config, + chain_data_source_config: *mut wire_cst_chain_data_source_config, + entropy_source_config: *mut wire_cst_entropy_source_config, + gossip_source_config: *mut wire_cst_gossip_source_config, +) { + wire_build_with_sqlite_store_impl( + port_, + config, + chain_data_source_config, + entropy_source_config, + gossip_source_config, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_mnemonic_generate(port_: i64) { + wire_ldk_mnemonic_generate_impl(port_) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_close_channel( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_close_channel( port_: i64, - that: *mut wire_cst_node_base, - user_channel_id: *mut wire_cst_user_channel_id, + that: *mut wire_cst_ldk_node, + channel_id: *mut wire_cst_channel_id, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_NodeBase_close_channel_impl(port_, that, user_channel_id, counterparty_node_id) + wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_config(port_: i64, that: *mut wire_cst_node_base) { - wire_NodeBase_config_impl(port_, that) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_connect( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, node_id: *mut wire_cst_public_key, address: *mut wire_cst_socket_address, persist: bool, ) { - wire_NodeBase_connect_impl(port_, that, node_id, address, persist) + wire_ldk_node_connect_impl(port_, that, node_id, address, persist) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_connect_open_channel( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_connect_open_channel( port_: i64, - that: *mut wire_cst_node_base, - address: *mut wire_cst_socket_address, + that: *mut wire_cst_ldk_node, + socket_address: *mut wire_cst_socket_address, node_id: *mut wire_cst_public_key, channel_amount_sats: u64, push_to_counterparty_msat: *mut u64, announce_channel: bool, channel_config: *mut wire_cst_channel_config, ) { - wire_NodeBase_connect_open_channel_impl( + wire_ldk_node_connect_open_channel_impl( port_, that, - address, + socket_address, node_id, channel_amount_sats, push_to_counterparty_msat, @@ -1410,337 +1007,301 @@ pub extern "C" fn frbgen_ldk_node_wire_NodeBase_connect_open_channel( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_disconnect( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_disconnect( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, counterparty_node_id: *mut wire_cst_public_key, ) { - wire_NodeBase_disconnect_impl(port_, that, counterparty_node_id) + wire_ldk_node_disconnect_impl(port_, that, counterparty_node_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_event_handled( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_event_handled( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_event_handled_impl(port_, that) + wire_ldk_node_event_handled_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_list_balances( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_is_running( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_list_balances_impl(port_, that) + wire_ldk_node_is_running_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_list_channels( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_channels( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_list_channels_impl(port_, that) + wire_ldk_node_list_channels_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_list_payments( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_list_payments_impl(port_, that) + wire_ldk_node_list_payments_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_list_payments_with_filter( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_payments_with_filter( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, payment_direction: i32, ) { - wire_NodeBase_list_payments_with_filter_impl(port_, that, payment_direction) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_list_peers( - port_: i64, - that: *mut wire_cst_node_base, -) { - wire_NodeBase_list_peers_impl(port_, that) + wire_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_listening_addresses( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_list_peers( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_listening_addresses_impl(port_, that) + wire_ldk_node_list_peers_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_new_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_listening_addresses( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_new_onchain_address_impl(port_, that) + wire_ldk_node_listening_addresses_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_next_event( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_new_onchain_address( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_next_event_impl(port_, that) + wire_ldk_node_new_onchain_address_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_next_event_async( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_next_event( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_next_event_async_impl(port_, that) + wire_ldk_node_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_node_id(port_: i64, that: *mut wire_cst_node_base) { - wire_NodeBase_node_id_impl(port_, that) +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_node_id(port_: i64, that: *mut wire_cst_ldk_node) { + wire_ldk_node_node_id_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_payment( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, payment_hash: *mut wire_cst_payment_hash, ) { - wire_NodeBase_payment_impl(port_, that, payment_hash) + wire_ldk_node_payment_impl(port_, that, payment_hash) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_receive_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_payment( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, amount_msat: u64, description: *mut wire_cst_list_prim_u_8_strict, expiry_secs: u32, ) { - wire_NodeBase_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) + wire_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_receive_payment_via_jit_channel( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_receive_variable_amount_payment( port_: i64, - that: *mut wire_cst_node_base, - amount_msat: u64, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, - max_total_lsp_fee_limit_msat: *mut u64, -) { - wire_NodeBase_receive_payment_via_jit_channel_impl( - port_, - that, - amount_msat, - description, - expiry_secs, - max_total_lsp_fee_limit_msat, - ) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment( - port_: i64, - that: *mut wire_cst_node_base, - description: *mut wire_cst_list_prim_u_8_strict, - expiry_secs: u32, -) { - wire_NodeBase_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_receive_variable_amount_payment_via_jit_channel( - port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, description: *mut wire_cst_list_prim_u_8_strict, expiry_secs: u32, - max_proportional_lsp_fee_limit_ppm_msat: *mut u64, ) { - wire_NodeBase_receive_variable_amount_payment_via_jit_channel_impl( - port_, - that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat, - ) + wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_remove_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_remove_payment( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, payment_hash: *mut wire_cst_payment_hash, ) { - wire_NodeBase_remove_payment_impl(port_, that, payment_hash) + wire_ldk_node_remove_payment_impl(port_, that, payment_hash) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_all_to_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_all_to_onchain_address( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, address: *mut wire_cst_address, ) { - wire_NodeBase_send_all_to_onchain_address_impl(port_, that, address) + wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_NodeBase_send_payment_impl(port_, that, invoice) + wire_ldk_node_send_payment_impl(port_, that, invoice) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_probes( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, invoice: *mut wire_cst_bolt_11_invoice, ) { - wire_NodeBase_send_payment_probes_impl(port_, that, invoice) + wire_ldk_node_send_payment_probes_impl(port_, that, invoice) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_payment_probes_using_amount( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_probes_using_amount( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, invoice: *mut wire_cst_bolt_11_invoice, amount_msat: u64, ) { - wire_NodeBase_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_payment_using_amount( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_payment_using_amount( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, invoice: *mut wire_cst_bolt_11_invoice, amount_msat: u64, ) { - wire_NodeBase_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_NodeBase_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_spontaneous_payment_probes( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_spontaneous_payment_probes( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, amount_msat: u64, node_id: *mut wire_cst_public_key, ) { - wire_NodeBase_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_send_to_onchain_address( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_send_to_onchain_address( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, address: *mut wire_cst_address, amount_sats: u64, ) { - wire_NodeBase_send_to_onchain_address_impl(port_, that, address, amount_sats) + wire_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_sign_message( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sign_message( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, msg: *mut wire_cst_list_prim_u_8_loose, ) { - wire_NodeBase_sign_message_impl(port_, that, msg) + wire_ldk_node_sign_message_impl(port_, that, msg) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_start(port_: i64, that: *mut wire_cst_node_base) { - wire_NodeBase_start_impl(port_, that) +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_spendable_onchain_balance_sats( + port_: i64, + that: *mut wire_cst_ldk_node, +) { + wire_ldk_node_spendable_onchain_balance_sats_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_status(port_: i64, that: *mut wire_cst_node_base) { - wire_NodeBase_status_impl(port_, that) +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_start(port_: i64, that: *mut wire_cst_ldk_node) { + wire_ldk_node_start_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_stop(port_: i64, that: *mut wire_cst_node_base) { - wire_NodeBase_stop_impl(port_, that) +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_stop(port_: i64, that: *mut wire_cst_ldk_node) { + wire_ldk_node_stop_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_sync_wallets( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_sync_wallets( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_sync_wallets_impl(port_, that) + wire_ldk_node_sync_wallets_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_update_channel_config( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_total_onchain_balance_sats( port_: i64, - that: *mut wire_cst_node_base, - user_channel_id: *mut wire_cst_user_channel_id, + that: *mut wire_cst_ldk_node, +) { + wire_ldk_node_total_onchain_balance_sats_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_update_channel_config( + port_: i64, + that: *mut wire_cst_ldk_node, + channel_id: *mut wire_cst_channel_id, counterparty_node_id: *mut wire_cst_public_key, channel_config: *mut wire_cst_channel_config, ) { - wire_NodeBase_update_channel_config_impl( + wire_ldk_node_update_channel_config_impl( port_, that, - user_channel_id, + channel_id, counterparty_node_id, channel_config, ) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_verify_signature( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_verify_signature( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, msg: *mut wire_cst_list_prim_u_8_loose, sig: *mut wire_cst_list_prim_u_8_strict, pkey: *mut wire_cst_public_key, ) { - wire_NodeBase_verify_signature_impl(port_, that, msg, sig, pkey) + wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_NodeBase_wait_next_event( +pub extern "C" fn frbgen_ldk_node_wire_ldk_node_wait_next_event( port_: i64, - that: *mut wire_cst_node_base, + that: *mut wire_cst_ldk_node, ) { - wire_NodeBase_wait_next_event_impl(port_, that) + wire_ldk_node_wait_next_event_impl(port_, that) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_wire_finalize_builder( +pub extern "C" fn frbgen_ldk_node_wire_socket_address_as_string( port_: i64, - config: *mut wire_cst_config, - chain_data_source_config: *mut wire_cst_chain_data_source_config, - entropy_source_config: *mut wire_cst_entropy_source_config, - gossip_source_config: *mut wire_cst_gossip_source_config, - liquidity_source_config: *mut wire_cst_liquidity_source_config, + that: *mut wire_cst_socket_address, ) { - wire_finalize_builder_impl( - port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config, - ) + wire_socket_address_as_string_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_ldk_node_wire_socket_address_from_str( + port_: i64, + address: *mut wire_cst_list_prim_u_8_strict, +) { + wire_socket_address_from_str_impl(port_, address) } #[no_mangle] @@ -1795,14 +1356,6 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_channel_id() -> *mut wire_ flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_channel_id::new_with_null_ptr()) } -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_closure_reason( -) -> *mut wire_cst_closure_reason { - flutter_rust_bridge::for_generated::new_leak_box_ptr( - wire_cst_closure_reason::new_with_null_ptr(), - ) -} - #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_config() -> *mut wire_cst_config { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_config::new_with_null_ptr()) @@ -1830,30 +1383,13 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_gossip_source_config( } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_liquidity_source_config( -) -> *mut wire_cst_liquidity_source_config { - flutter_rust_bridge::for_generated::new_leak_box_ptr( - wire_cst_liquidity_source_config::new_with_null_ptr(), - ) +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_mnemonic() -> *mut wire_cst_ldk_mnemonic { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ldk_mnemonic::new_with_null_ptr()) } #[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_max_dust_htlc_exposure( -) -> *mut wire_cst_max_dust_htlc_exposure { - flutter_rust_bridge::for_generated::new_leak_box_ptr( - wire_cst_max_dust_htlc_exposure::new_with_null_ptr(), - ) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_mnemonic_base() -> *mut wire_cst_mnemonic_base -{ - flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_mnemonic_base::new_with_null_ptr()) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_node_base() -> *mut wire_cst_node_base { - flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_base::new_with_null_ptr()) +pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_ldk_node() -> *mut wire_cst_ldk_node { + flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ldk_node::new_with_null_ptr()) } #[no_mangle] @@ -1869,13 +1405,6 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_details( ) } -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_failure_reason( - value: i32, -) -> *mut i32 { - flutter_rust_bridge::for_generated::new_leak_box_ptr(value) -} - #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_payment_hash() -> *mut wire_cst_payment_hash { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_payment_hash::new_with_null_ptr()) @@ -1910,16 +1439,6 @@ pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_socket_address( ) } -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_txid() -> *mut wire_cst_txid { - flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_txid::new_with_null_ptr()) -} - -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_u_16(value: u16) -> *mut u16 { - flutter_rust_bridge::for_generated::new_leak_box_ptr(value) -} - #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_box_autoadd_u_32(value: u32) -> *mut u32 { flutter_rust_bridge::for_generated::new_leak_box_ptr(value) @@ -1952,20 +1471,6 @@ pub extern "C" fn frbgen_ldk_node_cst_new_list_channel_details( flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_list_lightning_balance( - len: i32, -) -> *mut wire_cst_list_lightning_balance { - let wrap = wire_cst_list_lightning_balance { - ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( - ::new_with_null_ptr(), - len, - ), - len, - }; - flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) -} - #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_list_payment_details( len: i32, @@ -1994,20 +1499,6 @@ pub extern "C" fn frbgen_ldk_node_cst_new_list_peer_details( flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } -#[no_mangle] -pub extern "C" fn frbgen_ldk_node_cst_new_list_pending_sweep_balance( - len: i32, -) -> *mut wire_cst_list_pending_sweep_balance { - let wrap = wire_cst_list_pending_sweep_balance { - ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( - ::new_with_null_ptr(), - len, - ), - len, - }; - flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) -} - #[no_mangle] pub extern "C" fn frbgen_ldk_node_cst_new_list_prim_u_8_loose( len: i32, @@ -2065,21 +1556,6 @@ pub struct wire_cst_address { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_balance_details { - total_onchain_balance_sats: u64, - spendable_onchain_balance_sats: u64, - total_lightning_balance_sats: u64, - lightning_balances: *mut wire_cst_list_lightning_balance, - pending_balances_from_channel_closures: *mut wire_cst_list_pending_sweep_balance, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_best_block { - block_hash: *mut wire_cst_list_prim_u_8_strict, - height: u32, -} -#[repr(C)] -#[derive(Clone, Copy)] pub struct wire_cst_bolt_11_invoice { signed_raw_invoice: *mut wire_cst_list_prim_u_8_strict, } @@ -2106,7 +1582,7 @@ pub struct wire_cst_channel_config { forwarding_fee_proportional_millionths: u32, forwarding_fee_base_msat: u32, cltv_expiry_delta: u16, - max_dust_htlc_exposure: *mut wire_cst_max_dust_htlc_exposure, + max_dust_htlc_exposure: wire_cst_max_dust_htlc_exposure, force_close_avoidance_max_fee_satoshis: u64, accept_underpaying_htlcs: bool, } @@ -2115,11 +1591,12 @@ pub struct wire_cst_channel_config { pub struct wire_cst_channel_details { channel_id: wire_cst_channel_id, counterparty_node_id: wire_cst_public_key, - funding_txo: *mut wire_cst_out_point, + funding_txo: *mut wire_cst_list_prim_u_8_strict, channel_value_sats: u64, unspendable_punishment_reserve: *mut u64, user_channel_id: wire_cst_user_channel_id, feerate_sat_per_1000_weight: u32, + balance_msat: u64, outbound_capacity_msat: u64, inbound_capacity_msat: u64, confirmations_required: *mut u32, @@ -2128,19 +1605,6 @@ pub struct wire_cst_channel_details { is_channel_ready: bool, is_usable: bool, is_public: bool, - cltv_expiry_delta: *mut u16, - counterparty_unspendable_punishment_reserve: u64, - counterparty_outbound_htlc_minimum_msat: *mut u64, - counterparty_outbound_htlc_maximum_msat: *mut u64, - counterparty_forwarding_info_fee_base_msat: *mut u32, - counterparty_forwarding_info_fee_proportional_millionths: *mut u32, - counterparty_forwarding_info_cltv_expiry_delta: *mut u16, - next_outbound_htlc_limit_msat: u64, - next_outbound_htlc_minimum_msat: u64, - force_close_spend_delay: *mut u16, - inbound_htlc_minimum_msat: u64, - inbound_htlc_maximum_msat: *mut u64, - config: wire_cst_channel_config, } #[repr(C)] #[derive(Clone, Copy)] @@ -2149,29 +1613,6 @@ pub struct wire_cst_channel_id { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_closure_reason { - tag: i32, - kind: ClosureReasonKind, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub union ClosureReasonKind { - CounterpartyForceClosed: wire_cst_ClosureReason_CounterpartyForceClosed, - ProcessingError: wire_cst_ClosureReason_ProcessingError, - nil__: (), -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_ClosureReason_CounterpartyForceClosed { - peer_msg: *mut wire_cst_list_prim_u_8_strict, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_ClosureReason_ProcessingError { - err: *mut wire_cst_list_prim_u_8_strict, -} -#[repr(C)] -#[derive(Clone, Copy)] pub struct wire_cst_config { storage_dir_path: *mut wire_cst_list_prim_u_8_strict, log_dir_path: *mut wire_cst_list_prim_u_8_strict, @@ -2212,7 +1653,7 @@ pub struct wire_cst_EntropySourceConfig_SeedBytes { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_EntropySourceConfig_Bip39Mnemonic { - mnemonic: *mut wire_cst_mnemonic_base, + mnemonic: *mut wire_cst_ldk_mnemonic, passphrase: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] @@ -2227,22 +1668,20 @@ pub union EventKind { PaymentSuccessful: wire_cst_Event_PaymentSuccessful, PaymentFailed: wire_cst_Event_PaymentFailed, PaymentReceived: wire_cst_Event_PaymentReceived, - ChannelPending: wire_cst_Event_ChannelPending, ChannelReady: wire_cst_Event_ChannelReady, ChannelClosed: wire_cst_Event_ChannelClosed, + ChannelPending: wire_cst_Event_ChannelPending, nil__: (), } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentSuccessful { payment_hash: *mut wire_cst_payment_hash, - fee_paid_msat: *mut u64, } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_Event_PaymentFailed { payment_hash: *mut wire_cst_payment_hash, - reason: *mut i32, } #[repr(C)] #[derive(Clone, Copy)] @@ -2252,27 +1691,26 @@ pub struct wire_cst_Event_PaymentReceived { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelPending { +pub struct wire_cst_Event_ChannelReady { channel_id: *mut wire_cst_channel_id, user_channel_id: *mut wire_cst_user_channel_id, - former_temporary_channel_id: *mut wire_cst_channel_id, counterparty_node_id: *mut wire_cst_public_key, - funding_txo: *mut wire_cst_out_point, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelReady { +pub struct wire_cst_Event_ChannelClosed { channel_id: *mut wire_cst_channel_id, user_channel_id: *mut wire_cst_user_channel_id, counterparty_node_id: *mut wire_cst_public_key, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_Event_ChannelClosed { +pub struct wire_cst_Event_ChannelPending { channel_id: *mut wire_cst_channel_id, user_channel_id: *mut wire_cst_user_channel_id, + former_temporary_channel_id: *mut wire_cst_channel_id, counterparty_node_id: *mut wire_cst_public_key, - reason: *mut wire_cst_closure_reason, + funding_txo: *mut wire_cst_out_point, } #[repr(C)] #[derive(Clone, Copy)] @@ -2293,76 +1731,13 @@ pub struct wire_cst_GossipSourceConfig_RapidGossipSync { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_lightning_balance { - tag: i32, - kind: LightningBalanceKind, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub union LightningBalanceKind { - ClaimableOnChannelClose: wire_cst_LightningBalance_ClaimableOnChannelClose, - ClaimableAwaitingConfirmations: wire_cst_LightningBalance_ClaimableAwaitingConfirmations, - ContentiousClaimable: wire_cst_LightningBalance_ContentiousClaimable, - MaybeTimeoutClaimableHTLC: wire_cst_LightningBalance_MaybeTimeoutClaimableHTLC, - MaybePreimageClaimableHTLC: wire_cst_LightningBalance_MaybePreimageClaimableHTLC, - CounterpartyRevokedOutputClaimable: - wire_cst_LightningBalance_CounterpartyRevokedOutputClaimable, - nil__: (), -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_LightningBalance_ClaimableOnChannelClose { - channel_id: *mut wire_cst_channel_id, - counterparty_node_id: *mut wire_cst_public_key, - amount_satoshis: u64, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_LightningBalance_ClaimableAwaitingConfirmations { - channel_id: *mut wire_cst_channel_id, - counterparty_node_id: *mut wire_cst_public_key, - amount_satoshis: u64, - confirmation_height: u32, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_LightningBalance_ContentiousClaimable { - channel_id: *mut wire_cst_channel_id, - counterparty_node_id: *mut wire_cst_public_key, - amount_satoshis: u64, - timeout_height: u32, - payment_hash: *mut wire_cst_payment_hash, - payment_preimage: *mut wire_cst_payment_preimage, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_LightningBalance_MaybeTimeoutClaimableHTLC { - channel_id: *mut wire_cst_channel_id, - counterparty_node_id: *mut wire_cst_public_key, - amount_satoshis: u64, - claimable_height: u32, - payment_hash: *mut wire_cst_payment_hash, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_LightningBalance_MaybePreimageClaimableHTLC { - channel_id: *mut wire_cst_channel_id, - counterparty_node_id: *mut wire_cst_public_key, - amount_satoshis: u64, - expiry_height: u32, - payment_hash: *mut wire_cst_payment_hash, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_LightningBalance_CounterpartyRevokedOutputClaimable { - channel_id: *mut wire_cst_channel_id, - counterparty_node_id: *mut wire_cst_public_key, - amount_satoshis: u64, +pub struct wire_cst_ldk_mnemonic { + seed_phrase: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_liquidity_source_config { - lsps2_service: wire_cst_record_socket_address_public_key_opt_string, +pub struct wire_cst_ldk_node { + ptr: usize, } #[repr(C)] #[derive(Clone, Copy)] @@ -2372,12 +1747,6 @@ pub struct wire_cst_list_channel_details { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_list_lightning_balance { - ptr: *mut wire_cst_lightning_balance, - len: i32, -} -#[repr(C)] -#[derive(Clone, Copy)] pub struct wire_cst_list_payment_details { ptr: *mut wire_cst_payment_details, len: i32, @@ -2390,12 +1759,6 @@ pub struct wire_cst_list_peer_details { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_list_pending_sweep_balance { - ptr: *mut wire_cst_pending_sweep_balance, - len: i32, -} -#[repr(C)] -#[derive(Clone, Copy)] pub struct wire_cst_list_prim_u_8_loose { ptr: *mut u8, len: i32, @@ -2443,28 +1806,6 @@ pub struct wire_cst_MaxDustHTLCExposure_FeeRateMultiplier { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_mnemonic_base { - seed_phrase: *mut wire_cst_list_prim_u_8_strict, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_node_base { - ptr: usize, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_node_status { - is_running: bool, - is_listening: bool, - current_best_block: wire_cst_best_block, - latest_wallet_sync_timestamp: *mut u64, - latest_onchain_wallet_sync_timestamp: *mut u64, - latest_fee_rate_cache_update_timestamp: *mut u64, - latest_rgs_snapshot_timestamp: *mut u64, - latest_node_announcement_broadcast_timestamp: *mut u64, -} -#[repr(C)] -#[derive(Clone, Copy)] pub struct wire_cst_out_point { txid: wire_cst_txid, vout: u32, @@ -2503,52 +1844,8 @@ pub struct wire_cst_peer_details { } #[repr(C)] #[derive(Clone, Copy)] -pub struct wire_cst_pending_sweep_balance { - tag: i32, - kind: PendingSweepBalanceKind, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub union PendingSweepBalanceKind { - PendingBroadcast: wire_cst_PendingSweepBalance_PendingBroadcast, - BroadcastAwaitingConfirmation: wire_cst_PendingSweepBalance_BroadcastAwaitingConfirmation, - AwaitingThresholdConfirmations: wire_cst_PendingSweepBalance_AwaitingThresholdConfirmations, - nil__: (), -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_PendingSweepBalance_PendingBroadcast { - channel_id: *mut wire_cst_channel_id, - amount_satoshis: u64, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_PendingSweepBalance_BroadcastAwaitingConfirmation { - channel_id: *mut wire_cst_channel_id, - latest_broadcast_height: u32, - latest_spending_txid: *mut wire_cst_txid, - amount_satoshis: u64, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_PendingSweepBalance_AwaitingThresholdConfirmations { - channel_id: *mut wire_cst_channel_id, - latest_spending_txid: *mut wire_cst_txid, - confirmation_hash: *mut wire_cst_list_prim_u_8_strict, - confirmation_height: u32, - amount_satoshis: u64, -} -#[repr(C)] -#[derive(Clone, Copy)] pub struct wire_cst_public_key { - hex_code: *mut wire_cst_list_prim_u_8_strict, -} -#[repr(C)] -#[derive(Clone, Copy)] -pub struct wire_cst_record_socket_address_public_key_opt_string { - field0: wire_cst_socket_address, - field1: wire_cst_public_key, - field2: *mut wire_cst_list_prim_u_8_strict, + hex: *mut wire_cst_list_prim_u_8_strict, } #[repr(C)] #[derive(Clone, Copy)] @@ -2605,5 +1902,5 @@ pub struct wire_cst_txid { #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_user_channel_id { - data: *mut wire_cst_list_prim_u_8_strict, + data: u64, } diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 47977df..1478aaa 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. #![allow( non_camel_case_types, @@ -31,7 +31,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueNom, default_rust_auto_opaque = RustAutoOpaqueNom, ); -const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.28"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.31"; // Section: executor @@ -39,80 +39,91 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs -fn wire_MnemonicBase_generate_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { +fn wire_build_with_sqlite_store_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + config: impl CstDecode, + chain_data_source_config: impl CstDecode>, + entropy_source_config: impl CstDecode>, + gossip_source_config: impl CstDecode>, +) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "MnemonicBase_generate", + debug_name: "build_with_sqlite_store", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { + let api_config = config.cst_decode(); + let api_chain_data_source_config = chain_data_source_config.cst_decode(); + let api_entropy_source_config = entropy_source_config.cst_decode(); + let api_gossip_source_config = gossip_source_config.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::MnemonicBase::generate()) + crate::api::node::build_with_sqlite_store( + api_config, + api_chain_data_source_config, + api_entropy_source_config, + api_gossip_source_config, + ) })()) } }, ) } -fn wire_NodeBase_close_channel_impl( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - user_channel_id: impl CstDecode, - counterparty_node_id: impl CstDecode, -) { +fn wire_ldk_mnemonic_generate_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_close_channel", + debug_name: "ldk_mnemonic_generate", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_that = that.cst_decode(); - let api_user_channel_id = user_channel_id.cst_decode(); - let api_counterparty_node_id = counterparty_node_id.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::close_channel( - &api_that, - api_user_channel_id, - api_counterparty_node_id, - ) + Result::<_, ()>::Ok(crate::api::node::LdkMnemonic::generate()) })()) } }, ) } -fn wire_NodeBase_config_impl( +fn wire_ldk_node_close_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, + channel_id: impl CstDecode, + counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_config", + debug_name: "ldk_node_close_channel", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); + let api_channel_id = channel_id.cst_decode(); + let api_counterparty_node_id = counterparty_node_id.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::config(&api_that)) + crate::api::node::LdkNode::close_channel( + &api_that, + api_channel_id, + api_counterparty_node_id, + ) })()) } }, ) } -fn wire_NodeBase_connect_impl( +fn wire_ldk_node_connect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, node_id: impl CstDecode, address: impl CstDecode, persist: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_connect", + debug_name: "ldk_node_connect", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -123,7 +134,7 @@ fn wire_NodeBase_connect_impl( let api_persist = persist.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::connect( + crate::api::node::LdkNode::connect( &api_that, api_node_id, api_address, @@ -134,10 +145,10 @@ fn wire_NodeBase_connect_impl( }, ) } -fn wire_NodeBase_connect_open_channel_impl( +fn wire_ldk_node_connect_open_channel_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - address: impl CstDecode, + that: impl CstDecode, + socket_address: impl CstDecode, node_id: impl CstDecode, channel_amount_sats: impl CstDecode, push_to_counterparty_msat: impl CstDecode>, @@ -146,13 +157,13 @@ fn wire_NodeBase_connect_open_channel_impl( ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_connect_open_channel", + debug_name: "ldk_node_connect_open_channel", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_address = address.cst_decode(); + let api_socket_address = socket_address.cst_decode(); let api_node_id = node_id.cst_decode(); let api_channel_amount_sats = channel_amount_sats.cst_decode(); let api_push_to_counterparty_msat = push_to_counterparty_msat.cst_decode(); @@ -160,9 +171,9 @@ fn wire_NodeBase_connect_open_channel_impl( let api_channel_config = channel_config.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::connect_open_channel( + crate::api::node::LdkNode::connect_open_channel( &api_that, - api_address, + api_socket_address, api_node_id, api_channel_amount_sats, api_push_to_counterparty_msat, @@ -174,14 +185,14 @@ fn wire_NodeBase_connect_open_channel_impl( }, ) } -fn wire_NodeBase_disconnect_impl( +fn wire_ldk_node_disconnect_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, counterparty_node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_disconnect", + debug_name: "ldk_node_disconnect", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -190,19 +201,19 @@ fn wire_NodeBase_disconnect_impl( let api_counterparty_node_id = counterparty_node_id.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::disconnect(&api_that, api_counterparty_node_id) + crate::api::node::LdkNode::disconnect(&api_that, api_counterparty_node_id) })()) } }, ) } -fn wire_NodeBase_event_handled_impl( +fn wire_ldk_node_event_handled_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_event_handled", + debug_name: "ldk_node_event_handled", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -210,19 +221,19 @@ fn wire_NodeBase_event_handled_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::event_handled(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::event_handled(&api_that)) })()) } }, ) } -fn wire_NodeBase_list_balances_impl( +fn wire_ldk_node_is_running_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_list_balances", + debug_name: "ldk_node_is_running", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -230,19 +241,19 @@ fn wire_NodeBase_list_balances_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::list_balances(&api_that) + Result::<_, ()>::Ok(crate::api::node::LdkNode::is_running(&api_that)) })()) } }, ) } -fn wire_NodeBase_list_channels_impl( +fn wire_ldk_node_list_channels_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_list_channels", + debug_name: "ldk_node_list_channels", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -250,19 +261,19 @@ fn wire_NodeBase_list_channels_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::list_channels(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_channels(&api_that)) })()) } }, ) } -fn wire_NodeBase_list_payments_impl( +fn wire_ldk_node_list_payments_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_list_payments", + debug_name: "ldk_node_list_payments", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -270,20 +281,20 @@ fn wire_NodeBase_list_payments_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::list_payments(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments(&api_that)) })()) } }, ) } -fn wire_NodeBase_list_payments_with_filter_impl( +fn wire_ldk_node_list_payments_with_filter_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, payment_direction: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_list_payments_with_filter", + debug_name: "ldk_node_list_payments_with_filter", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -292,7 +303,7 @@ fn wire_NodeBase_list_payments_with_filter_impl( let api_payment_direction = payment_direction.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::list_payments_with_filter( + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_payments_with_filter( &api_that, api_payment_direction, )) @@ -301,13 +312,13 @@ fn wire_NodeBase_list_payments_with_filter_impl( }, ) } -fn wire_NodeBase_list_peers_impl( +fn wire_ldk_node_list_peers_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_list_peers", + debug_name: "ldk_node_list_peers", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -315,19 +326,19 @@ fn wire_NodeBase_list_peers_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::list_peers(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::list_peers(&api_that)) })()) } }, ) } -fn wire_NodeBase_listening_addresses_impl( +fn wire_ldk_node_listening_addresses_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_listening_addresses", + debug_name: "ldk_node_listening_addresses", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -335,19 +346,19 @@ fn wire_NodeBase_listening_addresses_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::listening_addresses(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::listening_addresses(&api_that)) })()) } }, ) } -fn wire_NodeBase_new_onchain_address_impl( +fn wire_ldk_node_new_onchain_address_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_new_onchain_address", + debug_name: "ldk_node_new_onchain_address", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -355,19 +366,19 @@ fn wire_NodeBase_new_onchain_address_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::new_onchain_address(&api_that) + crate::api::node::LdkNode::new_onchain_address(&api_that) })()) } }, ) } -fn wire_NodeBase_next_event_impl( +fn wire_ldk_node_next_event_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_next_event", + debug_name: "ldk_node_next_event", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -375,44 +386,19 @@ fn wire_NodeBase_next_event_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::next_event(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::next_event(&api_that)) })()) } }, ) } -fn wire_NodeBase_next_event_async_impl( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, -) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( - flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_next_event_async", - port: Some(port_), - mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, - }, - move || { - let api_that = that.cst_decode(); - move |context| async move { - transform_result_dco( - (move || async move { - Result::<_, ()>::Ok( - crate::api::node::NodeBase::next_event_async(&api_that).await, - ) - })() - .await, - ) - } - }, - ) -} -fn wire_NodeBase_node_id_impl( +fn wire_ldk_node_node_id_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_node_id", + debug_name: "ldk_node_node_id", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -420,20 +406,20 @@ fn wire_NodeBase_node_id_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::node_id(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::node_id(&api_that)) })()) } }, ) } -fn wire_NodeBase_payment_impl( +fn wire_ldk_node_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, payment_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_payment", + debug_name: "ldk_node_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -442,7 +428,7 @@ fn wire_NodeBase_payment_impl( let api_payment_hash = payment_hash.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::payment( + Result::<_, ()>::Ok(crate::api::node::LdkNode::payment( &api_that, api_payment_hash, )) @@ -451,48 +437,16 @@ fn wire_NodeBase_payment_impl( }, ) } -fn wire_NodeBase_receive_payment_impl( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - amount_msat: impl CstDecode, - description: impl CstDecode, - expiry_secs: impl CstDecode, -) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( - flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_receive_payment", - port: Some(port_), - mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, - }, - move || { - let api_that = that.cst_decode(); - let api_amount_msat = amount_msat.cst_decode(); - let api_description = description.cst_decode(); - let api_expiry_secs = expiry_secs.cst_decode(); - move |context| { - transform_result_dco((move || { - crate::api::node::NodeBase::receive_payment( - &api_that, - api_amount_msat, - api_description, - api_expiry_secs, - ) - })()) - } - }, - ) -} -fn wire_NodeBase_receive_payment_via_jit_channel_impl( +fn wire_ldk_node_receive_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, amount_msat: impl CstDecode, description: impl CstDecode, expiry_secs: impl CstDecode, - max_total_lsp_fee_limit_msat: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_receive_payment_via_jit_channel", + debug_name: "ldk_node_receive_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -501,59 +455,28 @@ fn wire_NodeBase_receive_payment_via_jit_channel_impl( let api_amount_msat = amount_msat.cst_decode(); let api_description = description.cst_decode(); let api_expiry_secs = expiry_secs.cst_decode(); - let api_max_total_lsp_fee_limit_msat = max_total_lsp_fee_limit_msat.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::receive_payment_via_jit_channel( + crate::api::node::LdkNode::receive_payment( &api_that, api_amount_msat, api_description, api_expiry_secs, - api_max_total_lsp_fee_limit_msat, - ) - })()) - } - }, - ) -} -fn wire_NodeBase_receive_variable_amount_payment_impl( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - description: impl CstDecode, - expiry_secs: impl CstDecode, -) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( - flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_receive_variable_amount_payment", - port: Some(port_), - mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, - }, - move || { - let api_that = that.cst_decode(); - let api_description = description.cst_decode(); - let api_expiry_secs = expiry_secs.cst_decode(); - move |context| { - transform_result_dco((move || { - crate::api::node::NodeBase::receive_variable_amount_payment( - &api_that, - api_description, - api_expiry_secs, ) })()) } }, ) } -fn wire_NodeBase_receive_variable_amount_payment_via_jit_channel_impl( +fn wire_ldk_node_receive_variable_amount_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, description: impl CstDecode, expiry_secs: impl CstDecode, - max_proportional_lsp_fee_limit_ppm_msat: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_receive_variable_amount_payment_via_jit_channel", + debug_name: "ldk_node_receive_variable_amount_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -561,29 +484,26 @@ fn wire_NodeBase_receive_variable_amount_payment_via_jit_channel_impl( let api_that = that.cst_decode(); let api_description = description.cst_decode(); let api_expiry_secs = expiry_secs.cst_decode(); - let api_max_proportional_lsp_fee_limit_ppm_msat = - max_proportional_lsp_fee_limit_ppm_msat.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::receive_variable_amount_payment_via_jit_channel( + crate::api::node::LdkNode::receive_variable_amount_payment( &api_that, api_description, api_expiry_secs, - api_max_proportional_lsp_fee_limit_ppm_msat, ) })()) } }, ) } -fn wire_NodeBase_remove_payment_impl( +fn wire_ldk_node_remove_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, payment_hash: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_remove_payment", + debug_name: "ldk_node_remove_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -592,20 +512,20 @@ fn wire_NodeBase_remove_payment_impl( let api_payment_hash = payment_hash.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::remove_payment(&api_that, api_payment_hash) + crate::api::node::LdkNode::remove_payment(&api_that, api_payment_hash) })()) } }, ) } -fn wire_NodeBase_send_all_to_onchain_address_impl( +fn wire_ldk_node_send_all_to_onchain_address_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, address: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_all_to_onchain_address", + debug_name: "ldk_node_send_all_to_onchain_address", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -614,20 +534,20 @@ fn wire_NodeBase_send_all_to_onchain_address_impl( let api_address = address.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_all_to_onchain_address(&api_that, api_address) + crate::api::node::LdkNode::send_all_to_onchain_address(&api_that, api_address) })()) } }, ) } -fn wire_NodeBase_send_payment_impl( +fn wire_ldk_node_send_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, invoice: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_payment", + debug_name: "ldk_node_send_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -636,20 +556,20 @@ fn wire_NodeBase_send_payment_impl( let api_invoice = invoice.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_payment(&api_that, api_invoice) + crate::api::node::LdkNode::send_payment(&api_that, api_invoice) })()) } }, ) } -fn wire_NodeBase_send_payment_probes_impl( +fn wire_ldk_node_send_payment_probes_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, invoice: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_payment_probes", + debug_name: "ldk_node_send_payment_probes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -658,21 +578,21 @@ fn wire_NodeBase_send_payment_probes_impl( let api_invoice = invoice.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_payment_probes(&api_that, api_invoice) + crate::api::node::LdkNode::send_payment_probes(&api_that, api_invoice) })()) } }, ) } -fn wire_NodeBase_send_payment_probes_using_amount_impl( +fn wire_ldk_node_send_payment_probes_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, invoice: impl CstDecode, amount_msat: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_payment_probes_using_amount", + debug_name: "ldk_node_send_payment_probes_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -682,7 +602,7 @@ fn wire_NodeBase_send_payment_probes_using_amount_impl( let api_amount_msat = amount_msat.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_payment_probes_using_amount( + crate::api::node::LdkNode::send_payment_probes_using_amount( &api_that, api_invoice, api_amount_msat, @@ -692,15 +612,15 @@ fn wire_NodeBase_send_payment_probes_using_amount_impl( }, ) } -fn wire_NodeBase_send_payment_using_amount_impl( +fn wire_ldk_node_send_payment_using_amount_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, invoice: impl CstDecode, amount_msat: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_payment_using_amount", + debug_name: "ldk_node_send_payment_using_amount", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -710,7 +630,7 @@ fn wire_NodeBase_send_payment_using_amount_impl( let api_amount_msat = amount_msat.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_payment_using_amount( + crate::api::node::LdkNode::send_payment_using_amount( &api_that, api_invoice, api_amount_msat, @@ -720,15 +640,15 @@ fn wire_NodeBase_send_payment_using_amount_impl( }, ) } -fn wire_NodeBase_send_spontaneous_payment_impl( +fn wire_ldk_node_send_spontaneous_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, amount_msat: impl CstDecode, node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_spontaneous_payment", + debug_name: "ldk_node_send_spontaneous_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -738,7 +658,7 @@ fn wire_NodeBase_send_spontaneous_payment_impl( let api_node_id = node_id.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_spontaneous_payment( + crate::api::node::LdkNode::send_spontaneous_payment( &api_that, api_amount_msat, api_node_id, @@ -748,15 +668,15 @@ fn wire_NodeBase_send_spontaneous_payment_impl( }, ) } -fn wire_NodeBase_send_spontaneous_payment_probes_impl( +fn wire_ldk_node_send_spontaneous_payment_probes_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, amount_msat: impl CstDecode, node_id: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_spontaneous_payment_probes", + debug_name: "ldk_node_send_spontaneous_payment_probes", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -766,7 +686,7 @@ fn wire_NodeBase_send_spontaneous_payment_probes_impl( let api_node_id = node_id.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_spontaneous_payment_probes( + crate::api::node::LdkNode::send_spontaneous_payment_probes( &api_that, api_amount_msat, api_node_id, @@ -776,15 +696,15 @@ fn wire_NodeBase_send_spontaneous_payment_probes_impl( }, ) } -fn wire_NodeBase_send_to_onchain_address_impl( +fn wire_ldk_node_send_to_onchain_address_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, address: impl CstDecode, amount_sats: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_send_to_onchain_address", + debug_name: "ldk_node_send_to_onchain_address", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -794,7 +714,7 @@ fn wire_NodeBase_send_to_onchain_address_impl( let api_amount_sats = amount_sats.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::send_to_onchain_address( + crate::api::node::LdkNode::send_to_onchain_address( &api_that, api_address, api_amount_sats, @@ -804,14 +724,14 @@ fn wire_NodeBase_send_to_onchain_address_impl( }, ) } -fn wire_NodeBase_sign_message_impl( +fn wire_ldk_node_sign_message_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, msg: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_sign_message", + debug_name: "ldk_node_sign_message", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -820,75 +740,93 @@ fn wire_NodeBase_sign_message_impl( let api_msg = msg.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::sign_message(&api_that, api_msg) + crate::api::node::LdkNode::sign_message(&api_that, api_msg) + })()) + } + }, + ) +} +fn wire_ldk_node_spendable_onchain_balance_sats_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ldk_node_spendable_onchain_balance_sats", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| { + transform_result_dco((move || { + crate::api::node::LdkNode::spendable_onchain_balance_sats(&api_that) })()) } }, ) } -fn wire_NodeBase_start_impl( +fn wire_ldk_node_start_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_start", + debug_name: "ldk_node_start", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || crate::api::node::NodeBase::start(&api_that))()) + transform_result_dco((move || crate::api::node::LdkNode::start(&api_that))()) } }, ) } -fn wire_NodeBase_status_impl( +fn wire_ldk_node_stop_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_status", + debug_name: "ldk_node_stop", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::status(&api_that)) - })()) + transform_result_dco((move || crate::api::node::LdkNode::stop(&api_that))()) } }, ) } -fn wire_NodeBase_stop_impl( +fn wire_ldk_node_sync_wallets_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_stop", + debug_name: "ldk_node_sync_wallets", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); move |context| { - transform_result_dco((move || crate::api::node::NodeBase::stop(&api_that))()) + transform_result_dco((move || crate::api::node::LdkNode::sync_wallets(&api_that))()) } }, ) } -fn wire_NodeBase_sync_wallets_impl( +fn wire_ldk_node_total_onchain_balance_sats_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_sync_wallets", + debug_name: "ldk_node_total_onchain_balance_sats", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -896,35 +834,35 @@ fn wire_NodeBase_sync_wallets_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::sync_wallets(&api_that) + crate::api::node::LdkNode::total_onchain_balance_sats(&api_that) })()) } }, ) } -fn wire_NodeBase_update_channel_config_impl( +fn wire_ldk_node_update_channel_config_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, - user_channel_id: impl CstDecode, + that: impl CstDecode, + channel_id: impl CstDecode, counterparty_node_id: impl CstDecode, channel_config: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_update_channel_config", + debug_name: "ldk_node_update_channel_config", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_that = that.cst_decode(); - let api_user_channel_id = user_channel_id.cst_decode(); + let api_channel_id = channel_id.cst_decode(); let api_counterparty_node_id = counterparty_node_id.cst_decode(); let api_channel_config = channel_config.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::update_channel_config( + crate::api::node::LdkNode::update_channel_config( &api_that, - api_user_channel_id, + api_channel_id, api_counterparty_node_id, api_channel_config, ) @@ -933,16 +871,16 @@ fn wire_NodeBase_update_channel_config_impl( }, ) } -fn wire_NodeBase_verify_signature_impl( +fn wire_ldk_node_verify_signature_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, msg: impl CstDecode>, sig: impl CstDecode, pkey: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_verify_signature", + debug_name: "ldk_node_verify_signature", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -953,7 +891,7 @@ fn wire_NodeBase_verify_signature_impl( let api_pkey = pkey.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::NodeBase::verify_signature( + crate::api::node::LdkNode::verify_signature( &api_that, api_msg, api_sig, api_pkey, ) })()) @@ -961,13 +899,13 @@ fn wire_NodeBase_verify_signature_impl( }, ) } -fn wire_NodeBase_wait_next_event_impl( +fn wire_ldk_node_wait_next_event_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - that: impl CstDecode, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "NodeBase_wait_next_event", + debug_name: "ldk_node_wait_next_event", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, @@ -975,41 +913,47 @@ fn wire_NodeBase_wait_next_event_impl( let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - Result::<_, ()>::Ok(crate::api::node::NodeBase::wait_next_event(&api_that)) + Result::<_, ()>::Ok(crate::api::node::LdkNode::wait_next_event(&api_that)) })()) } }, ) } -fn wire_finalize_builder_impl( +fn wire_socket_address_as_string_impl( port_: flutter_rust_bridge::for_generated::MessagePort, - config: impl CstDecode, - chain_data_source_config: impl CstDecode>, - entropy_source_config: impl CstDecode>, - gossip_source_config: impl CstDecode>, - liquidity_source_config: impl CstDecode>, + that: impl CstDecode, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "finalize_builder", + debug_name: "socket_address_as_string", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { - let api_config = config.cst_decode(); - let api_chain_data_source_config = chain_data_source_config.cst_decode(); - let api_entropy_source_config = entropy_source_config.cst_decode(); - let api_gossip_source_config = gossip_source_config.cst_decode(); - let api_liquidity_source_config = liquidity_source_config.cst_decode(); + let api_that = that.cst_decode(); move |context| { transform_result_dco((move || { - crate::api::node::finalize_builder( - api_config, - api_chain_data_source_config, - api_entropy_source_config, - api_gossip_source_config, - api_liquidity_source_config, - ) + Result::<_, ()>::Ok(crate::api::types::SocketAddress::as_string(&api_that)) + })()) + } + }, + ) +} +fn wire_socket_address_from_str_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + address: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "socket_address_from_str", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_address = address.cst_decode(); + move |context| { + transform_result_dco((move || { + crate::api::types::SocketAddress::from_str(api_address) })()) } }, @@ -1024,23 +968,24 @@ impl CstDecode for bool { self } } -impl CstDecode for i32 { +impl CstDecode for i32 { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::error::BuilderError { + fn cst_decode(self) -> crate::api::error::BuilderException { match self { - 0 => crate::api::error::BuilderError::SocketAddressParseError, - 1 => crate::api::error::BuilderError::InvalidSeedBytes, - 2 => crate::api::error::BuilderError::InvalidSeedFile, - 3 => crate::api::error::BuilderError::InvalidSystemTime, - 4 => crate::api::error::BuilderError::InvalidChannelMonitor, - 5 => crate::api::error::BuilderError::InvalidListeningAddresses, - 6 => crate::api::error::BuilderError::ReadFailed, - 7 => crate::api::error::BuilderError::WriteFailed, - 8 => crate::api::error::BuilderError::StoragePathAccessFailed, - 9 => crate::api::error::BuilderError::KVStoreSetupFailed, - 10 => crate::api::error::BuilderError::WalletSetupFailed, - 11 => crate::api::error::BuilderError::LoggerSetupFailed, - _ => unreachable!("Invalid variant for BuilderError: {}", self), + 0 => crate::api::error::BuilderException::SocketAddressParseError, + 1 => crate::api::error::BuilderException::InvalidSeedBytes, + 2 => crate::api::error::BuilderException::InvalidSeedFile, + 3 => crate::api::error::BuilderException::InvalidSystemTime, + 4 => crate::api::error::BuilderException::InvalidChannelMonitor, + 5 => crate::api::error::BuilderException::InvalidListeningAddress, + 6 => crate::api::error::BuilderException::ReadFailed, + 7 => crate::api::error::BuilderException::WriteFailed, + 8 => crate::api::error::BuilderException::StoragePathAccessFailed, + 9 => crate::api::error::BuilderException::KVStoreSetupFailed, + 10 => crate::api::error::BuilderException::WalletSetupFailed, + 11 => crate::api::error::BuilderException::LoggerSetupFailed, + 12 => crate::api::error::BuilderException::InvalidTrustedPeer, + _ => unreachable!("Invalid variant for BuilderException: {}", self), } } } @@ -1076,44 +1021,42 @@ impl CstDecode for i32 { } } } -impl CstDecode for i32 { +impl CstDecode for i32 { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::error::NodeBaseError { + fn cst_decode(self) -> crate::api::error::NodeException { match self { - 0 => crate::api::error::NodeBaseError::AlreadyRunning, - 1 => crate::api::error::NodeBaseError::NotRunning, - 2 => crate::api::error::NodeBaseError::OnchainTxCreationFailed, - 3 => crate::api::error::NodeBaseError::ConnectionFailed, - 4 => crate::api::error::NodeBaseError::InvoiceCreationFailed, - 5 => crate::api::error::NodeBaseError::PaymentSendingFailed, - 6 => crate::api::error::NodeBaseError::ProbeSendingFailed, - 7 => crate::api::error::NodeBaseError::ChannelCreationFailed, - 8 => crate::api::error::NodeBaseError::ChannelClosingFailed, - 9 => crate::api::error::NodeBaseError::ChannelConfigUpdateFailed, - 10 => crate::api::error::NodeBaseError::PersistenceFailed, - 11 => crate::api::error::NodeBaseError::WalletOperationFailed, - 12 => crate::api::error::NodeBaseError::OnchainTxSigningFailed, - 13 => crate::api::error::NodeBaseError::MessageSigningFailed, - 14 => crate::api::error::NodeBaseError::TxSyncFailed, - 15 => crate::api::error::NodeBaseError::GossipUpdateFailed, - 16 => crate::api::error::NodeBaseError::InvalidAddress, - 17 => crate::api::error::NodeBaseError::InvalidSocketAddress, - 18 => crate::api::error::NodeBaseError::InvalidPublicKey, - 19 => crate::api::error::NodeBaseError::InvalidSecretKey, - 20 => crate::api::error::NodeBaseError::InvalidPaymentHash, - 21 => crate::api::error::NodeBaseError::InvalidPaymentPreimage, - 22 => crate::api::error::NodeBaseError::InvalidPaymentSecret, - 23 => crate::api::error::NodeBaseError::InvalidAmount, - 24 => crate::api::error::NodeBaseError::InvalidInvoice, - 25 => crate::api::error::NodeBaseError::InvalidChannelId, - 26 => crate::api::error::NodeBaseError::InvalidNetwork, - 27 => crate::api::error::NodeBaseError::DuplicatePayment, - 28 => crate::api::error::NodeBaseError::InsufficientFunds, - 29 => crate::api::error::NodeBaseError::FeerateEstimationUpdateFailed, - 30 => crate::api::error::NodeBaseError::LiquidityRequestFailed, - 31 => crate::api::error::NodeBaseError::LiquiditySourceUnavailable, - 32 => crate::api::error::NodeBaseError::LiquidityFeeTooHigh, - _ => unreachable!("Invalid variant for NodeBaseError: {}", self), + 0 => crate::api::error::NodeException::InvalidTxid, + 1 => crate::api::error::NodeException::AlreadyRunning, + 2 => crate::api::error::NodeException::NotRunning, + 3 => crate::api::error::NodeException::OnchainTxCreationFailed, + 4 => crate::api::error::NodeException::ConnectionFailed, + 5 => crate::api::error::NodeException::InvoiceCreationFailed, + 6 => crate::api::error::NodeException::PaymentSendingFailed, + 7 => crate::api::error::NodeException::ProbeSendingFailed, + 8 => crate::api::error::NodeException::ChannelCreationFailed, + 9 => crate::api::error::NodeException::ChannelClosingFailed, + 10 => crate::api::error::NodeException::ChannelConfigUpdateFailed, + 11 => crate::api::error::NodeException::PersistenceFailed, + 12 => crate::api::error::NodeException::WalletOperationFailed, + 13 => crate::api::error::NodeException::OnchainTxSigningFailed, + 14 => crate::api::error::NodeException::MessageSigningFailed, + 15 => crate::api::error::NodeException::TxSyncFailed, + 16 => crate::api::error::NodeException::GossipUpdateFailed, + 17 => crate::api::error::NodeException::InvalidAddress, + 18 => crate::api::error::NodeException::InvalidSocketAddress, + 19 => crate::api::error::NodeException::InvalidPublicKey, + 20 => crate::api::error::NodeException::InvalidSecretKey, + 21 => crate::api::error::NodeException::InvalidPaymentHash, + 22 => crate::api::error::NodeException::InvalidPaymentPreimage, + 23 => crate::api::error::NodeException::InvalidPaymentSecret, + 24 => crate::api::error::NodeException::InvalidAmount, + 25 => crate::api::error::NodeException::InvalidInvoice, + 26 => crate::api::error::NodeException::InvalidChannelId, + 27 => crate::api::error::NodeException::InvalidNetwork, + 28 => crate::api::error::NodeException::DuplicatePayment, + 29 => crate::api::error::NodeException::InsufficientFunds, + 30 => crate::api::error::NodeException::FeerateEstimationUpdateFailed, + _ => unreachable!("Invalid variant for NodeException: {}", self), } } } @@ -1127,20 +1070,6 @@ impl CstDecode for i32 { } } } -impl CstDecode for i32 { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentFailureReason { - match self { - 0 => crate::api::types::PaymentFailureReason::RecipientRejected, - 1 => crate::api::types::PaymentFailureReason::UserAbandoned, - 2 => crate::api::types::PaymentFailureReason::RetriesExhausted, - 3 => crate::api::types::PaymentFailureReason::PaymentExpired, - 4 => crate::api::types::PaymentFailureReason::RouteNotFound, - 5 => crate::api::types::PaymentFailureReason::UnexpectedError, - _ => unreachable!("Invalid variant for PaymentFailureReason: {}", self), - } - } -} impl CstDecode for i32 { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::api::types::PaymentStatus { @@ -1206,38 +1135,6 @@ impl SseDecode for crate::api::types::Address { } } -impl SseDecode for crate::api::types::BalanceDetails { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_totalOnchainBalanceSats = ::sse_decode(deserializer); - let mut var_spendableOnchainBalanceSats = ::sse_decode(deserializer); - let mut var_totalLightningBalanceSats = ::sse_decode(deserializer); - let mut var_lightningBalances = - >::sse_decode(deserializer); - let mut var_pendingBalancesFromChannelClosures = - >::sse_decode(deserializer); - return crate::api::types::BalanceDetails { - total_onchain_balance_sats: var_totalOnchainBalanceSats, - spendable_onchain_balance_sats: var_spendableOnchainBalanceSats, - total_lightning_balance_sats: var_totalLightningBalanceSats, - lightning_balances: var_lightningBalances, - pending_balances_from_channel_closures: var_pendingBalancesFromChannelClosures, - }; - } -} - -impl SseDecode for crate::api::types::BestBlock { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_blockHash = ::sse_decode(deserializer); - let mut var_height = ::sse_decode(deserializer); - return crate::api::types::BestBlock { - block_hash: var_blockHash, - height: var_height, - }; - } -} - impl SseDecode for crate::api::types::Bolt11Invoice { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1255,24 +1152,25 @@ impl SseDecode for bool { } } -impl SseDecode for crate::api::error::BuilderError { +impl SseDecode for crate::api::error::BuilderException { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut inner = ::sse_decode(deserializer); return match inner { - 0 => crate::api::error::BuilderError::SocketAddressParseError, - 1 => crate::api::error::BuilderError::InvalidSeedBytes, - 2 => crate::api::error::BuilderError::InvalidSeedFile, - 3 => crate::api::error::BuilderError::InvalidSystemTime, - 4 => crate::api::error::BuilderError::InvalidChannelMonitor, - 5 => crate::api::error::BuilderError::InvalidListeningAddresses, - 6 => crate::api::error::BuilderError::ReadFailed, - 7 => crate::api::error::BuilderError::WriteFailed, - 8 => crate::api::error::BuilderError::StoragePathAccessFailed, - 9 => crate::api::error::BuilderError::KVStoreSetupFailed, - 10 => crate::api::error::BuilderError::WalletSetupFailed, - 11 => crate::api::error::BuilderError::LoggerSetupFailed, - _ => unreachable!("Invalid variant for BuilderError: {}", inner), + 0 => crate::api::error::BuilderException::SocketAddressParseError, + 1 => crate::api::error::BuilderException::InvalidSeedBytes, + 2 => crate::api::error::BuilderException::InvalidSeedFile, + 3 => crate::api::error::BuilderException::InvalidSystemTime, + 4 => crate::api::error::BuilderException::InvalidChannelMonitor, + 5 => crate::api::error::BuilderException::InvalidListeningAddress, + 6 => crate::api::error::BuilderException::ReadFailed, + 7 => crate::api::error::BuilderException::WriteFailed, + 8 => crate::api::error::BuilderException::StoragePathAccessFailed, + 9 => crate::api::error::BuilderException::KVStoreSetupFailed, + 10 => crate::api::error::BuilderException::WalletSetupFailed, + 11 => crate::api::error::BuilderException::LoggerSetupFailed, + 12 => crate::api::error::BuilderException::InvalidTrustedPeer, + _ => unreachable!("Invalid variant for BuilderException: {}", inner), }; } } @@ -1300,7 +1198,7 @@ impl SseDecode for crate::api::types::ChannelConfig { let mut var_forwardingFeeBaseMsat = ::sse_decode(deserializer); let mut var_cltvExpiryDelta = ::sse_decode(deserializer); let mut var_maxDustHtlcExposure = - >::sse_decode(deserializer); + ::sse_decode(deserializer); let mut var_forceCloseAvoidanceMaxFeeSatoshis = ::sse_decode(deserializer); let mut var_acceptUnderpayingHtlcs = ::sse_decode(deserializer); return crate::api::types::ChannelConfig { @@ -1319,11 +1217,12 @@ impl SseDecode for crate::api::types::ChannelDetails { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut var_channelId = ::sse_decode(deserializer); let mut var_counterpartyNodeId = ::sse_decode(deserializer); - let mut var_fundingTxo = >::sse_decode(deserializer); + let mut var_fundingTxo = >::sse_decode(deserializer); let mut var_channelValueSats = ::sse_decode(deserializer); let mut var_unspendablePunishmentReserve = >::sse_decode(deserializer); let mut var_userChannelId = ::sse_decode(deserializer); let mut var_feerateSatPer1000Weight = ::sse_decode(deserializer); + let mut var_balanceMsat = ::sse_decode(deserializer); let mut var_outboundCapacityMsat = ::sse_decode(deserializer); let mut var_inboundCapacityMsat = ::sse_decode(deserializer); let mut var_confirmationsRequired = >::sse_decode(deserializer); @@ -1332,21 +1231,6 @@ impl SseDecode for crate::api::types::ChannelDetails { let mut var_isChannelReady = ::sse_decode(deserializer); let mut var_isUsable = ::sse_decode(deserializer); let mut var_isPublic = ::sse_decode(deserializer); - let mut var_cltvExpiryDelta = >::sse_decode(deserializer); - let mut var_counterpartyUnspendablePunishmentReserve = ::sse_decode(deserializer); - let mut var_counterpartyOutboundHtlcMinimumMsat = >::sse_decode(deserializer); - let mut var_counterpartyOutboundHtlcMaximumMsat = >::sse_decode(deserializer); - let mut var_counterpartyForwardingInfoFeeBaseMsat = >::sse_decode(deserializer); - let mut var_counterpartyForwardingInfoFeeProportionalMillionths = - >::sse_decode(deserializer); - let mut var_counterpartyForwardingInfoCltvExpiryDelta = - >::sse_decode(deserializer); - let mut var_nextOutboundHtlcLimitMsat = ::sse_decode(deserializer); - let mut var_nextOutboundHtlcMinimumMsat = ::sse_decode(deserializer); - let mut var_forceCloseSpendDelay = >::sse_decode(deserializer); - let mut var_inboundHtlcMinimumMsat = ::sse_decode(deserializer); - let mut var_inboundHtlcMaximumMsat = >::sse_decode(deserializer); - let mut var_config = ::sse_decode(deserializer); return crate::api::types::ChannelDetails { channel_id: var_channelId, counterparty_node_id: var_counterpartyNodeId, @@ -1355,6 +1239,7 @@ impl SseDecode for crate::api::types::ChannelDetails { unspendable_punishment_reserve: var_unspendablePunishmentReserve, user_channel_id: var_userChannelId, feerate_sat_per_1000_weight: var_feerateSatPer1000Weight, + balance_msat: var_balanceMsat, outbound_capacity_msat: var_outboundCapacityMsat, inbound_capacity_msat: var_inboundCapacityMsat, confirmations_required: var_confirmationsRequired, @@ -1363,22 +1248,6 @@ impl SseDecode for crate::api::types::ChannelDetails { is_channel_ready: var_isChannelReady, is_usable: var_isUsable, is_public: var_isPublic, - cltv_expiry_delta: var_cltvExpiryDelta, - counterparty_unspendable_punishment_reserve: - var_counterpartyUnspendablePunishmentReserve, - counterparty_outbound_htlc_minimum_msat: var_counterpartyOutboundHtlcMinimumMsat, - counterparty_outbound_htlc_maximum_msat: var_counterpartyOutboundHtlcMaximumMsat, - counterparty_forwarding_info_fee_base_msat: var_counterpartyForwardingInfoFeeBaseMsat, - counterparty_forwarding_info_fee_proportional_millionths: - var_counterpartyForwardingInfoFeeProportionalMillionths, - counterparty_forwarding_info_cltv_expiry_delta: - var_counterpartyForwardingInfoCltvExpiryDelta, - next_outbound_htlc_limit_msat: var_nextOutboundHtlcLimitMsat, - next_outbound_htlc_minimum_msat: var_nextOutboundHtlcMinimumMsat, - force_close_spend_delay: var_forceCloseSpendDelay, - inbound_htlc_minimum_msat: var_inboundHtlcMinimumMsat, - inbound_htlc_maximum_msat: var_inboundHtlcMaximumMsat, - config: var_config, }; } } @@ -1391,52 +1260,6 @@ impl SseDecode for crate::api::types::ChannelId { } } -impl SseDecode for crate::api::types::ClosureReason { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut tag_ = ::sse_decode(deserializer); - match tag_ { - 0 => { - let mut var_peerMsg = ::sse_decode(deserializer); - return crate::api::types::ClosureReason::CounterpartyForceClosed { - peer_msg: var_peerMsg, - }; - } - 1 => { - return crate::api::types::ClosureReason::HolderForceClosed; - } - 2 => { - return crate::api::types::ClosureReason::CooperativeClosure; - } - 3 => { - return crate::api::types::ClosureReason::CommitmentTxConfirmed; - } - 4 => { - return crate::api::types::ClosureReason::FundingTimedOut; - } - 5 => { - let mut var_err = ::sse_decode(deserializer); - return crate::api::types::ClosureReason::ProcessingError { err: var_err }; - } - 6 => { - return crate::api::types::ClosureReason::DisconnectedPeer; - } - 7 => { - return crate::api::types::ClosureReason::OutdatedChannelManager; - } - 8 => { - return crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel; - } - 9 => { - return crate::api::types::ClosureReason::FundingBatchClosure; - } - _ => { - unimplemented!(""); - } - } - } -} - impl SseDecode for crate::api::types::Config { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1483,7 +1306,7 @@ impl SseDecode for crate::api::types::EntropySourceConfig { return crate::api::types::EntropySourceConfig::SeedBytes(var_field0); } 2 => { - let mut var_mnemonic = ::sse_decode(deserializer); + let mut var_mnemonic = ::sse_decode(deserializer); let mut var_passphrase = >::sse_decode(deserializer); return crate::api::types::EntropySourceConfig::Bip39Mnemonic { mnemonic: var_mnemonic, @@ -1505,20 +1328,15 @@ impl SseDecode for crate::api::types::Event { 0 => { let mut var_paymentHash = ::sse_decode(deserializer); - let mut var_feePaidMsat = >::sse_decode(deserializer); return crate::api::types::Event::PaymentSuccessful { payment_hash: var_paymentHash, - fee_paid_msat: var_feePaidMsat, }; } 1 => { let mut var_paymentHash = ::sse_decode(deserializer); - let mut var_reason = - >::sse_decode(deserializer); return crate::api::types::Event::PaymentFailed { payment_hash: var_paymentHash, - reason: var_reason, }; } 2 => { @@ -1534,17 +1352,12 @@ impl SseDecode for crate::api::types::Event { let mut var_channelId = ::sse_decode(deserializer); let mut var_userChannelId = ::sse_decode(deserializer); - let mut var_formerTemporaryChannelId = - ::sse_decode(deserializer); let mut var_counterpartyNodeId = - ::sse_decode(deserializer); - let mut var_fundingTxo = ::sse_decode(deserializer); - return crate::api::types::Event::ChannelPending { + >::sse_decode(deserializer); + return crate::api::types::Event::ChannelReady { channel_id: var_channelId, user_channel_id: var_userChannelId, - former_temporary_channel_id: var_formerTemporaryChannelId, counterparty_node_id: var_counterpartyNodeId, - funding_txo: var_fundingTxo, }; } 4 => { @@ -1553,7 +1366,7 @@ impl SseDecode for crate::api::types::Event { ::sse_decode(deserializer); let mut var_counterpartyNodeId = >::sse_decode(deserializer); - return crate::api::types::Event::ChannelReady { + return crate::api::types::Event::ChannelClosed { channel_id: var_channelId, user_channel_id: var_userChannelId, counterparty_node_id: var_counterpartyNodeId, @@ -1563,15 +1376,17 @@ impl SseDecode for crate::api::types::Event { let mut var_channelId = ::sse_decode(deserializer); let mut var_userChannelId = ::sse_decode(deserializer); + let mut var_formerTemporaryChannelId = + ::sse_decode(deserializer); let mut var_counterpartyNodeId = - >::sse_decode(deserializer); - let mut var_reason = - >::sse_decode(deserializer); - return crate::api::types::Event::ChannelClosed { + ::sse_decode(deserializer); + let mut var_fundingTxo = ::sse_decode(deserializer); + return crate::api::types::Event::ChannelPending { channel_id: var_channelId, user_channel_id: var_userChannelId, + former_temporary_channel_id: var_formerTemporaryChannelId, counterparty_node_id: var_counterpartyNodeId, - reason: var_reason, + funding_txo: var_fundingTxo, }; } _ => { @@ -1607,115 +1422,21 @@ impl SseDecode for i32 { } } -impl SseDecode for crate::api::types::LightningBalance { +impl SseDecode for crate::api::node::LdkMnemonic { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut tag_ = ::sse_decode(deserializer); - match tag_ { - 0 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - return crate::api::types::LightningBalance::ClaimableOnChannelClose { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - amount_satoshis: var_amountSatoshis, - }; - } - 1 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - let mut var_confirmationHeight = ::sse_decode(deserializer); - return crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - amount_satoshis: var_amountSatoshis, - confirmation_height: var_confirmationHeight, - }; - } - 2 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - let mut var_timeoutHeight = ::sse_decode(deserializer); - let mut var_paymentHash = - ::sse_decode(deserializer); - let mut var_paymentPreimage = - ::sse_decode(deserializer); - return crate::api::types::LightningBalance::ContentiousClaimable { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - amount_satoshis: var_amountSatoshis, - timeout_height: var_timeoutHeight, - payment_hash: var_paymentHash, - payment_preimage: var_paymentPreimage, - }; - } - 3 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - let mut var_claimableHeight = ::sse_decode(deserializer); - let mut var_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - amount_satoshis: var_amountSatoshis, - claimable_height: var_claimableHeight, - payment_hash: var_paymentHash, - }; - } - 4 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - let mut var_expiryHeight = ::sse_decode(deserializer); - let mut var_paymentHash = - ::sse_decode(deserializer); - return crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - amount_satoshis: var_amountSatoshis, - expiry_height: var_expiryHeight, - payment_hash: var_paymentHash, - }; - } - 5 => { - let mut var_channelId = ::sse_decode(deserializer); - let mut var_counterpartyNodeId = - ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - return crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id: var_channelId, - counterparty_node_id: var_counterpartyNodeId, - amount_satoshis: var_amountSatoshis, - }; - } - _ => { - unimplemented!(""); - } - } + let mut var_seedPhrase = ::sse_decode(deserializer); + return crate::api::node::LdkMnemonic { + seed_phrase: var_seedPhrase, + }; } } -impl SseDecode for crate::api::types::LiquiditySourceConfig { +impl SseDecode for crate::api::node::LdkNode { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_lsps2Service = <( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - )>::sse_decode(deserializer); - return crate::api::types::LiquiditySourceConfig { - lsps2_service: var_lsps2Service, - }; + let mut var_ptr = >>::sse_decode(deserializer); + return crate::api::node::LdkNode { ptr: var_ptr }; } } @@ -1733,20 +1454,6 @@ impl SseDecode for Vec { } } -impl SseDecode for Vec { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut len_ = ::sse_decode(deserializer); - let mut ans_ = vec![]; - for idx_ in 0..len_ { - ans_.push(::sse_decode( - deserializer, - )); - } - return ans_; - } -} - impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1773,20 +1480,6 @@ impl SseDecode for Vec { } } -impl SseDecode for Vec { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut len_ = ::sse_decode(deserializer); - let mut ans_ = vec![]; - for idx_ in 0..len_ { - ans_.push(::sse_decode( - deserializer, - )); - } - return ans_; - } -} - impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1859,16 +1552,6 @@ impl SseDecode for crate::api::types::MaxDustHTLCExposure { } } -impl SseDecode for crate::api::node::MnemonicBase { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_seedPhrase = ::sse_decode(deserializer); - return crate::api::node::MnemonicBase { - seed_phrase: var_seedPhrase, - }; - } -} - impl SseDecode for crate::api::types::Network { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1883,79 +1566,43 @@ impl SseDecode for crate::api::types::Network { } } -impl SseDecode for crate::api::node::NodeBase { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_ptr = >>::sse_decode(deserializer); - return crate::api::node::NodeBase { ptr: var_ptr }; - } -} - -impl SseDecode for crate::api::error::NodeBaseError { +impl SseDecode for crate::api::error::NodeException { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut inner = ::sse_decode(deserializer); return match inner { - 0 => crate::api::error::NodeBaseError::AlreadyRunning, - 1 => crate::api::error::NodeBaseError::NotRunning, - 2 => crate::api::error::NodeBaseError::OnchainTxCreationFailed, - 3 => crate::api::error::NodeBaseError::ConnectionFailed, - 4 => crate::api::error::NodeBaseError::InvoiceCreationFailed, - 5 => crate::api::error::NodeBaseError::PaymentSendingFailed, - 6 => crate::api::error::NodeBaseError::ProbeSendingFailed, - 7 => crate::api::error::NodeBaseError::ChannelCreationFailed, - 8 => crate::api::error::NodeBaseError::ChannelClosingFailed, - 9 => crate::api::error::NodeBaseError::ChannelConfigUpdateFailed, - 10 => crate::api::error::NodeBaseError::PersistenceFailed, - 11 => crate::api::error::NodeBaseError::WalletOperationFailed, - 12 => crate::api::error::NodeBaseError::OnchainTxSigningFailed, - 13 => crate::api::error::NodeBaseError::MessageSigningFailed, - 14 => crate::api::error::NodeBaseError::TxSyncFailed, - 15 => crate::api::error::NodeBaseError::GossipUpdateFailed, - 16 => crate::api::error::NodeBaseError::InvalidAddress, - 17 => crate::api::error::NodeBaseError::InvalidSocketAddress, - 18 => crate::api::error::NodeBaseError::InvalidPublicKey, - 19 => crate::api::error::NodeBaseError::InvalidSecretKey, - 20 => crate::api::error::NodeBaseError::InvalidPaymentHash, - 21 => crate::api::error::NodeBaseError::InvalidPaymentPreimage, - 22 => crate::api::error::NodeBaseError::InvalidPaymentSecret, - 23 => crate::api::error::NodeBaseError::InvalidAmount, - 24 => crate::api::error::NodeBaseError::InvalidInvoice, - 25 => crate::api::error::NodeBaseError::InvalidChannelId, - 26 => crate::api::error::NodeBaseError::InvalidNetwork, - 27 => crate::api::error::NodeBaseError::DuplicatePayment, - 28 => crate::api::error::NodeBaseError::InsufficientFunds, - 29 => crate::api::error::NodeBaseError::FeerateEstimationUpdateFailed, - 30 => crate::api::error::NodeBaseError::LiquidityRequestFailed, - 31 => crate::api::error::NodeBaseError::LiquiditySourceUnavailable, - 32 => crate::api::error::NodeBaseError::LiquidityFeeTooHigh, - _ => unreachable!("Invalid variant for NodeBaseError: {}", inner), - }; - } -} - -impl SseDecode for crate::api::types::NodeStatus { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_isRunning = ::sse_decode(deserializer); - let mut var_isListening = ::sse_decode(deserializer); - let mut var_currentBestBlock = ::sse_decode(deserializer); - let mut var_latestWalletSyncTimestamp = >::sse_decode(deserializer); - let mut var_latestOnchainWalletSyncTimestamp = >::sse_decode(deserializer); - let mut var_latestFeeRateCacheUpdateTimestamp = >::sse_decode(deserializer); - let mut var_latestRgsSnapshotTimestamp = >::sse_decode(deserializer); - let mut var_latestNodeAnnouncementBroadcastTimestamp = - >::sse_decode(deserializer); - return crate::api::types::NodeStatus { - is_running: var_isRunning, - is_listening: var_isListening, - current_best_block: var_currentBestBlock, - latest_wallet_sync_timestamp: var_latestWalletSyncTimestamp, - latest_onchain_wallet_sync_timestamp: var_latestOnchainWalletSyncTimestamp, - latest_fee_rate_cache_update_timestamp: var_latestFeeRateCacheUpdateTimestamp, - latest_rgs_snapshot_timestamp: var_latestRgsSnapshotTimestamp, - latest_node_announcement_broadcast_timestamp: - var_latestNodeAnnouncementBroadcastTimestamp, + 0 => crate::api::error::NodeException::InvalidTxid, + 1 => crate::api::error::NodeException::AlreadyRunning, + 2 => crate::api::error::NodeException::NotRunning, + 3 => crate::api::error::NodeException::OnchainTxCreationFailed, + 4 => crate::api::error::NodeException::ConnectionFailed, + 5 => crate::api::error::NodeException::InvoiceCreationFailed, + 6 => crate::api::error::NodeException::PaymentSendingFailed, + 7 => crate::api::error::NodeException::ProbeSendingFailed, + 8 => crate::api::error::NodeException::ChannelCreationFailed, + 9 => crate::api::error::NodeException::ChannelClosingFailed, + 10 => crate::api::error::NodeException::ChannelConfigUpdateFailed, + 11 => crate::api::error::NodeException::PersistenceFailed, + 12 => crate::api::error::NodeException::WalletOperationFailed, + 13 => crate::api::error::NodeException::OnchainTxSigningFailed, + 14 => crate::api::error::NodeException::MessageSigningFailed, + 15 => crate::api::error::NodeException::TxSyncFailed, + 16 => crate::api::error::NodeException::GossipUpdateFailed, + 17 => crate::api::error::NodeException::InvalidAddress, + 18 => crate::api::error::NodeException::InvalidSocketAddress, + 19 => crate::api::error::NodeException::InvalidPublicKey, + 20 => crate::api::error::NodeException::InvalidSecretKey, + 21 => crate::api::error::NodeException::InvalidPaymentHash, + 22 => crate::api::error::NodeException::InvalidPaymentPreimage, + 23 => crate::api::error::NodeException::InvalidPaymentSecret, + 24 => crate::api::error::NodeException::InvalidAmount, + 25 => crate::api::error::NodeException::InvalidInvoice, + 26 => crate::api::error::NodeException::InvalidChannelId, + 27 => crate::api::error::NodeException::InvalidNetwork, + 28 => crate::api::error::NodeException::DuplicatePayment, + 29 => crate::api::error::NodeException::InsufficientFunds, + 30 => crate::api::error::NodeException::FeerateEstimationUpdateFailed, + _ => unreachable!("Invalid variant for NodeException: {}", inner), }; } } @@ -1995,28 +1642,6 @@ impl SseDecode for Option { } } -impl SseDecode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - if (::sse_decode(deserializer)) { - return Some(::sse_decode(deserializer)); - } else { - return None; - } - } -} - -impl SseDecode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - if (::sse_decode(deserializer)) { - return Some(::sse_decode(deserializer)); - } else { - return None; - } - } -} - impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2054,43 +1679,6 @@ impl SseDecode for Option { } } -impl SseDecode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - if (::sse_decode(deserializer)) { - return Some(::sse_decode( - deserializer, - )); - } else { - return None; - } - } -} - -impl SseDecode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - if (::sse_decode(deserializer)) { - return Some(::sse_decode( - deserializer, - )); - } else { - return None; - } - } -} - -impl SseDecode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - if (::sse_decode(deserializer)) { - return Some(::sse_decode(deserializer)); - } else { - return None; - } - } -} - impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2104,19 +1692,6 @@ impl SseDecode for Option { } } -impl SseDecode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - if (::sse_decode(deserializer)) { - return Some(::sse_decode( - deserializer, - )); - } else { - return None; - } - } -} - impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2152,17 +1727,6 @@ impl SseDecode for Option { } } -impl SseDecode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - if (::sse_decode(deserializer)) { - return Some(::sse_decode(deserializer)); - } else { - return None; - } - } -} - impl SseDecode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2243,22 +1807,6 @@ impl SseDecode for crate::api::types::PaymentDirection { } } -impl SseDecode for crate::api::types::PaymentFailureReason { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut inner = ::sse_decode(deserializer); - return match inner { - 0 => crate::api::types::PaymentFailureReason::RecipientRejected, - 1 => crate::api::types::PaymentFailureReason::UserAbandoned, - 2 => crate::api::types::PaymentFailureReason::RetriesExhausted, - 3 => crate::api::types::PaymentFailureReason::PaymentExpired, - 4 => crate::api::types::PaymentFailureReason::RouteNotFound, - 5 => crate::api::types::PaymentFailureReason::UnexpectedError, - _ => unreachable!("Invalid variant for PaymentFailureReason: {}", inner), - }; - } -} - impl SseDecode for crate::api::types::PaymentHash { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2310,80 +1858,11 @@ impl SseDecode for crate::api::types::PeerDetails { } } -impl SseDecode for crate::api::types::PendingSweepBalance { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut tag_ = ::sse_decode(deserializer); - match tag_ { - 0 => { - let mut var_channelId = - >::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - return crate::api::types::PendingSweepBalance::PendingBroadcast { - channel_id: var_channelId, - amount_satoshis: var_amountSatoshis, - }; - } - 1 => { - let mut var_channelId = - >::sse_decode(deserializer); - let mut var_latestBroadcastHeight = ::sse_decode(deserializer); - let mut var_latestSpendingTxid = - ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - return crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id: var_channelId, - latest_broadcast_height: var_latestBroadcastHeight, - latest_spending_txid: var_latestSpendingTxid, - amount_satoshis: var_amountSatoshis, - }; - } - 2 => { - let mut var_channelId = - >::sse_decode(deserializer); - let mut var_latestSpendingTxid = - ::sse_decode(deserializer); - let mut var_confirmationHash = ::sse_decode(deserializer); - let mut var_confirmationHeight = ::sse_decode(deserializer); - let mut var_amountSatoshis = ::sse_decode(deserializer); - return crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id: var_channelId, - latest_spending_txid: var_latestSpendingTxid, - confirmation_hash: var_confirmationHash, - confirmation_height: var_confirmationHeight, - amount_satoshis: var_amountSatoshis, - }; - } - _ => { - unimplemented!(""); - } - } - } -} - impl SseDecode for crate::api::types::PublicKey { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_hexCode = ::sse_decode(deserializer); - return crate::api::types::PublicKey { - hex_code: var_hexCode, - }; - } -} - -impl SseDecode - for ( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - ) -{ - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_field0 = ::sse_decode(deserializer); - let mut var_field1 = ::sse_decode(deserializer); - let mut var_field2 = >::sse_decode(deserializer); - return (var_field0, var_field1, var_field2); + let mut var_hex = ::sse_decode(deserializer); + return crate::api::types::PublicKey { hex: var_hex }; } } @@ -2523,7 +2002,7 @@ impl SseDecode for () { impl SseDecode for crate::api::types::UserChannelId { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut var_data = >::sse_decode(deserializer); + let mut var_data = ::sse_decode(deserializer); return crate::api::types::UserChannelId { data: var_data }; } } @@ -2575,54 +2054,6 @@ impl flutter_rust_bridge::IntoIntoDart for crate::ap } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::BalanceDetails { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.total_onchain_balance_sats.into_into_dart().into_dart(), - self.spendable_onchain_balance_sats - .into_into_dart() - .into_dart(), - self.total_lightning_balance_sats - .into_into_dart() - .into_dart(), - self.lightning_balances.into_into_dart().into_dart(), - self.pending_balances_from_channel_closures - .into_into_dart() - .into_dart(), - ] - .into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::BalanceDetails -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::BalanceDetails -{ - fn into_into_dart(self) -> crate::api::types::BalanceDetails { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::BestBlock { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.block_hash.into_into_dart().into_dart(), - self.height.into_into_dart().into_dart(), - ] - .into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::BestBlock {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::BestBlock -{ - fn into_into_dart(self) -> crate::api::types::BestBlock { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::Bolt11Invoice { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.signed_raw_invoice.into_into_dart().into_dart()].into_dart() @@ -2640,7 +2071,7 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::error::BuilderError { +impl flutter_rust_bridge::IntoDart for crate::api::error::BuilderException { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { Self::SocketAddressParseError => 0.into_dart(), @@ -2648,24 +2079,25 @@ impl flutter_rust_bridge::IntoDart for crate::api::error::BuilderError { Self::InvalidSeedFile => 2.into_dart(), Self::InvalidSystemTime => 3.into_dart(), Self::InvalidChannelMonitor => 4.into_dart(), - Self::InvalidListeningAddresses => 5.into_dart(), + Self::InvalidListeningAddress => 5.into_dart(), Self::ReadFailed => 6.into_dart(), Self::WriteFailed => 7.into_dart(), Self::StoragePathAccessFailed => 8.into_dart(), Self::KVStoreSetupFailed => 9.into_dart(), Self::WalletSetupFailed => 10.into_dart(), Self::LoggerSetupFailed => 11.into_dart(), + Self::InvalidTrustedPeer => 12.into_dart(), } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::BuilderError + for crate::api::error::BuilderException { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::BuilderError +impl flutter_rust_bridge::IntoIntoDart + for crate::api::error::BuilderException { - fn into_into_dart(self) -> crate::api::error::BuilderError { + fn into_into_dart(self) -> crate::api::error::BuilderException { self } } @@ -2734,6 +2166,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelDetails { self.feerate_sat_per_1000_weight .into_into_dart() .into_dart(), + self.balance_msat.into_into_dart().into_dart(), self.outbound_capacity_msat.into_into_dart().into_dart(), self.inbound_capacity_msat.into_into_dart().into_dart(), self.confirmations_required.into_into_dart().into_dart(), @@ -2742,35 +2175,6 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::ChannelDetails { self.is_channel_ready.into_into_dart().into_dart(), self.is_usable.into_into_dart().into_dart(), self.is_public.into_into_dart().into_dart(), - self.cltv_expiry_delta.into_into_dart().into_dart(), - self.counterparty_unspendable_punishment_reserve - .into_into_dart() - .into_dart(), - self.counterparty_outbound_htlc_minimum_msat - .into_into_dart() - .into_dart(), - self.counterparty_outbound_htlc_maximum_msat - .into_into_dart() - .into_dart(), - self.counterparty_forwarding_info_fee_base_msat - .into_into_dart() - .into_dart(), - self.counterparty_forwarding_info_fee_proportional_millionths - .into_into_dart() - .into_dart(), - self.counterparty_forwarding_info_cltv_expiry_delta - .into_into_dart() - .into_dart(), - self.next_outbound_htlc_limit_msat - .into_into_dart() - .into_dart(), - self.next_outbound_htlc_minimum_msat - .into_into_dart() - .into_dart(), - self.force_close_spend_delay.into_into_dart().into_dart(), - self.inbound_htlc_minimum_msat.into_into_dart().into_dart(), - self.inbound_htlc_maximum_msat.into_into_dart().into_dart(), - self.config.into_into_dart().into_dart(), ] .into_dart() } @@ -2801,40 +2205,6 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::ClosureReason { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::ClosureReason::CounterpartyForceClosed { peer_msg } => { - [0.into_dart(), peer_msg.into_into_dart().into_dart()].into_dart() - } - crate::api::types::ClosureReason::HolderForceClosed => [1.into_dart()].into_dart(), - crate::api::types::ClosureReason::CooperativeClosure => [2.into_dart()].into_dart(), - crate::api::types::ClosureReason::CommitmentTxConfirmed => [3.into_dart()].into_dart(), - crate::api::types::ClosureReason::FundingTimedOut => [4.into_dart()].into_dart(), - crate::api::types::ClosureReason::ProcessingError { err } => { - [5.into_dart(), err.into_into_dart().into_dart()].into_dart() - } - crate::api::types::ClosureReason::DisconnectedPeer => [6.into_dart()].into_dart(), - crate::api::types::ClosureReason::OutdatedChannelManager => [7.into_dart()].into_dart(), - crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { - [8.into_dart()].into_dart() - } - crate::api::types::ClosureReason::FundingBatchClosure => [9.into_dart()].into_dart(), - } - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::ClosureReason -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::ClosureReason -{ - fn into_into_dart(self) -> crate::api::types::ClosureReason { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::Config { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ @@ -2902,24 +2272,12 @@ impl flutter_rust_bridge::IntoIntoDart impl flutter_rust_bridge::IntoDart for crate::api::types::Event { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - crate::api::types::Event::PaymentSuccessful { - payment_hash, - fee_paid_msat, - } => [ - 0.into_dart(), - payment_hash.into_into_dart().into_dart(), - fee_paid_msat.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::Event::PaymentFailed { - payment_hash, - reason, - } => [ - 1.into_dart(), - payment_hash.into_into_dart().into_dart(), - reason.into_into_dart().into_dart(), - ] - .into_dart(), + crate::api::types::Event::PaymentSuccessful { payment_hash } => { + [0.into_dart(), payment_hash.into_into_dart().into_dart()].into_dart() + } + crate::api::types::Event::PaymentFailed { payment_hash } => { + [1.into_dart(), payment_hash.into_into_dart().into_dart()].into_dart() + } crate::api::types::Event::PaymentReceived { payment_hash, amount_msat, @@ -2929,22 +2287,18 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Event { amount_msat.into_into_dart().into_dart(), ] .into_dart(), - crate::api::types::Event::ChannelPending { + crate::api::types::Event::ChannelReady { channel_id, user_channel_id, - former_temporary_channel_id, counterparty_node_id, - funding_txo, } => [ 3.into_dart(), channel_id.into_into_dart().into_dart(), user_channel_id.into_into_dart().into_dart(), - former_temporary_channel_id.into_into_dart().into_dart(), counterparty_node_id.into_into_dart().into_dart(), - funding_txo.into_into_dart().into_dart(), ] .into_dart(), - crate::api::types::Event::ChannelReady { + crate::api::types::Event::ChannelClosed { channel_id, user_channel_id, counterparty_node_id, @@ -2955,17 +2309,19 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::Event { counterparty_node_id.into_into_dart().into_dart(), ] .into_dart(), - crate::api::types::Event::ChannelClosed { + crate::api::types::Event::ChannelPending { channel_id, user_channel_id, + former_temporary_channel_id, counterparty_node_id, - reason, + funding_txo, } => [ 5.into_dart(), channel_id.into_into_dart().into_dart(), user_channel_id.into_into_dart().into_dart(), + former_temporary_channel_id.into_into_dart().into_dart(), counterparty_node_id.into_into_dart().into_dart(), - reason.into_into_dart().into_dart(), + funding_txo.into_into_dart().into_dart(), ] .into_dart(), } @@ -3000,119 +2356,28 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::LightningBalance { +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkMnemonic { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::LightningBalance::ClaimableOnChannelClose { - channel_id, - counterparty_node_id, - amount_satoshis, - } => [ - 0.into_dart(), - channel_id.into_into_dart().into_dart(), - counterparty_node_id.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { - channel_id, - counterparty_node_id, - amount_satoshis, - confirmation_height, - } => [ - 1.into_dart(), - channel_id.into_into_dart().into_dart(), - counterparty_node_id.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - confirmation_height.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::LightningBalance::ContentiousClaimable { - channel_id, - counterparty_node_id, - amount_satoshis, - timeout_height, - payment_hash, - payment_preimage, - } => [ - 2.into_dart(), - channel_id.into_into_dart().into_dart(), - counterparty_node_id.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - timeout_height.into_into_dart().into_dart(), - payment_hash.into_into_dart().into_dart(), - payment_preimage.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id, - counterparty_node_id, - amount_satoshis, - claimable_height, - payment_hash, - } => [ - 3.into_dart(), - channel_id.into_into_dart().into_dart(), - counterparty_node_id.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - claimable_height.into_into_dart().into_dart(), - payment_hash.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { - channel_id, - counterparty_node_id, - amount_satoshis, - expiry_height, - payment_hash, - } => [ - 4.into_dart(), - channel_id.into_into_dart().into_dart(), - counterparty_node_id.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - expiry_height.into_into_dart().into_dart(), - payment_hash.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id, - counterparty_node_id, - amount_satoshis, - } => [ - 5.into_dart(), - channel_id.into_into_dart().into_dart(), - counterparty_node_id.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - ] - .into_dart(), - } + [self.seed_phrase.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::LightningBalance -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::LightningBalance +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::node::LdkMnemonic {} +impl flutter_rust_bridge::IntoIntoDart + for crate::api::node::LdkMnemonic { - fn into_into_dart(self) -> crate::api::types::LightningBalance { + fn into_into_dart(self) -> crate::api::node::LdkMnemonic { self } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::LiquiditySourceConfig { +impl flutter_rust_bridge::IntoDart for crate::api::node::LdkNode { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.lsps2_service.into_into_dart().into_dart()].into_dart() + [self.ptr.into_into_dart().into_dart()].into_dart() } } -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::LiquiditySourceConfig -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::LiquiditySourceConfig -{ - fn into_into_dart(self) -> crate::api::types::LiquiditySourceConfig { +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::node::LdkNode {} +impl flutter_rust_bridge::IntoIntoDart for crate::api::node::LdkNode { + fn into_into_dart(self) -> crate::api::node::LdkNode { self } } @@ -3162,23 +2427,6 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::node::MnemonicBase { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.seed_phrase.into_into_dart().into_dart()].into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::node::MnemonicBase -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::node::MnemonicBase -{ - fn into_into_dart(self) -> crate::api::node::MnemonicBase { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::Network { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { @@ -3196,99 +2444,51 @@ impl flutter_rust_bridge::IntoIntoDart for crate::ap } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::node::NodeBase { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.ptr.into_into_dart().into_dart()].into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::node::NodeBase {} -impl flutter_rust_bridge::IntoIntoDart for crate::api::node::NodeBase { - fn into_into_dart(self) -> crate::api::node::NodeBase { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::error::NodeBaseError { +impl flutter_rust_bridge::IntoDart for crate::api::error::NodeException { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { match self { - Self::AlreadyRunning => 0.into_dart(), - Self::NotRunning => 1.into_dart(), - Self::OnchainTxCreationFailed => 2.into_dart(), - Self::ConnectionFailed => 3.into_dart(), - Self::InvoiceCreationFailed => 4.into_dart(), - Self::PaymentSendingFailed => 5.into_dart(), - Self::ProbeSendingFailed => 6.into_dart(), - Self::ChannelCreationFailed => 7.into_dart(), - Self::ChannelClosingFailed => 8.into_dart(), - Self::ChannelConfigUpdateFailed => 9.into_dart(), - Self::PersistenceFailed => 10.into_dart(), - Self::WalletOperationFailed => 11.into_dart(), - Self::OnchainTxSigningFailed => 12.into_dart(), - Self::MessageSigningFailed => 13.into_dart(), - Self::TxSyncFailed => 14.into_dart(), - Self::GossipUpdateFailed => 15.into_dart(), - Self::InvalidAddress => 16.into_dart(), - Self::InvalidSocketAddress => 17.into_dart(), - Self::InvalidPublicKey => 18.into_dart(), - Self::InvalidSecretKey => 19.into_dart(), - Self::InvalidPaymentHash => 20.into_dart(), - Self::InvalidPaymentPreimage => 21.into_dart(), - Self::InvalidPaymentSecret => 22.into_dart(), - Self::InvalidAmount => 23.into_dart(), - Self::InvalidInvoice => 24.into_dart(), - Self::InvalidChannelId => 25.into_dart(), - Self::InvalidNetwork => 26.into_dart(), - Self::DuplicatePayment => 27.into_dart(), - Self::InsufficientFunds => 28.into_dart(), - Self::FeerateEstimationUpdateFailed => 29.into_dart(), - Self::LiquidityRequestFailed => 30.into_dart(), - Self::LiquiditySourceUnavailable => 31.into_dart(), - Self::LiquidityFeeTooHigh => 32.into_dart(), + Self::InvalidTxid => 0.into_dart(), + Self::AlreadyRunning => 1.into_dart(), + Self::NotRunning => 2.into_dart(), + Self::OnchainTxCreationFailed => 3.into_dart(), + Self::ConnectionFailed => 4.into_dart(), + Self::InvoiceCreationFailed => 5.into_dart(), + Self::PaymentSendingFailed => 6.into_dart(), + Self::ProbeSendingFailed => 7.into_dart(), + Self::ChannelCreationFailed => 8.into_dart(), + Self::ChannelClosingFailed => 9.into_dart(), + Self::ChannelConfigUpdateFailed => 10.into_dart(), + Self::PersistenceFailed => 11.into_dart(), + Self::WalletOperationFailed => 12.into_dart(), + Self::OnchainTxSigningFailed => 13.into_dart(), + Self::MessageSigningFailed => 14.into_dart(), + Self::TxSyncFailed => 15.into_dart(), + Self::GossipUpdateFailed => 16.into_dart(), + Self::InvalidAddress => 17.into_dart(), + Self::InvalidSocketAddress => 18.into_dart(), + Self::InvalidPublicKey => 19.into_dart(), + Self::InvalidSecretKey => 20.into_dart(), + Self::InvalidPaymentHash => 21.into_dart(), + Self::InvalidPaymentPreimage => 22.into_dart(), + Self::InvalidPaymentSecret => 23.into_dart(), + Self::InvalidAmount => 24.into_dart(), + Self::InvalidInvoice => 25.into_dart(), + Self::InvalidChannelId => 26.into_dart(), + Self::InvalidNetwork => 27.into_dart(), + Self::DuplicatePayment => 28.into_dart(), + Self::InsufficientFunds => 29.into_dart(), + Self::FeerateEstimationUpdateFailed => 30.into_dart(), } } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::error::NodeBaseError + for crate::api::error::NodeException { } -impl flutter_rust_bridge::IntoIntoDart - for crate::api::error::NodeBaseError -{ - fn into_into_dart(self) -> crate::api::error::NodeBaseError { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::NodeStatus { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [ - self.is_running.into_into_dart().into_dart(), - self.is_listening.into_into_dart().into_dart(), - self.current_best_block.into_into_dart().into_dart(), - self.latest_wallet_sync_timestamp - .into_into_dart() - .into_dart(), - self.latest_onchain_wallet_sync_timestamp - .into_into_dart() - .into_dart(), - self.latest_fee_rate_cache_update_timestamp - .into_into_dart() - .into_dart(), - self.latest_rgs_snapshot_timestamp - .into_into_dart() - .into_dart(), - self.latest_node_announcement_broadcast_timestamp - .into_into_dart() - .into_dart(), - ] - .into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::NodeStatus {} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::NodeStatus +impl flutter_rust_bridge::IntoIntoDart + for crate::api::error::NodeException { - fn into_into_dart(self) -> crate::api::types::NodeStatus { + fn into_into_dart(self) -> crate::api::error::NodeException { self } } @@ -3356,30 +2556,6 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentFailureReason { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - Self::RecipientRejected => 0.into_dart(), - Self::UserAbandoned => 1.into_dart(), - Self::RetriesExhausted => 2.into_dart(), - Self::PaymentExpired => 3.into_dart(), - Self::RouteNotFound => 4.into_dart(), - Self::UnexpectedError => 5.into_dart(), - } - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PaymentFailureReason -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PaymentFailureReason -{ - fn into_into_dart(self) -> crate::api::types::PaymentFailureReason { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentHash { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [self.data.into_into_dart().into_dart()].into_dart() @@ -3474,64 +2650,9 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for crate::api::types::PendingSweepBalance { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - match self { - crate::api::types::PendingSweepBalance::PendingBroadcast { - channel_id, - amount_satoshis, - } => [ - 0.into_dart(), - channel_id.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id, - latest_broadcast_height, - latest_spending_txid, - amount_satoshis, - } => [ - 1.into_dart(), - channel_id.into_into_dart().into_dart(), - latest_broadcast_height.into_into_dart().into_dart(), - latest_spending_txid.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - ] - .into_dart(), - crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id, - latest_spending_txid, - confirmation_hash, - confirmation_height, - amount_satoshis, - } => [ - 2.into_dart(), - channel_id.into_into_dart().into_dart(), - latest_spending_txid.into_into_dart().into_dart(), - confirmation_hash.into_into_dart().into_dart(), - confirmation_height.into_into_dart().into_dart(), - amount_satoshis.into_into_dart().into_dart(), - ] - .into_dart(), - } - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for crate::api::types::PendingSweepBalance -{ -} -impl flutter_rust_bridge::IntoIntoDart - for crate::api::types::PendingSweepBalance -{ - fn into_into_dart(self) -> crate::api::types::PendingSweepBalance { - self - } -} -// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::types::PublicKey { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - [self.hex_code.into_into_dart().into_dart()].into_dart() + [self.hex.into_into_dart().into_dart()].into_dart() } } impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::types::PublicKey {} @@ -3647,28 +2768,6 @@ impl SseEncode for crate::api::types::Address { } } -impl SseEncode for crate::api::types::BalanceDetails { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.total_onchain_balance_sats, serializer); - ::sse_encode(self.spendable_onchain_balance_sats, serializer); - ::sse_encode(self.total_lightning_balance_sats, serializer); - >::sse_encode(self.lightning_balances, serializer); - >::sse_encode( - self.pending_balances_from_channel_closures, - serializer, - ); - } -} - -impl SseEncode for crate::api::types::BestBlock { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.block_hash, serializer); - ::sse_encode(self.height, serializer); - } -} - impl SseEncode for crate::api::types::Bolt11Invoice { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3683,23 +2782,24 @@ impl SseEncode for bool { } } -impl SseEncode for crate::api::error::BuilderError { +impl SseEncode for crate::api::error::BuilderException { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { ::sse_encode( match self { - crate::api::error::BuilderError::SocketAddressParseError => 0, - crate::api::error::BuilderError::InvalidSeedBytes => 1, - crate::api::error::BuilderError::InvalidSeedFile => 2, - crate::api::error::BuilderError::InvalidSystemTime => 3, - crate::api::error::BuilderError::InvalidChannelMonitor => 4, - crate::api::error::BuilderError::InvalidListeningAddresses => 5, - crate::api::error::BuilderError::ReadFailed => 6, - crate::api::error::BuilderError::WriteFailed => 7, - crate::api::error::BuilderError::StoragePathAccessFailed => 8, - crate::api::error::BuilderError::KVStoreSetupFailed => 9, - crate::api::error::BuilderError::WalletSetupFailed => 10, - crate::api::error::BuilderError::LoggerSetupFailed => 11, + crate::api::error::BuilderException::SocketAddressParseError => 0, + crate::api::error::BuilderException::InvalidSeedBytes => 1, + crate::api::error::BuilderException::InvalidSeedFile => 2, + crate::api::error::BuilderException::InvalidSystemTime => 3, + crate::api::error::BuilderException::InvalidChannelMonitor => 4, + crate::api::error::BuilderException::InvalidListeningAddress => 5, + crate::api::error::BuilderException::ReadFailed => 6, + crate::api::error::BuilderException::WriteFailed => 7, + crate::api::error::BuilderException::StoragePathAccessFailed => 8, + crate::api::error::BuilderException::KVStoreSetupFailed => 9, + crate::api::error::BuilderException::WalletSetupFailed => 10, + crate::api::error::BuilderException::LoggerSetupFailed => 11, + crate::api::error::BuilderException::InvalidTrustedPeer => 12, _ => { unimplemented!(""); } @@ -3727,7 +2827,7 @@ impl SseEncode for crate::api::types::ChannelConfig { ::sse_encode(self.forwarding_fee_proportional_millionths, serializer); ::sse_encode(self.forwarding_fee_base_msat, serializer); ::sse_encode(self.cltv_expiry_delta, serializer); - >::sse_encode( + ::sse_encode( self.max_dust_htlc_exposure, serializer, ); @@ -3741,11 +2841,12 @@ impl SseEncode for crate::api::types::ChannelDetails { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { ::sse_encode(self.channel_id, serializer); ::sse_encode(self.counterparty_node_id, serializer); - >::sse_encode(self.funding_txo, serializer); + >::sse_encode(self.funding_txo, serializer); ::sse_encode(self.channel_value_sats, serializer); >::sse_encode(self.unspendable_punishment_reserve, serializer); ::sse_encode(self.user_channel_id, serializer); ::sse_encode(self.feerate_sat_per_1000_weight, serializer); + ::sse_encode(self.balance_msat, serializer); ::sse_encode(self.outbound_capacity_msat, serializer); ::sse_encode(self.inbound_capacity_msat, serializer); >::sse_encode(self.confirmations_required, serializer); @@ -3754,25 +2855,6 @@ impl SseEncode for crate::api::types::ChannelDetails { ::sse_encode(self.is_channel_ready, serializer); ::sse_encode(self.is_usable, serializer); ::sse_encode(self.is_public, serializer); - >::sse_encode(self.cltv_expiry_delta, serializer); - ::sse_encode(self.counterparty_unspendable_punishment_reserve, serializer); - >::sse_encode(self.counterparty_outbound_htlc_minimum_msat, serializer); - >::sse_encode(self.counterparty_outbound_htlc_maximum_msat, serializer); - >::sse_encode(self.counterparty_forwarding_info_fee_base_msat, serializer); - >::sse_encode( - self.counterparty_forwarding_info_fee_proportional_millionths, - serializer, - ); - >::sse_encode( - self.counterparty_forwarding_info_cltv_expiry_delta, - serializer, - ); - ::sse_encode(self.next_outbound_htlc_limit_msat, serializer); - ::sse_encode(self.next_outbound_htlc_minimum_msat, serializer); - >::sse_encode(self.force_close_spend_delay, serializer); - ::sse_encode(self.inbound_htlc_minimum_msat, serializer); - >::sse_encode(self.inbound_htlc_maximum_msat, serializer); - ::sse_encode(self.config, serializer); } } @@ -3783,46 +2865,6 @@ impl SseEncode for crate::api::types::ChannelId { } } -impl SseEncode for crate::api::types::ClosureReason { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - match self { - crate::api::types::ClosureReason::CounterpartyForceClosed { peer_msg } => { - ::sse_encode(0, serializer); - ::sse_encode(peer_msg, serializer); - } - crate::api::types::ClosureReason::HolderForceClosed => { - ::sse_encode(1, serializer); - } - crate::api::types::ClosureReason::CooperativeClosure => { - ::sse_encode(2, serializer); - } - crate::api::types::ClosureReason::CommitmentTxConfirmed => { - ::sse_encode(3, serializer); - } - crate::api::types::ClosureReason::FundingTimedOut => { - ::sse_encode(4, serializer); - } - crate::api::types::ClosureReason::ProcessingError { err } => { - ::sse_encode(5, serializer); - ::sse_encode(err, serializer); - } - crate::api::types::ClosureReason::DisconnectedPeer => { - ::sse_encode(6, serializer); - } - crate::api::types::ClosureReason::OutdatedChannelManager => { - ::sse_encode(7, serializer); - } - crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel => { - ::sse_encode(8, serializer); - } - crate::api::types::ClosureReason::FundingBatchClosure => { - ::sse_encode(9, serializer); - } - } - } -} - impl SseEncode for crate::api::types::Config { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -3860,7 +2902,7 @@ impl SseEncode for crate::api::types::EntropySourceConfig { passphrase, } => { ::sse_encode(2, serializer); - ::sse_encode(mnemonic, serializer); + ::sse_encode(mnemonic, serializer); >::sse_encode(passphrase, serializer); } } @@ -3871,21 +2913,13 @@ impl SseEncode for crate::api::types::Event { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { match self { - crate::api::types::Event::PaymentSuccessful { - payment_hash, - fee_paid_msat, - } => { + crate::api::types::Event::PaymentSuccessful { payment_hash } => { ::sse_encode(0, serializer); ::sse_encode(payment_hash, serializer); - >::sse_encode(fee_paid_msat, serializer); } - crate::api::types::Event::PaymentFailed { - payment_hash, - reason, - } => { + crate::api::types::Event::PaymentFailed { payment_hash } => { ::sse_encode(1, serializer); ::sse_encode(payment_hash, serializer); - >::sse_encode(reason, serializer); } crate::api::types::Event::PaymentReceived { payment_hash, @@ -3895,21 +2929,20 @@ impl SseEncode for crate::api::types::Event { ::sse_encode(payment_hash, serializer); ::sse_encode(amount_msat, serializer); } - crate::api::types::Event::ChannelPending { + crate::api::types::Event::ChannelReady { channel_id, user_channel_id, - former_temporary_channel_id, counterparty_node_id, - funding_txo, } => { ::sse_encode(3, serializer); ::sse_encode(channel_id, serializer); ::sse_encode(user_channel_id, serializer); - ::sse_encode(former_temporary_channel_id, serializer); - ::sse_encode(counterparty_node_id, serializer); - ::sse_encode(funding_txo, serializer); + >::sse_encode( + counterparty_node_id, + serializer, + ); } - crate::api::types::Event::ChannelReady { + crate::api::types::Event::ChannelClosed { channel_id, user_channel_id, counterparty_node_id, @@ -3922,20 +2955,19 @@ impl SseEncode for crate::api::types::Event { serializer, ); } - crate::api::types::Event::ChannelClosed { + crate::api::types::Event::ChannelPending { channel_id, user_channel_id, + former_temporary_channel_id, counterparty_node_id, - reason, + funding_txo, } => { ::sse_encode(5, serializer); ::sse_encode(channel_id, serializer); ::sse_encode(user_channel_id, serializer); - >::sse_encode( - counterparty_node_id, - serializer, - ); - >::sse_encode(reason, serializer); + ::sse_encode(former_temporary_channel_id, serializer); + ::sse_encode(counterparty_node_id, serializer); + ::sse_encode(funding_txo, serializer); } } } @@ -3963,98 +2995,17 @@ impl SseEncode for i32 { } } -impl SseEncode for crate::api::types::LightningBalance { +impl SseEncode for crate::api::node::LdkMnemonic { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - match self { - crate::api::types::LightningBalance::ClaimableOnChannelClose { - channel_id, - counterparty_node_id, - amount_satoshis, - } => { - ::sse_encode(0, serializer); - ::sse_encode(channel_id, serializer); - ::sse_encode(counterparty_node_id, serializer); - ::sse_encode(amount_satoshis, serializer); - } - crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { - channel_id, - counterparty_node_id, - amount_satoshis, - confirmation_height, - } => { - ::sse_encode(1, serializer); - ::sse_encode(channel_id, serializer); - ::sse_encode(counterparty_node_id, serializer); - ::sse_encode(amount_satoshis, serializer); - ::sse_encode(confirmation_height, serializer); - } - crate::api::types::LightningBalance::ContentiousClaimable { - channel_id, - counterparty_node_id, - amount_satoshis, - timeout_height, - payment_hash, - payment_preimage, - } => { - ::sse_encode(2, serializer); - ::sse_encode(channel_id, serializer); - ::sse_encode(counterparty_node_id, serializer); - ::sse_encode(amount_satoshis, serializer); - ::sse_encode(timeout_height, serializer); - ::sse_encode(payment_hash, serializer); - ::sse_encode(payment_preimage, serializer); - } - crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id, - counterparty_node_id, - amount_satoshis, - claimable_height, - payment_hash, - } => { - ::sse_encode(3, serializer); - ::sse_encode(channel_id, serializer); - ::sse_encode(counterparty_node_id, serializer); - ::sse_encode(amount_satoshis, serializer); - ::sse_encode(claimable_height, serializer); - ::sse_encode(payment_hash, serializer); - } - crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { - channel_id, - counterparty_node_id, - amount_satoshis, - expiry_height, - payment_hash, - } => { - ::sse_encode(4, serializer); - ::sse_encode(channel_id, serializer); - ::sse_encode(counterparty_node_id, serializer); - ::sse_encode(amount_satoshis, serializer); - ::sse_encode(expiry_height, serializer); - ::sse_encode(payment_hash, serializer); - } - crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id, - counterparty_node_id, - amount_satoshis, - } => { - ::sse_encode(5, serializer); - ::sse_encode(channel_id, serializer); - ::sse_encode(counterparty_node_id, serializer); - ::sse_encode(amount_satoshis, serializer); - } - } + ::sse_encode(self.seed_phrase, serializer); } } -impl SseEncode for crate::api::types::LiquiditySourceConfig { +impl SseEncode for crate::api::node::LdkNode { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - <( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - )>::sse_encode(self.lsps2_service, serializer); + >>::sse_encode(self.ptr, serializer); } } @@ -4068,16 +3019,6 @@ impl SseEncode for Vec { } } -impl SseEncode for Vec { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.len() as _, serializer); - for item in self { - ::sse_encode(item, serializer); - } - } -} - impl SseEncode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4098,16 +3039,6 @@ impl SseEncode for Vec { } } -impl SseEncode for Vec { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.len() as _, serializer); - for item in self { - ::sse_encode(item, serializer); - } - } -} - impl SseEncode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4174,13 +3105,6 @@ impl SseEncode for crate::api::types::MaxDustHTLCExposure { } } -impl SseEncode for crate::api::node::MnemonicBase { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.seed_phrase, serializer); - } -} - impl SseEncode for crate::api::types::Network { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4199,51 +3123,42 @@ impl SseEncode for crate::api::types::Network { } } -impl SseEncode for crate::api::node::NodeBase { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - >>::sse_encode(self.ptr, serializer); - } -} - -impl SseEncode for crate::api::error::NodeBaseError { +impl SseEncode for crate::api::error::NodeException { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { ::sse_encode( match self { - crate::api::error::NodeBaseError::AlreadyRunning => 0, - crate::api::error::NodeBaseError::NotRunning => 1, - crate::api::error::NodeBaseError::OnchainTxCreationFailed => 2, - crate::api::error::NodeBaseError::ConnectionFailed => 3, - crate::api::error::NodeBaseError::InvoiceCreationFailed => 4, - crate::api::error::NodeBaseError::PaymentSendingFailed => 5, - crate::api::error::NodeBaseError::ProbeSendingFailed => 6, - crate::api::error::NodeBaseError::ChannelCreationFailed => 7, - crate::api::error::NodeBaseError::ChannelClosingFailed => 8, - crate::api::error::NodeBaseError::ChannelConfigUpdateFailed => 9, - crate::api::error::NodeBaseError::PersistenceFailed => 10, - crate::api::error::NodeBaseError::WalletOperationFailed => 11, - crate::api::error::NodeBaseError::OnchainTxSigningFailed => 12, - crate::api::error::NodeBaseError::MessageSigningFailed => 13, - crate::api::error::NodeBaseError::TxSyncFailed => 14, - crate::api::error::NodeBaseError::GossipUpdateFailed => 15, - crate::api::error::NodeBaseError::InvalidAddress => 16, - crate::api::error::NodeBaseError::InvalidSocketAddress => 17, - crate::api::error::NodeBaseError::InvalidPublicKey => 18, - crate::api::error::NodeBaseError::InvalidSecretKey => 19, - crate::api::error::NodeBaseError::InvalidPaymentHash => 20, - crate::api::error::NodeBaseError::InvalidPaymentPreimage => 21, - crate::api::error::NodeBaseError::InvalidPaymentSecret => 22, - crate::api::error::NodeBaseError::InvalidAmount => 23, - crate::api::error::NodeBaseError::InvalidInvoice => 24, - crate::api::error::NodeBaseError::InvalidChannelId => 25, - crate::api::error::NodeBaseError::InvalidNetwork => 26, - crate::api::error::NodeBaseError::DuplicatePayment => 27, - crate::api::error::NodeBaseError::InsufficientFunds => 28, - crate::api::error::NodeBaseError::FeerateEstimationUpdateFailed => 29, - crate::api::error::NodeBaseError::LiquidityRequestFailed => 30, - crate::api::error::NodeBaseError::LiquiditySourceUnavailable => 31, - crate::api::error::NodeBaseError::LiquidityFeeTooHigh => 32, + crate::api::error::NodeException::InvalidTxid => 0, + crate::api::error::NodeException::AlreadyRunning => 1, + crate::api::error::NodeException::NotRunning => 2, + crate::api::error::NodeException::OnchainTxCreationFailed => 3, + crate::api::error::NodeException::ConnectionFailed => 4, + crate::api::error::NodeException::InvoiceCreationFailed => 5, + crate::api::error::NodeException::PaymentSendingFailed => 6, + crate::api::error::NodeException::ProbeSendingFailed => 7, + crate::api::error::NodeException::ChannelCreationFailed => 8, + crate::api::error::NodeException::ChannelClosingFailed => 9, + crate::api::error::NodeException::ChannelConfigUpdateFailed => 10, + crate::api::error::NodeException::PersistenceFailed => 11, + crate::api::error::NodeException::WalletOperationFailed => 12, + crate::api::error::NodeException::OnchainTxSigningFailed => 13, + crate::api::error::NodeException::MessageSigningFailed => 14, + crate::api::error::NodeException::TxSyncFailed => 15, + crate::api::error::NodeException::GossipUpdateFailed => 16, + crate::api::error::NodeException::InvalidAddress => 17, + crate::api::error::NodeException::InvalidSocketAddress => 18, + crate::api::error::NodeException::InvalidPublicKey => 19, + crate::api::error::NodeException::InvalidSecretKey => 20, + crate::api::error::NodeException::InvalidPaymentHash => 21, + crate::api::error::NodeException::InvalidPaymentPreimage => 22, + crate::api::error::NodeException::InvalidPaymentSecret => 23, + crate::api::error::NodeException::InvalidAmount => 24, + crate::api::error::NodeException::InvalidInvoice => 25, + crate::api::error::NodeException::InvalidChannelId => 26, + crate::api::error::NodeException::InvalidNetwork => 27, + crate::api::error::NodeException::DuplicatePayment => 28, + crate::api::error::NodeException::InsufficientFunds => 29, + crate::api::error::NodeException::FeerateEstimationUpdateFailed => 30, _ => { unimplemented!(""); } @@ -4253,23 +3168,6 @@ impl SseEncode for crate::api::error::NodeBaseError { } } -impl SseEncode for crate::api::types::NodeStatus { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_running, serializer); - ::sse_encode(self.is_listening, serializer); - ::sse_encode(self.current_best_block, serializer); - >::sse_encode(self.latest_wallet_sync_timestamp, serializer); - >::sse_encode(self.latest_onchain_wallet_sync_timestamp, serializer); - >::sse_encode(self.latest_fee_rate_cache_update_timestamp, serializer); - >::sse_encode(self.latest_rgs_snapshot_timestamp, serializer); - >::sse_encode( - self.latest_node_announcement_broadcast_timestamp, - serializer, - ); - } -} - impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4300,26 +3198,6 @@ impl SseEncode for Option { } } -impl SseEncode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_some(), serializer); - if let Some(value) = self { - ::sse_encode(value, serializer); - } - } -} - -impl SseEncode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_some(), serializer); - if let Some(value) = self { - ::sse_encode(value, serializer); - } - } -} - impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4350,36 +3228,6 @@ impl SseEncode for Option { } } -impl SseEncode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_some(), serializer); - if let Some(value) = self { - ::sse_encode(value, serializer); - } - } -} - -impl SseEncode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_some(), serializer); - if let Some(value) = self { - ::sse_encode(value, serializer); - } - } -} - -impl SseEncode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_some(), serializer); - if let Some(value) = self { - ::sse_encode(value, serializer); - } - } -} - impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4390,16 +3238,6 @@ impl SseEncode for Option { } } -impl SseEncode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_some(), serializer); - if let Some(value) = self { - ::sse_encode(value, serializer); - } - } -} - impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4430,16 +3268,6 @@ impl SseEncode for Option { } } -impl SseEncode for Option { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.is_some(), serializer); - if let Some(value) = self { - ::sse_encode(value, serializer); - } - } -} - impl SseEncode for Option { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4506,26 +3334,6 @@ impl SseEncode for crate::api::types::PaymentDirection { } } -impl SseEncode for crate::api::types::PaymentFailureReason { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode( - match self { - crate::api::types::PaymentFailureReason::RecipientRejected => 0, - crate::api::types::PaymentFailureReason::UserAbandoned => 1, - crate::api::types::PaymentFailureReason::RetriesExhausted => 2, - crate::api::types::PaymentFailureReason::PaymentExpired => 3, - crate::api::types::PaymentFailureReason::RouteNotFound => 4, - crate::api::types::PaymentFailureReason::UnexpectedError => 5, - _ => { - unimplemented!(""); - } - }, - serializer, - ); - } -} - impl SseEncode for crate::api::types::PaymentHash { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -4573,67 +3381,10 @@ impl SseEncode for crate::api::types::PeerDetails { } } -impl SseEncode for crate::api::types::PendingSweepBalance { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - match self { - crate::api::types::PendingSweepBalance::PendingBroadcast { - channel_id, - amount_satoshis, - } => { - ::sse_encode(0, serializer); - >::sse_encode(channel_id, serializer); - ::sse_encode(amount_satoshis, serializer); - } - crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id, - latest_broadcast_height, - latest_spending_txid, - amount_satoshis, - } => { - ::sse_encode(1, serializer); - >::sse_encode(channel_id, serializer); - ::sse_encode(latest_broadcast_height, serializer); - ::sse_encode(latest_spending_txid, serializer); - ::sse_encode(amount_satoshis, serializer); - } - crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id, - latest_spending_txid, - confirmation_hash, - confirmation_height, - amount_satoshis, - } => { - ::sse_encode(2, serializer); - >::sse_encode(channel_id, serializer); - ::sse_encode(latest_spending_txid, serializer); - ::sse_encode(confirmation_hash, serializer); - ::sse_encode(confirmation_height, serializer); - ::sse_encode(amount_satoshis, serializer); - } - } - } -} - impl SseEncode for crate::api::types::PublicKey { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.hex_code, serializer); - } -} - -impl SseEncode - for ( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - ) -{ - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - ::sse_encode(self.0, serializer); - ::sse_encode(self.1, serializer); - >::sse_encode(self.2, serializer); + ::sse_encode(self.hex, serializer); } } @@ -4784,7 +3535,7 @@ impl SseEncode for () { impl SseEncode for crate::api::types::UserChannelId { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - >::sse_encode(self.data, serializer); + ::sse_encode(self.data, serializer); } } diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs index 3d832b2..1785bd2 100644 --- a/rust/src/frb_generated.web.rs +++ b/rust/src/frb_generated.web.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // Section: imports @@ -42,49 +42,6 @@ impl CstDecode } } } -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::BalanceDetails { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 5, - "Expected 5 elements, got {}", - self_.length() - ); - crate::api::types::BalanceDetails { - total_onchain_balance_sats: self_.get(0).cst_decode(), - spendable_onchain_balance_sats: self_.get(1).cst_decode(), - total_lightning_balance_sats: self_.get(2).cst_decode(), - lightning_balances: self_.get(3).cst_decode(), - pending_balances_from_channel_closures: self_.get(4).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::BestBlock { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 2, - "Expected 2 elements, got {}", - self_.length() - ); - crate::api::types::BestBlock { - block_hash: self_.get(0).cst_decode(), - height: self_.get(1).cst_decode(), - } - } -} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -150,8 +107,8 @@ impl CstDecode .unwrap(); assert_eq!( self_.length(), - 28, - "Expected 28 elements, got {}", + 16, + "Expected 16 elements, got {}", self_.length() ); crate::api::types::ChannelDetails { @@ -162,27 +119,15 @@ impl CstDecode unspendable_punishment_reserve: self_.get(4).cst_decode(), user_channel_id: self_.get(5).cst_decode(), feerate_sat_per_1000_weight: self_.get(6).cst_decode(), - outbound_capacity_msat: self_.get(7).cst_decode(), - inbound_capacity_msat: self_.get(8).cst_decode(), - confirmations_required: self_.get(9).cst_decode(), - confirmations: self_.get(10).cst_decode(), - is_outbound: self_.get(11).cst_decode(), - is_channel_ready: self_.get(12).cst_decode(), - is_usable: self_.get(13).cst_decode(), - is_public: self_.get(14).cst_decode(), - cltv_expiry_delta: self_.get(15).cst_decode(), - counterparty_unspendable_punishment_reserve: self_.get(16).cst_decode(), - counterparty_outbound_htlc_minimum_msat: self_.get(17).cst_decode(), - counterparty_outbound_htlc_maximum_msat: self_.get(18).cst_decode(), - counterparty_forwarding_info_fee_base_msat: self_.get(19).cst_decode(), - counterparty_forwarding_info_fee_proportional_millionths: self_.get(20).cst_decode(), - counterparty_forwarding_info_cltv_expiry_delta: self_.get(21).cst_decode(), - next_outbound_htlc_limit_msat: self_.get(22).cst_decode(), - next_outbound_htlc_minimum_msat: self_.get(23).cst_decode(), - force_close_spend_delay: self_.get(24).cst_decode(), - inbound_htlc_minimum_msat: self_.get(25).cst_decode(), - inbound_htlc_maximum_msat: self_.get(26).cst_decode(), - config: self_.get(27).cst_decode(), + balance_msat: self_.get(7).cst_decode(), + outbound_capacity_msat: self_.get(8).cst_decode(), + inbound_capacity_msat: self_.get(9).cst_decode(), + confirmations_required: self_.get(10).cst_decode(), + confirmations: self_.get(11).cst_decode(), + is_outbound: self_.get(12).cst_decode(), + is_channel_ready: self_.get(13).cst_decode(), + is_usable: self_.get(14).cst_decode(), + is_public: self_.get(15).cst_decode(), } } } @@ -205,31 +150,6 @@ impl CstDecode } } } -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ClosureReason { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::ClosureReason::CounterpartyForceClosed { - peer_msg: self_.get(1).cst_decode(), - }, - 1 => crate::api::types::ClosureReason::HolderForceClosed, - 2 => crate::api::types::ClosureReason::CooperativeClosure, - 3 => crate::api::types::ClosureReason::CommitmentTxConfirmed, - 4 => crate::api::types::ClosureReason::FundingTimedOut, - 5 => crate::api::types::ClosureReason::ProcessingError { - err: self_.get(1).cst_decode(), - }, - 6 => crate::api::types::ClosureReason::DisconnectedPeer, - 7 => crate::api::types::ClosureReason::OutdatedChannelManager, - 8 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, - 9 => crate::api::types::ClosureReason::FundingBatchClosure, - _ => unreachable!(), - } - } -} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -285,33 +205,30 @@ impl CstDecode match self_.get(0).unchecked_into_f64() as _ { 0 => crate::api::types::Event::PaymentSuccessful { payment_hash: self_.get(1).cst_decode(), - fee_paid_msat: self_.get(2).cst_decode(), }, 1 => crate::api::types::Event::PaymentFailed { payment_hash: self_.get(1).cst_decode(), - reason: self_.get(2).cst_decode(), }, 2 => crate::api::types::Event::PaymentReceived { payment_hash: self_.get(1).cst_decode(), amount_msat: self_.get(2).cst_decode(), }, - 3 => crate::api::types::Event::ChannelPending { + 3 => crate::api::types::Event::ChannelReady { channel_id: self_.get(1).cst_decode(), user_channel_id: self_.get(2).cst_decode(), - former_temporary_channel_id: self_.get(3).cst_decode(), - counterparty_node_id: self_.get(4).cst_decode(), - funding_txo: self_.get(5).cst_decode(), + counterparty_node_id: self_.get(3).cst_decode(), }, - 4 => crate::api::types::Event::ChannelReady { + 4 => crate::api::types::Event::ChannelClosed { channel_id: self_.get(1).cst_decode(), user_channel_id: self_.get(2).cst_decode(), counterparty_node_id: self_.get(3).cst_decode(), }, - 5 => crate::api::types::Event::ChannelClosed { + 5 => crate::api::types::Event::ChannelPending { channel_id: self_.get(1).cst_decode(), user_channel_id: self_.get(2).cst_decode(), - counterparty_node_id: self_.get(3).cst_decode(), - reason: self_.get(4).cst_decode(), + former_temporary_channel_id: self_.get(3).cst_decode(), + counterparty_node_id: self_.get(4).cst_decode(), + funding_txo: self_.get(5).cst_decode(), }, _ => unreachable!(), } @@ -330,60 +247,30 @@ impl CstDecode } } } -impl CstDecode +impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LightningBalance { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::LightningBalance::ClaimableOnChannelClose { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - }, - 1 => crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - confirmation_height: self_.get(4).cst_decode(), - }, - 2 => crate::api::types::LightningBalance::ContentiousClaimable { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - timeout_height: self_.get(4).cst_decode(), - payment_hash: self_.get(5).cst_decode(), - payment_preimage: self_.get(6).cst_decode(), - }, - 3 => crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - claimable_height: self_.get(4).cst_decode(), - payment_hash: self_.get(5).cst_decode(), - }, - 4 => crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - expiry_height: self_.get(4).cst_decode(), - payment_hash: self_.get(5).cst_decode(), - }, - 5 => crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - }, - _ => unreachable!(), + fn cst_decode(self) -> crate::api::node::LdkMnemonic { + let self_ = self + .dyn_into::() + .unwrap(); + assert_eq!( + self_.length(), + 1, + "Expected 1 elements, got {}", + self_.length() + ); + crate::api::node::LdkMnemonic { + seed_phrase: self_.get(0).cst_decode(), } } } -impl CstDecode +impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LiquiditySourceConfig { + fn cst_decode(self) -> crate::api::node::LdkNode { let self_ = self .dyn_into::() .unwrap(); @@ -393,8 +280,8 @@ impl CstDecode "Expected 1 elements, got {}", self_.length() ); - crate::api::types::LiquiditySourceConfig { - lsps2_service: self_.get(0).cst_decode(), + crate::api::node::LdkNode { + ptr: self_.get(0).cst_decode(), } } } @@ -410,18 +297,6 @@ impl CstDecode> .collect() } } -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -446,18 +321,6 @@ impl CstDecode> .collect() } } -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} impl CstDecode> for Box<[u8]> { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -503,70 +366,6 @@ impl CstDecode } } } -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::MnemonicBase { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::node::MnemonicBase { - seed_phrase: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::NodeBase { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::node::NodeBase { - ptr: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::NodeStatus { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 8, - "Expected 8 elements, got {}", - self_.length() - ); - crate::api::types::NodeStatus { - is_running: self_.get(0).cst_decode(), - is_listening: self_.get(1).cst_decode(), - current_best_block: self_.get(2).cst_decode(), - latest_wallet_sync_timestamp: self_.get(3).cst_decode(), - latest_onchain_wallet_sync_timestamp: self_.get(4).cst_decode(), - latest_fee_rate_cache_update_timestamp: self_.get(5).cst_decode(), - latest_rgs_snapshot_timestamp: self_.get(6).cst_decode(), - latest_node_announcement_broadcast_timestamp: self_.get(7).cst_decode(), - } - } -} impl CstDecode> for Option { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Option { @@ -695,34 +494,6 @@ impl CstDecode } } } -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PendingSweepBalance { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::PendingSweepBalance::PendingBroadcast { - channel_id: self_.get(1).cst_decode(), - amount_satoshis: self_.get(2).cst_decode(), - }, - 1 => crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id: self_.get(1).cst_decode(), - latest_broadcast_height: self_.get(2).cst_decode(), - latest_spending_txid: self_.get(3).cst_decode(), - amount_satoshis: self_.get(4).cst_decode(), - }, - 2 => crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id: self_.get(1).cst_decode(), - latest_spending_txid: self_.get(2).cst_decode(), - confirmation_hash: self_.get(3).cst_decode(), - confirmation_height: self_.get(4).cst_decode(), - amount_satoshis: self_.get(5).cst_decode(), - }, - _ => unreachable!(), - } - } -} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -738,41 +509,10 @@ impl CstDecode self_.length() ); crate::api::types::PublicKey { - hex_code: self_.get(0).cst_decode(), + hex: self_.get(0).cst_decode(), } } } -impl - CstDecode<( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - )> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode( - self, - ) -> ( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - ) { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 3, - "Expected 3 elements, got {}", - self_.length() - ); - ( - self_.get(0).cst_decode(), - self_.get(1).cst_decode(), - self_.get(2).cst_decode(), - ) - } -} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -900,11 +640,11 @@ impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsVal self.is_truthy() } } -impl CstDecode +impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::error::BuilderError { + fn cst_decode(self) -> crate::api::error::BuilderException { (self.unchecked_into_f64() as i32).cst_decode() } } @@ -938,11 +678,11 @@ impl CstDecode (self.unchecked_into_f64() as i32).cst_decode() } } -impl CstDecode +impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::error::NodeBaseError { + fn cst_decode(self) -> crate::api::error::NodeException { (self.unchecked_into_f64() as i32).cst_decode() } } @@ -954,14 +694,6 @@ impl CstDecode (self.unchecked_into_f64() as i32).cst_decode() } } -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentFailureReason { - (self.unchecked_into_f64() as i32).cst_decode() - } -} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -1041,54 +773,63 @@ impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsVa } #[wasm_bindgen] -pub fn wire_MnemonicBase_generate(port_: flutter_rust_bridge::for_generated::MessagePort) { - wire_MnemonicBase_generate_impl(port_) +pub fn wire_build_with_sqlite_store( + port_: flutter_rust_bridge::for_generated::MessagePort, + config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + chain_data_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + entropy_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + gossip_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_build_with_sqlite_store_impl( + port_, + config, + chain_data_source_config, + entropy_source_config, + gossip_source_config, + ) } #[wasm_bindgen] -pub fn wire_NodeBase_close_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire_NodeBase_close_channel_impl(port_, that, user_channel_id, counterparty_node_id) +pub fn wire_ldk_mnemonic_generate(port_: flutter_rust_bridge::for_generated::MessagePort) { + wire_ldk_mnemonic_generate_impl(port_) } #[wasm_bindgen] -pub fn wire_NodeBase_config( +pub fn wire_ldk_node_close_channel( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_config_impl(port_, that) + wire_ldk_node_close_channel_impl(port_, that, channel_id, counterparty_node_id) } #[wasm_bindgen] -pub fn wire_NodeBase_connect( +pub fn wire_ldk_node_connect( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, persist: bool, ) { - wire_NodeBase_connect_impl(port_, that, node_id, address, persist) + wire_ldk_node_connect_impl(port_, that, node_id, address, persist) } #[wasm_bindgen] -pub fn wire_NodeBase_connect_open_channel( +pub fn wire_ldk_node_connect_open_channel( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + socket_address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, channel_amount_sats: u64, push_to_counterparty_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, announce_channel: bool, channel_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_connect_open_channel_impl( + wire_ldk_node_connect_open_channel_impl( port_, that, - address, + socket_address, node_id, channel_amount_sats, push_to_counterparty_msat, @@ -1098,349 +839,310 @@ pub fn wire_NodeBase_connect_open_channel( } #[wasm_bindgen] -pub fn wire_NodeBase_disconnect( +pub fn wire_ldk_node_disconnect( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_disconnect_impl(port_, that, counterparty_node_id) + wire_ldk_node_disconnect_impl(port_, that, counterparty_node_id) } #[wasm_bindgen] -pub fn wire_NodeBase_event_handled( +pub fn wire_ldk_node_event_handled( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_event_handled_impl(port_, that) + wire_ldk_node_event_handled_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_list_balances( +pub fn wire_ldk_node_is_running( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_list_balances_impl(port_, that) + wire_ldk_node_is_running_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_list_channels( +pub fn wire_ldk_node_list_channels( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_list_channels_impl(port_, that) + wire_ldk_node_list_channels_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_list_payments( +pub fn wire_ldk_node_list_payments( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_list_payments_impl(port_, that) + wire_ldk_node_list_payments_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_list_payments_with_filter( +pub fn wire_ldk_node_list_payments_with_filter( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, payment_direction: i32, ) { - wire_NodeBase_list_payments_with_filter_impl(port_, that, payment_direction) -} - -#[wasm_bindgen] -pub fn wire_NodeBase_list_peers( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire_NodeBase_list_peers_impl(port_, that) + wire_ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) } #[wasm_bindgen] -pub fn wire_NodeBase_listening_addresses( +pub fn wire_ldk_node_list_peers( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_listening_addresses_impl(port_, that) + wire_ldk_node_list_peers_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_new_onchain_address( +pub fn wire_ldk_node_listening_addresses( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_new_onchain_address_impl(port_, that) + wire_ldk_node_listening_addresses_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_next_event( +pub fn wire_ldk_node_new_onchain_address( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_next_event_impl(port_, that) + wire_ldk_node_new_onchain_address_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_next_event_async( +pub fn wire_ldk_node_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_next_event_async_impl(port_, that) + wire_ldk_node_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_node_id( +pub fn wire_ldk_node_node_id( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_node_id_impl(port_, that) + wire_ldk_node_node_id_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_payment( +pub fn wire_ldk_node_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, payment_hash: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_payment_impl(port_, that, payment_hash) + wire_ldk_node_payment_impl(port_, that, payment_hash) } #[wasm_bindgen] -pub fn wire_NodeBase_receive_payment( +pub fn wire_ldk_node_receive_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, amount_msat: u64, description: String, expiry_secs: u32, ) { - wire_NodeBase_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) -} - -#[wasm_bindgen] -pub fn wire_NodeBase_receive_payment_via_jit_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: u64, - description: String, - expiry_secs: u32, - max_total_lsp_fee_limit_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire_NodeBase_receive_payment_via_jit_channel_impl( - port_, - that, - amount_msat, - description, - expiry_secs, - max_total_lsp_fee_limit_msat, - ) -} - -#[wasm_bindgen] -pub fn wire_NodeBase_receive_variable_amount_payment( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, -) { - wire_NodeBase_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) + wire_ldk_node_receive_payment_impl(port_, that, amount_msat, description, expiry_secs) } #[wasm_bindgen] -pub fn wire_NodeBase_receive_variable_amount_payment_via_jit_channel( +pub fn wire_ldk_node_receive_variable_amount_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, description: String, expiry_secs: u32, - max_proportional_lsp_fee_limit_ppm_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_receive_variable_amount_payment_via_jit_channel_impl( - port_, - that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat, - ) + wire_ldk_node_receive_variable_amount_payment_impl(port_, that, description, expiry_secs) } #[wasm_bindgen] -pub fn wire_NodeBase_remove_payment( +pub fn wire_ldk_node_remove_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, payment_hash: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_remove_payment_impl(port_, that, payment_hash) + wire_ldk_node_remove_payment_impl(port_, that, payment_hash) } #[wasm_bindgen] -pub fn wire_NodeBase_send_all_to_onchain_address( +pub fn wire_ldk_node_send_all_to_onchain_address( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_send_all_to_onchain_address_impl(port_, that, address) + wire_ldk_node_send_all_to_onchain_address_impl(port_, that, address) } #[wasm_bindgen] -pub fn wire_NodeBase_send_payment( +pub fn wire_ldk_node_send_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_send_payment_impl(port_, that, invoice) + wire_ldk_node_send_payment_impl(port_, that, invoice) } #[wasm_bindgen] -pub fn wire_NodeBase_send_payment_probes( +pub fn wire_ldk_node_send_payment_probes( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_send_payment_probes_impl(port_, that, invoice) + wire_ldk_node_send_payment_probes_impl(port_, that, invoice) } #[wasm_bindgen] -pub fn wire_NodeBase_send_payment_probes_using_amount( +pub fn wire_ldk_node_send_payment_probes_using_amount( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, amount_msat: u64, ) { - wire_NodeBase_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_send_payment_probes_using_amount_impl(port_, that, invoice, amount_msat) } #[wasm_bindgen] -pub fn wire_NodeBase_send_payment_using_amount( +pub fn wire_ldk_node_send_payment_using_amount( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, amount_msat: u64, ) { - wire_NodeBase_send_payment_using_amount_impl(port_, that, invoice, amount_msat) + wire_ldk_node_send_payment_using_amount_impl(port_, that, invoice, amount_msat) } #[wasm_bindgen] -pub fn wire_NodeBase_send_spontaneous_payment( +pub fn wire_ldk_node_send_spontaneous_payment( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, amount_msat: u64, node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) + wire_ldk_node_send_spontaneous_payment_impl(port_, that, amount_msat, node_id) } #[wasm_bindgen] -pub fn wire_NodeBase_send_spontaneous_payment_probes( +pub fn wire_ldk_node_send_spontaneous_payment_probes( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, amount_msat: u64, node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) + wire_ldk_node_send_spontaneous_payment_probes_impl(port_, that, amount_msat, node_id) } #[wasm_bindgen] -pub fn wire_NodeBase_send_to_onchain_address( +pub fn wire_ldk_node_send_to_onchain_address( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, amount_sats: u64, ) { - wire_NodeBase_send_to_onchain_address_impl(port_, that, address, amount_sats) + wire_ldk_node_send_to_onchain_address_impl(port_, that, address, amount_sats) } #[wasm_bindgen] -pub fn wire_NodeBase_sign_message( +pub fn wire_ldk_node_sign_message( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, msg: Box<[u8]>, ) { - wire_NodeBase_sign_message_impl(port_, that, msg) + wire_ldk_node_sign_message_impl(port_, that, msg) } #[wasm_bindgen] -pub fn wire_NodeBase_start( +pub fn wire_ldk_node_spendable_onchain_balance_sats( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_start_impl(port_, that) + wire_ldk_node_spendable_onchain_balance_sats_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_status( +pub fn wire_ldk_node_start( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_status_impl(port_, that) + wire_ldk_node_start_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_stop( +pub fn wire_ldk_node_stop( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_stop_impl(port_, that) + wire_ldk_node_stop_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_sync_wallets( +pub fn wire_ldk_node_sync_wallets( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_sync_wallets_impl(port_, that) + wire_ldk_node_sync_wallets_impl(port_, that) } #[wasm_bindgen] -pub fn wire_NodeBase_update_channel_config( +pub fn wire_ldk_node_total_onchain_balance_sats( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_ldk_node_total_onchain_balance_sats_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire_ldk_node_update_channel_config( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, channel_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_update_channel_config_impl( + wire_ldk_node_update_channel_config_impl( port_, that, - user_channel_id, + channel_id, counterparty_node_id, channel_config, ) } #[wasm_bindgen] -pub fn wire_NodeBase_verify_signature( +pub fn wire_ldk_node_verify_signature( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, msg: Box<[u8]>, sig: String, pkey: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_verify_signature_impl(port_, that, msg, sig, pkey) + wire_ldk_node_verify_signature_impl(port_, that, msg, sig, pkey) } #[wasm_bindgen] -pub fn wire_NodeBase_wait_next_event( +pub fn wire_ldk_node_wait_next_event( port_: flutter_rust_bridge::for_generated::MessagePort, that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_NodeBase_wait_next_event_impl(port_, that) + wire_ldk_node_wait_next_event_impl(port_, that) } #[wasm_bindgen] -pub fn wire_finalize_builder( +pub fn wire_socket_address_as_string( port_: flutter_rust_bridge::for_generated::MessagePort, - config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - chain_data_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - entropy_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - gossip_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - liquidity_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, + that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, ) { - wire_finalize_builder_impl( - port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config, - ) + wire_socket_address_as_string_impl(port_, that) +} + +#[wasm_bindgen] +pub fn wire_socket_address_from_str( + port_: flutter_rust_bridge::for_generated::MessagePort, + address: String, +) { + wire_socket_address_from_str_impl(port_, address) } #[wasm_bindgen]